Пример #1
0
        /// <summary>
        /// Deletes an admin user just by its Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Flag as true if deleted successfully else false</returns>
        public bool DeleteAdmin(int id)
        {
            AdminEditRemove adminRemove = new AdminEditRemove();

            if (adminRemove.RemoveAdmin(id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
 /// <summary>
 /// Updates Admin Profile Info by wrapping it into User Object.
 /// </summary>
 /// <param name="user"></param>
 /// <returns>Flag as true if Updated Successfully else false</returns>
 public bool UpdateAdmin(Users user)
 {
     try
     {
         AdminEditRemove adminEdit = new AdminEditRemove();
         user.Password = encrypt.Encrypt(user.Password);
         return(adminEdit.EditAdmin(user));
     }
     catch (EmailAlreadyExistsEx ex)
     {
         throw new EmailAlreadyExistsEx("Email already exists");
     }
     catch (PhoneAlreadyExistsEx ex)
     {
         throw new PhoneAlreadyExistsEx("Phone number already exists");
     }
     catch (Exception e)
     {
         throw e;
     }
 }