public DataTable GetUserByEmail(string Email, int Status) { DataTable tbResult = new DataTable(); cUsers objDAL = new cUsers(); tbResult = objDAL.GetUserByEmail(Email, Status); return tbResult; }
public int Insert() { int nResult = 0; cUsers objInfor = new cUsers(); try { objInfor.AddNew(); this.MappingData(objInfor); objInfor.Save(); nResult = objInfor.UserID; } catch { nResult = 0; } return nResult; }
public int DeleteById(int ID) { int nResult = 0; cUsers objDAL = new cUsers(); try { objDAL.LoadByPrimaryKey(ID); objDAL.MarkAsDeleted(); objDAL.Save(); nResult = ID; } catch { nResult = 0; } return nResult; }
public DataTable Search(int ItemView, string Username, int Status, int PageIndex, int PageSize, ref int PageCount) { DataTable tbResult = new DataTable(); cUsers objDAL = new cUsers(); tbResult = objDAL.Search(ItemView, Username, Status, PageIndex, PageSize, ref PageCount); return tbResult; }
public void LoadById(int ID) { cUsers objDAL = new cUsers(); objDAL.LoadByPrimaryKey(ID); ConvertData(objDAL); }
private void MappingData(cUsers objInfor) { objInfor.Username = Data.Username; objInfor.Password = Data.Password; objInfor.Email = Data.Email; objInfor.Status = Data.Status; objInfor.RoleID = Data.RoleID; }
private void ConvertData(cUsers objInfor) { Data.Username = objInfor.Username; Data.Password = objInfor.Password; Data.Email = objInfor.Email; Data.Status = objInfor.Status; Data.RoleID = objInfor.RoleID; }
public int UpdateStatus(int ID, int Status) { int nResult = 0; cUsers objDAL = new cUsers(); try { objDAL.LoadByPrimaryKey(ID); objDAL.Status = Status; objDAL.Save(); nResult = objDAL.UserID; } catch { nResult = 0; } return nResult; }
public int Update(int ID) { int nResult = 0; cUsers objInfor = new cUsers(); try { objInfor.LoadByPrimaryKey(ID); this.MappingData(objInfor); objInfor.Save(); nResult = ID; } catch { nResult = 0; } return nResult; }