DAL/AdveDAL.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entitry;
using Common;
using System.Data.SqlClient;
namespace DAL
{
public class AdveDAL
{
public static List<Adve> selectAdve()
{
string sql = "select * from Advertisement";
List<Adve> alist = new List<Adve>();
SqlDataReader sqlReader = DBHelp.SelectData(sql);
while (sqlReader.Read())
{
Adve a = new Adve();
a.id = (int)sqlReader["id"];
a.imgUrl = (string)sqlReader["imgUrl"];
alist.Add(a);
}
sqlReader.Close();
return alist;
}
public static int DelAdve(int id)
{
string sql = "delete from Advertisement where id='"+id+"'";
int num = DBHelp.DeleteDate(sql);
return num;
}
public static int AddEvde(string url)
{
string sql="insert into Advertisement values('"+url+"')";
int num=DBHelp.AddData(sql);
return num;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。