public class AdminManager { private AdminService adminService = new AdminService(); public int DeleteAdmin(int id) { return adminService.DeleteAdminById(id); } public int DeleteAdmin(Admin admin) { return adminService.DeleteAdminById(admin.Id); } public List<Admin> GetAllAdmin() { return adminService.GetAllAdmin(); } public int UpdateAdmin(Admin admin) { return adminService.UpdateAdmin(admin); } public List<Admin> GetAdminByNameAndPhone(string name, string phone) { return adminService.GetAdminByNameAndPhone(name, phone); } public Admin GetAdminById(int id) { return adminService.GetAdmin(id); } #region 分页查询 public List<Admin> GetAdminPages(int pageSize,int pageIndex) { return adminService.GetAdminPages(pageSize, pageIndex); } public int GetAdminPageNum(int pageSize) { return adminService.GetAdminPageNums(pageSize); } public List<Admin> GetAdminPagesNew(int pageSize,int pageIndex,string where) { return adminService.GetAdminPagesNew(pageSize, pageIndex, where); } #endregion #region 管理员登陆 /// <summary> /// 管理员登录 /// </summary> /// <param name="admin">管理员对象</param> /// <returns>登录状态</returns> public bool Login(ref Admin admin) { admin = adminService.GetAdminByParas(admin); if (admin.Id != 0) { return true; } return false; } #endregion }