.net简单的三层实现功能(14)
来源:未知 责任编辑:责任编辑 发表时间:2015-09-16 20:04 点击:次
5 Dictionary<string, object> dic = new Dictionary<string, object>();
6 dic.Add("@AdminUID",user.AdminUID);
7 dic.Add("@AdminPWD", user.AdminPWD);
8 return DBHelp.ExecuteNonQuery(sql, dic) > 0 ? true : false;
9 }
10 //删
11 public static bool Delete(int UserID)
12 {
13 string sql = "delete from admin where AdminID=@AdminID";
14 Dictionary<string, object> dic = new Dictionary<string, object>();
15 dic.Add("AdminID",UserID);
16 return DBHelp.ExecuteNonQuery(sql, dic) > 0 ? true : false;
17 }
18 //改
19 public static bool Modelfy(Model.LoginModel user)
20 {
21 string sql = "update admin set AdminUID=@AdminUID and AdminPWD=@AdminPWD ";
22 Dictionary<string, object> dic = new Dictionary<string, object>();
23 dic.Add("AdminUID", user.AdminUID);
24 dic.Add("AdminPWD", user.AdminPWD);
25 return DBHelp.ExecuteNonQuery(sql, dic) > 0 ? true : false;
26 }
27 //查
28 public static List<LoginModel> GetAllUser()
29 {
30 string sql="select AdminUID,AdminPWD from admin";
31 DataTable dt = DBHelp.GetDataSet(sql);
32 List<LoginModel>list=new List<LoginModel>();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>