예제 #1
0
 public DataTable GetUserByEmail(string Email, int Status)
 {
     DataTable tbResult = new DataTable();
     cUsers objDAL = new cUsers();
     tbResult = objDAL.GetUserByEmail(Email, Status);
     return tbResult;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }
예제 #5
0
 public void LoadById(int ID)
 {
     cUsers objDAL = new cUsers();
     objDAL.LoadByPrimaryKey(ID);
     ConvertData(objDAL);
 }
예제 #6
0
 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;
 }
예제 #7
0
 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;
 }
예제 #8
0
        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;
        }
예제 #9
0
 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;
 }