/// <summary> /// 更新状态 /// </summary> /// <param name="book"></param> /// <returns></returns> public bool Update(LMS_Map map) { // update LMS_Map set Bookstatu = 1 where Bookname = '在人间'; string sql = string.Format(@"update LMS_Map set flage={0} where number={1} ", map.Flage, map.Number); return(DBHeper.SQL(sql)); }
/// <summary> /// 更新状态 /// </summary> /// <param name="book"></param> /// <returns></returns> public bool Update(LMS_Category Category) { // update LMS_Category set Bookstatu = 1 where Bookname = '在人间'; string sql = string.Format(@"update LMS_Category set Category='{0}' where Categoryid={1} ", Category.Category, Category.Categoryid); return(DBHeper.SQL(sql)); }
/// <summary> /// 更新状态 /// </summary> /// <param name="book"></param> /// <returns></returns> public bool Update(LMS_Admin admin) { // update LMS_Admin set Bookstatu = 1 where Bookname = '在人间'; string sql = string.Format(@"update LMS_Admin set Adminname='{0}',Adminuid='{1}',Adminpwd='{2}' where Adminnumber={3} ", admin.Adminname, admin.Adminuid, admin.Adminpwd, admin.Adminnumber); return(DBHeper.SQL(sql)); }
/// <summary> /// 更新状态 /// </summary> /// <param name="book"></param> /// <returns></returns> public bool Update(LMS_Reder reder) { // update LMS_Reder set Bookstatu = 1 where Bookname = '在人间'; string sql = string.Format(@"update LMS_Reder set Userclass='{0}', Useridcard='{1}', Username='******',Usersex='{3}',Usertell ='{4}'where Usernumber={5} ", reder.Userclass, reder.Useridcard, reder.Username, reder.Usersex, reder.Usertell, reder.Usernumber); return(DBHeper.SQL(sql)); }
/// <summary> /// 更新状态 /// </summary> /// <param name="book"></param> /// <returns></returns> public bool Update(LMS_Book book) { // update LMS_Book set Bookstatu = 1 where Bookname = '在人间'; string sql = string.Format(@"update LMS_Book set Bookauthor='{0}',Bookcategoryid={1},Bookisbn='{2}',Bookname='{3}',Bookpress='{4}',Bookquantity={5} where Booknumber={6} ", book.Bookauthor, book.Bookcategoryid, book.Bookisbn, book.Bookname, book.Bookpress, book.Bookquantity, book.Booknumber); return(DBHeper.SQL(sql)); }
public bool Insert(LMS_Reder reder) { //拼接SQL string sql = string.Format(@"Insert into LMS_Reder( Userclass, Useridcard, Username,Usersex,Usertell) values('{0}', '{1}', '{2}','{3}','{4}')", reder.Userclass, reder.Useridcard, reder.Username, reder.Usersex, reder.Usertell); //连接数据库 执行SQL return(DBHeper.SQL(sql)); }
public bool Insert(LMS_Map map) { //拼接SQL string sql = string.Format(@"Insert into LMS_Map ( Booknumber,Usernumber,Borrowingdate,Returndate,flage) values({0},{1},'{2}','{3}',1 )", map.Booknumber, map.Usernumber, map.Borrowingdate, map.Returndate); //连接数据库 执行SQL return(DBHeper.SQL(sql)); }
public bool Insert(LMS_Category Category) { //拼接SQL string sql = string.Format(@"Insert into LMS_Category ( Category ) values('{0}' )", Category.Category ); //连接数据库 执行SQL return(DBHeper.SQL(sql)); }
public LMS_Category Select(string sql) { LMS_Category LMS_Category = new LMS_Category(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); //如果有数据 将DataTable载入到LMS_Category对象 if (data.Rows.Count > 0) { var row = data.Rows[0]; LMS_Category.Category = row["Category"].ToString(); LMS_Category.Categoryid = (int)row["Categoryid"]; } //返回书籍信息 return(LMS_Category); }
public LMS_Admin Select(string sql) { LMS_Admin LMS_Admin = new LMS_Admin(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); //如果有数据 将DataTable载入到LMS_Admin对象 if (data.Rows.Count > 0) { var row = data.Rows[0]; LMS_Admin.Adminname = row["Adminname"].ToString(); LMS_Admin.Adminnumber = (int)row["Adminnumber"]; LMS_Admin.Adminuid = row["Adminuid"].ToString(); LMS_Admin.Adminpwd = row["Adminpwd"].ToString(); } //返回书籍信息 return(LMS_Admin); }
public List <LMS_Category> SelectList(string sql) { List <LMS_Category> list = new List <LMS_Category>(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); foreach (DataRow row in data.Rows) { //利用将当前行数据 新建用户对象 LMS_Category LMS_Category = new LMS_Category(); LMS_Category.Category = row["Category"].ToString(); LMS_Category.Categoryid = (int)row["Categoryid"]; //将用户对象 存入列表 list.Add(LMS_Category); } //返回列表 return(list); }
public bool Insert(LMS_Book book) { //拼接SQL string sql = string.Format(@"Insert into LMS_Book ( Bookauthor, Bookcategoryid, Bookisbn, Bookname, Bookpress, Bookquantity ) values('{0}',{1}, '{2}','{3}','{4}','{5}')", book.Bookauthor, book.Bookcategoryid, book.Bookisbn, book.Bookname, book.Bookpress, book.Bookquantity ); //连接数据库 执行SQL return(DBHeper.SQL(sql)); }
public bool Insert(LMS_Admin admin) { //拼接SQL string sql = string.Format(@"Insert into LMS_Admin ( Adminname, Adminuid, Adminpwd ) values('{0}', '{1}', '{2}')", admin.Adminname, admin.Adminuid, admin.Adminpwd ); //连接数据库 执行SQL return(DBHeper.SQL(sql)); }
public List <LMS_Admin> SelectList(string sql) { List <LMS_Admin> list = new List <LMS_Admin>(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); foreach (DataRow row in data.Rows) { //利用将当前行数据 新建用户对象 LMS_Admin LMS_Admin = new LMS_Admin(); LMS_Admin.Adminname = row["Adminname"].ToString(); LMS_Admin.Adminnumber = (int)row["Adminnumber"]; LMS_Admin.Adminuid = row["Adminuid"].ToString(); LMS_Admin.Adminpwd = row["Adminpwd"].ToString(); //将用户对象 存入列表 list.Add(LMS_Admin); } //返回列表 return(list); }
public LMS_Map Select(string sql) { LMS_Map LMS_Map = new LMS_Map(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); //如果有数据 将DataTable载入到LMS_Map对象 if (data.Rows.Count > 0) { var row = data.Rows[0]; LMS_Map.Booknumber = (int)row["Booknumber"]; LMS_Map.Usernumber = (int)row["Usernumber"]; LMS_Map.Borrowingdate = row["Borrowingdate"].ToString(); LMS_Map.Returndate = row["Returndate"].ToString(); LMS_Map.Flage = (int)row["Flage"]; LMS_Map.Number = (int)row["Number"]; } //返回书籍信息 return(LMS_Map); }
public LMS_Reder Select(string sql) { LMS_Reder LMS_Reder = new LMS_Reder(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); //如果有数据 将DataTable载入到LMS_Reder对象 if (data.Rows.Count > 0) { var row = data.Rows[0]; LMS_Reder.Userclass = row["Userclass"].ToString(); LMS_Reder.Useridcard = row["Useridcard"].ToString(); LMS_Reder.Username = row["Username"].ToString(); LMS_Reder.Usernumber = (int)row["Usernumber"]; LMS_Reder.Usersex = row["Usersex"].ToString(); LMS_Reder.Usertell = row["Usertell"].ToString(); } //返回书籍信息 return(LMS_Reder); }
public LMS_Book Select(string sql) { LMS_Book LMS_Book = new LMS_Book(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); //如果有数据 将DataTable载入到LMS_Book对象 if (data.Rows.Count > 0) { var row = data.Rows[0]; LMS_Book.Bookauthor = row["Bookauthor"].ToString(); LMS_Book.Bookcategoryid = (int)row["Bookcategoryid"]; LMS_Book.Bookisbn = row["Bookisbn"].ToString(); LMS_Book.Bookname = row["Bookname"].ToString(); LMS_Book.Booknumber = (int)row["Booknumber"]; LMS_Book.Bookpress = row["Bookpress"].ToString(); LMS_Book.Bookquantity = (int)row["Bookquantity"]; } //返回书籍信息 return(LMS_Book); }
public List <LMS_Reder> SelectList(string sql) { List <LMS_Reder> list = new List <LMS_Reder>(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); foreach (DataRow row in data.Rows) { //利用将当前行数据 新建用户对象 LMS_Reder LMS_Reder = new LMS_Reder(); LMS_Reder.Userclass = row["UserClass"].ToString(); LMS_Reder.Useridcard = row["Useridcard"].ToString(); LMS_Reder.Username = row["Username"].ToString(); LMS_Reder.Usernumber = (int)row["Usernumber"]; LMS_Reder.Usersex = row["Usersex"].ToString(); LMS_Reder.Usertell = row["Usertell"].ToString(); //将用户对象 存入列表 list.Add(LMS_Reder); } //返回列表 return(list); }
public List <LMS_Map> SelectList(string sql) { List <LMS_Map> list = new List <LMS_Map>(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); foreach (DataRow row in data.Rows) { //利用将当前行数据 新建用户对象 LMS_Map LMS_Map = new LMS_Map(); LMS_Map.Booknumber = (int)row["Booknumber"]; LMS_Map.Usernumber = (int)row["Usernumber"]; LMS_Map.Borrowingdate = row["Borrowingdate"].ToString(); LMS_Map.Returndate = row["Returndate"].ToString(); LMS_Map.Flage = (int)row["Flage"]; LMS_Map.Number = (int)row["Number"]; //将用户对象 存入列表 list.Add(LMS_Map); } //返回列表 return(list); }
public List <LMS_Book> SelectList(string sql) { List <LMS_Book> list = new List <LMS_Book>(); //从数据库获取信息 DataTable data = DBHeper.Select(sql); foreach (DataRow row in data.Rows) { //利用将当前行数据 新建用户对象 LMS_Book LMS_Book = new LMS_Book(); LMS_Book.Bookauthor = row["Bookauthor"].ToString(); LMS_Book.Bookcategoryid = (int)row["Bookcategoryid"]; LMS_Book.Bookisbn = row["Bookisbn"].ToString(); LMS_Book.Bookname = row["Bookname"].ToString(); LMS_Book.Booknumber = (int)row["Booknumber"]; LMS_Book.Bookpress = row["Bookpress"].ToString(); LMS_Book.Bookquantity = (int)row["Bookquantity"]; //将用户对象 存入列表 list.Add(LMS_Book); } //返回列表 return(list); }
/// <summary> /// 删除用户 /// </summary> /// <param name="uid"> 账户id</param> /// <returns> </returns> public bool Del(int uid) { string sql = string.Format(@"Delete from LMS_Map where number = {0}", uid); return(DBHeper.SQL(sql)); }
/// <summary> /// 更新状态,解决int值不能为null /// </summary> /// <param name="book"></param> /// <returns></returns> //public bool UpdateEx(LMS_Admin book) //{ // // update LMS_Admin set Bookstatu = 1 where Bookname = '在人间'; // string sql = string.Format(@"update LMS_Admin set Bookstatu={0},UID=null where Bookname='{1}' ", book.Bookstatu, book.Bookname); // return DBHeper.SQL(sql); //} /// <summary> /// 删除用户 /// </summary> /// <param name="uid"> 账户id</param> /// <returns> </returns> public bool Del(int uid) { string sql = string.Format(@"Delete from LMS_Admin where Adminnumber = '{0}'", uid); return(DBHeper.SQL(sql)); }