public bool Delete(DepartmentEntity en) { DataBase db = new DataBase(); string comstr = "Delete from Department where DepartmentNameID=@DepartmentID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@DepartmentID", SqlDbType.Int, 4) }; param[0].Value = en.DepartmentID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Delete(PowerEntity en) { DataBase db = new DataBase(); string comstr = "Delete from Powers where PowerID=@PowerID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@PowerID", SqlDbType.Int, 4) }; param[0].Value = en.PowerID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Add(ManagerPagePowerEnitity en) { DataBase db = new DataBase(); string comstr = "Insert into ManagerPagePower(ManagerID,ID) values(@ManagerID,@ID)"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@ID", SqlDbType.Int, 4); param[0].Value = en.Id; param[1] = new SqlParameter("@ManagerID", SqlDbType.VarChar, 50); param[1].Value = en.ManagerID; return(db.ExecuteSql(comstr, param) > 0); }
public bool UpdateOverDate(UserEntity en, int day) { DataBase db = new DataBase(); string comstr = "update users set OverDate=OverDate+@Day where UserID=@UserID"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[0].Value = en.UserID; param[1] = new SqlParameter("@Day", SqlDbType.Int); param[1].Value = day; return(db.ExecuteSql(comstr, param) > 0); }
public bool DeleteByManager(ManagerPagePowerEnitity en) { DataBase db = new DataBase(); string comstr = "delete ManagerPagePower where ManagerID=@ManagerID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@ManagerID", SqlDbType.VarChar, 50) }; param[0].Value = en.ManagerID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Delete(PaperTypeEntity en) { DataBase db = new DataBase(); string sql = "delete PaperType where PTID=@PTID"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@PTID", SqlDbType.Int) }; para[0].Value = en.PTID; return(db.ExecuteSql(sql, para) == 1); }
public bool Add(DepartmentEntity en) { DataBase db = new DataBase(); string comstr = "insert into Department(DepartmentName,DepartmentDes) values (@DepartmentName,@DepartmentDes)"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@DepartmentName", SqlDbType.VarChar, 100); param[0].Value = en.DepartmentName; param[1] = new SqlParameter("@DepartmentDes", SqlDbType.VarChar, 500); param[1].Value = en.DepartmentDes; return(db.ExecuteSql(comstr, param) > 0); }
public bool Delete(UserEntity en) { DataBase db = new DataBase(); string comstr = "Delete from users where UserID=@UserID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@UserID", SqlDbType.VarChar, 50) }; param[0].Value = en.UserID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Update_Pwd(ClientEntity en) { DataBase db = new DataBase(); string comstr = "update Client set ClientPwd=@ClientPwd where ClientID=@ClientID"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@ClientID", SqlDbType.VarChar, 50); param[0].Value = en.ClientID; param[1] = new SqlParameter("@ClientPwd", SqlDbType.VarChar, 50); param[1].Value = en.ClientPwd; return(db.ExecuteSql(comstr, param) > 0); }
public bool Update_Pwd(ManagerEnitity en) { DataBase db = new DataBase(); string comstr = "update Manager set ManagerPwd=@ManagerPwd where ManagerID=@ManagerID"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@ManagerID", SqlDbType.VarChar, 50); param[0].Value = en.ManagerID; param[1] = new SqlParameter("@ManagerPwd", SqlDbType.VarChar, 50); param[1].Value = en.ManagerPwd; return(db.ExecuteSql(comstr, param) > 0); }
public bool Update_Pwd(UserEntity en) { DataBase db = new DataBase(); string comstr = "Update users set userpwd=@userpwd where UserID=@UserID"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[0].Value = en.UserID; param[1] = new SqlParameter("@userpwd", SqlDbType.VarChar, 50); param[1].Value = en.UserPwd; return(db.ExecuteSql(comstr, param) > 0); }
public bool Update_Integral(UserEntity en) { DataBase db = new DataBase(); string sql = "update users set UserIntegral=@UserIntegral where UserID=@UserID"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@UserIntegral", SqlDbType.Int); param[0].Value = en.UserIntegral; param[1] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[1].Value = en.UserID; return(db.ExecuteSql(sql, param) > 0); }
public bool Delete(PagesEnitity en) { DataBase db = new DataBase(); string comstr = "delete Pages where id=@ID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.Int, 4) }; param[0].Value = en.Id; return(db.ExecuteSql(comstr, param) > 0); }
public bool Delete(UserIntegralDetailEntity mo) { DataBase db = new DataBase(); string sql = "delete from UserIntegralDetail where DetailID=@DetailID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@DetailID", SqlDbType.Int) }; param[0].Value = mo.DetailID; return(db.ExecuteSql(sql, param) > 0); }
public bool Update_Des(PagesEnitity en) { DataBase db = new DataBase(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@PageDes", SqlDbType.VarChar, 200); param[0].Value = en.PageDes; param[0] = new SqlParameter("@ID", SqlDbType.Int, 4); param[0].Value = en.Id; string comstr = "update Pages set PageDes=@PageDes where id=@ID"; return(db.ExecuteSql(comstr, param) > 0); }
public bool Add(PowerEntity en) { DataBase db = new DataBase(); string comstr = "insert into Powers(PowerID,PowerName,PowerDes) values(@PowerID,@PowerName,@PowerDes)"; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@PowerName", SqlDbType.VarChar, 100); param[0].Value = en.PowerName; param[1] = new SqlParameter("@PowerDes", SqlDbType.VarChar, 500); param[1].Value = en.PowerDes; param[2] = new SqlParameter("@PowerID", SqlDbType.Int, 4); param[2].Value = en.PowerID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Add(PaperTypeEntity en) { DataBase db = new DataBase(); string sql = "insert into PaperType (PTID,PTName,PTDesc) values (@PTID,@PTName,@PTDesc)"; SqlParameter[] para = new SqlParameter[3]; para[0] = new SqlParameter("@PTName", SqlDbType.VarChar, 128); para[0].Value = en.TypeName; para[1] = new SqlParameter("@PTDesc", SqlDbType.VarChar, -1); para[1].Value = en.TypeDes; para[2] = new SqlParameter("@PTID", SqlDbType.Int); para[2].Value = en.PTID; return(db.ExecuteSql(sql, para) == 1); }
public bool Update_Sort(PagesEnitity en) { DataBase db = new DataBase(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@PageSort", SqlDbType.Int, 4); param[0].Value = en.PageSort; param[1] = new SqlParameter("@ID", SqlDbType.Int, 4); param[1].Value = en.Id; string comstr = "Update Pages set PageSort=@PageSort where id=@ID "; comstr += "update pages set pid=@pageSort where parentid=@ID "; return(db.ExecuteSql(comstr, param) > 0); }
public bool Update(PaperTypeEntity en) { DataBase db = new DataBase(); string sql = "update PaperType set PTName=@PTName,PTDesc=@PTDesc where PTID=@PTID"; SqlParameter[] para = new SqlParameter[3]; para[0] = new SqlParameter("@PTName", SqlDbType.VarChar, 128); para[0].Value = en.TypeName; para[1] = new SqlParameter("@PTDesc", SqlDbType.VarChar, -1); para[1].Value = en.TypeDes; para[2] = new SqlParameter("@PTID", SqlDbType.Int); para[2].Value = en.PTID; return(db.ExecuteSql(sql, para) == 1); }
public bool Update_Back(UserHolidayEntity mo) { DataBase db = new DataBase(); string sql = "update UserHoliday set ManagerBack=@ManagerBack,RecordState=@RecordState where UserHolidayID=@UserHolidayID"; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@UserHolidayID", SqlDbType.Int); param[0].Value = mo.UserHolidayID; param[1] = new SqlParameter("@ManagerBack", SqlDbType.VarChar, 1000); param[1].Value = mo.ManagerBack; param[2] = new SqlParameter("@RecordState", SqlDbType.Int); param[2].Value = mo.RecordState; return(db.ExecuteSql(sql, param) > 0); }
public bool Add(UserIntegralDetailEntity mo) { DataBase db = new DataBase(); string sql = "insert into UserIntegralDetail(UserID,IntegralChange,ChangeDes) values(@UserID,@IntegralChange,@ChangeDes)"; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[0].Value = mo.UserID; param[1] = new SqlParameter("@IntegralChange", SqlDbType.Int); param[1].Value = mo.IntegralChange; param[2] = new SqlParameter("@ChangeDes", SqlDbType.VarChar, 1000); param[2].Value = mo.ChangeDes; return(db.ExecuteSql(sql, param) > 0); }
public bool Update(UserIntegralDetailEntity mo) { DataBase db = new DataBase(); string sql = "update UserIntegralDetail set UserID=@UserID,IntegralChange=@IntegralChange,ChangeDes=@ChangeDes where DetailID=@DetailID"; SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[0].Value = mo.UserID; param[1] = new SqlParameter("@IntegralChange", SqlDbType.Int); param[1].Value = mo.IntegralChange; param[2] = new SqlParameter("@ChangeDes", SqlDbType.VarChar, 1000); param[2].Value = mo.ChangeDes; param[3] = new SqlParameter("@DetailID", SqlDbType.Int); param[3].Value = mo.DetailID; return(db.ExecuteSql(sql, param) > 0); }
public bool Add(UserEntity en) { DataBase db = new DataBase(); string comstr = "Insert into users (userID,userPwd,userName,userImage,userDes) values(@userID,@userPwd,@userName,@userImage,@userDes)"; SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@userID", SqlDbType.VarChar, 50); param[0].Value = en.UserID; param[1] = new SqlParameter("@userPwd", SqlDbType.VarChar, 50); param[1].Value = en.UserPwd; param[2] = new SqlParameter("@userName", SqlDbType.VarChar, 50); param[2].Value = en.UserName; param[3] = new SqlParameter("@userImage", SqlDbType.VarChar, 200); param[3].Value = en.UserImage; param[4] = new SqlParameter("@userDes", SqlDbType.VarChar, -1); param[4].Value = en.UserDes; return(db.ExecuteSql(comstr, param) > 0); }
public bool Add(PagesEnitity en) { DataBase db = new DataBase(); string comstr = "insert into Pages(PageSort,ParentID,PID,PageName,PageUrl) values(@PageSort,@ParentID,@PID,@PageName,@PageUrl)"; SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@PageSort", SqlDbType.Int, 4); param[0].Value = en.PageSort; param[1] = new SqlParameter("@ParentID", SqlDbType.Int); param[1].Value = en.ParentID; param[2] = new SqlParameter("@PageName", SqlDbType.VarChar, 100); param[2].Value = en.PageName; param[3] = new SqlParameter("@PageUrl", SqlDbType.VarChar, 200); param[3].Value = en.PageURL; param[4] = new SqlParameter("@PID", SqlDbType.Int); param[4].Value = en.PID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Add(UserHolidayEntity mo) { DataBase db = new DataBase(); string sql = "insert into UserHoliday(UserID,UserHolidayDes,DateUp,RecordState) values(@UserID,@Des,@DateUp,@RecordState)"; SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); param[0].Value = mo.UserID; param[1] = new SqlParameter("@Des", SqlDbType.VarChar, 1000); param[1].Value = mo.Des; param[2] = new SqlParameter("@DateUp", SqlDbType.DateTime); param[2].Value = mo.DateUp; param[3] = new SqlParameter("@RecordState", SqlDbType.Int); param[3].Value = mo.RecordState; return(db.ExecuteSql(sql, param) > 0); }
public bool Add(ClientEntity en) { DataBase db = new DataBase(); string comstr = "Insert into Client (ClientID,ClientName,ClientPwd,ClientImage,ClientDes)values(@ClientID,,@ClientName,@ClientPwd,@ClientImage,@ClientDes)"; SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@ClientID", SqlDbType.VarChar, 50); param[0].Value = en.ClientID; param[1] = new SqlParameter("@ClientName", SqlDbType.VarChar, 100); param[1].Value = en.ClientName; param[2] = new SqlParameter("@ClientPwd", SqlDbType.VarChar, 50); param[2].Value = en.ClientPwd; param[3] = new SqlParameter("@ClientImage", SqlDbType.VarChar, 500); param[3].Value = en.ClientImage; param[4] = new SqlParameter("@ClientDes", SqlDbType.VarChar, 500); param[4].Value = en.ClientDes; return(db.ExecuteSql(comstr, param) > 0); }
public bool Register(ClientEntity en) { DataBase db = new DataBase(); string sql = "Insert into Client (ClientID,ClientName,ClientPwd,ClientDes) values(@clientID,@ClientName,@clientPwd,@clientDes)"; SqlParameter[] p = new SqlParameter[4]; p[0] = new SqlParameter("@ClientID", SqlDbType.VarChar, 50); p[0].Value = en.ClientID; p[1] = new SqlParameter("@ClientPwd", SqlDbType.VarChar, 50); p[1].Value = en.ClientPwd; p[2] = new SqlParameter("@ClientDes", SqlDbType.VarChar, 256); p[2].Value = en.ClientDes; p[3] = new SqlParameter("@ClientName", SqlDbType.VarChar, 256); p[3].Value = en.ClientName; int b = db.ExecuteSql(sql, p); return(b > 0); }
public bool Update(DepartmentEntity en) { DataBase db = new DataBase(); string comstr = "Update Department set"; int flag = 0; if (en.DepartmentName == null) { en.DepartmentName = ""; } else { comstr += " DepartmentName=@DepartmentName"; flag++; } if (en.DepartmentDes == null) { en.DepartmentDes = ""; } else { if (flag == 0) { comstr += " DepartmentDes=@DepartmentDes"; flag++; } else { comstr += " ,DepartmentDes=@DepartmentDes"; } } comstr += " where DepartmentID=@DepartmentID"; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@DepartmentName", SqlDbType.VarChar, 100); param[0].Value = en.DepartmentName; param[1] = new SqlParameter("@DepartmentDes", SqlDbType.VarChar, 500); param[1].Value = en.DepartmentDes; param[2] = new SqlParameter("@DepartmentID", SqlDbType.Int, 4); param[2].Value = en.DepartmentID; return(db.ExecuteSql(comstr, param) > 0); }
public bool Register(UserEntity en) { DataBase db = new DataBase(); string sql = "Insert into users (userID,DepartmentID,userPwd,userName,userDes) values(@userID,@departmentID,@userPwd,@userName,@userDes)"; SqlParameter[] p = new SqlParameter[5]; p[0] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); p[0].Value = en.UserID; p[1] = new SqlParameter("@UserName", SqlDbType.VarChar, 50); p[1].Value = en.UserName; p[2] = new SqlParameter("@UserPwd", SqlDbType.VarChar, 50); p[2].Value = en.UserPwd; p[3] = new SqlParameter("@UserDes", SqlDbType.VarChar, 500); p[3].Value = en.UserDes; p[4] = new SqlParameter("@departmentID", SqlDbType.Int, 4); p[4].Value = en.DepartmentID; int b = db.ExecuteSql(sql, p); return(b > 0); }
public bool Add(ManagerEnitity en) { DataBase db = new DataBase(); string comstr = "Insert into Manager (ManagerID,DepartmentID,PowerID,ManagerName,ManagerPwd,ManagerImage,ManagerDes)values(@ManagerID,@DepartmentID,@PowerID,@ManagerName,@ManagerPwd,@ManagerImage,@ManagerDes)"; SqlParameter[] param = new SqlParameter[7]; param[0] = new SqlParameter("@ManagerID", SqlDbType.VarChar, 50); param[0].Value = en.ManagerID; param[1] = new SqlParameter("@DepartmentID", SqlDbType.Int, 4); param[1].Value = en.DepartmentID; param[2] = new SqlParameter("@PowerID", SqlDbType.Int, 4); param[2].Value = en.PowerID; param[3] = new SqlParameter("@ManagerName", SqlDbType.VarChar, 100); param[3].Value = en.ManagerName; param[4] = new SqlParameter("@ManagerPwd", SqlDbType.VarChar, 50); param[4].Value = en.ManagerPwd; param[5] = new SqlParameter("@ManagerImage", SqlDbType.VarChar, 500); param[5].Value = en.ManagerImage; param[6] = new SqlParameter("@ManagerDes", SqlDbType.VarChar, 500); param[6].Value = en.ManagerDes; return(db.ExecuteSql(comstr, param) > 0); }