/// <summary> /// 删除管理员 /// </summary> /// <param name="adminId"></param> /// <param name="deleteId"></param> /// <returns></returns> public bool Delete(int adminId, int deleteId) { if (adminId <= 0 || deleteId <= 0) return false; int result = new DR_Admin().Delete(adminId, deleteId); return result == 1; }
/// <summary> /// 重置密码 /// </summary> /// <param name="adminId"></param> /// <returns></returns> public string ResetPwd(int adminId) { if (adminId <= 0) return ""; string newPwd = "ABC123456"; int result = new DR_Admin().ResetPwd(adminId, newPwd.MD5()); if (result == 0) return ""; else return newPwd; }
/// <summary> /// 修改二级密码 /// </summary> /// <param name="adminID"></param> /// <param name="oldPwd"></param> /// <param name="newPwd"></param> /// <returns></returns> public CYJH_OrderSystem.Admin.Base.Contract.Enums.EUpdatePwdReturn UpdatePwd(int adminID, string oldPwd, string newPwd) { if (adminID <= 0) return CYJH_OrderSystem.Admin.Base.Contract.Enums.EUpdatePwdReturn.Error; int result = new DR_Admin().UpdatePwd(adminID, oldPwd.MD5(), newPwd.MD5()); return (CYJH_OrderSystem.Admin.Base.Contract.Enums.EUpdatePwdReturn)result; }
/// <summary> /// 管理员登录后台 /// </summary> /// <param name="userName">登录名</param> /// <param name="userPwdMD5">密码密文</param> /// <param name="userIp">用户IP</param> /// <param name="model">输出值,当前登录用户的基本信息</param> /// <returns></returns> public bool Login(string userName, string userPwdMD5, string userIp, out MR_Admin model) { model = new DR_Admin().GetModel(userName, userPwdMD5, userIp); if (model == null || model.AID < 0) return false; return true; }