public object SaveAdminInfo(AdminInfo adminInfo, List<RegionInfo> RegionList, List<RegionInfo> manageRegionList) { bool baseResult = false; string resultMessage = ""; MemberManageBLL memberBLL = new MemberManageBLL(); if (!this.IsExsit(adminInfo.AdminPassport)) { adminInfo.AdminPassword = MD5Enry.SHA1HashString("1111111"); adminInfo.Valid = true; adminInfo.LastUpdateDate = DateTime.Now; adminInfo.RegionList = memberBLL.ConverListToSet<RegionInfo>(RegionList); adminInfo.ManageRegionList = memberBLL.ConverListToSet<RegionInfo>(manageRegionList); baseResult = this.IAdminManage.UpdateTableInfo<AdminInfo>(adminInfo); resultMessage = "添加成功!登录账号是:" + adminInfo.AdminPassport + " 密码是:1111111"; } else { resultMessage = "对不起 ,你的账号已经存在,请输入其它内容!"; } return new { state = baseResult, message = resultMessage }; }
public object UpdateAdminInfo(AdminInfo adminInfo, List<RegionInfo> RegionList, List<RegionInfo> manageRegionList) { bool baseResult = false; string resultMessage = ""; MemberManageBLL memberBLL = new MemberManageBLL(); adminInfo.LastUpdateDate = DateTime.Now; adminInfo.RegionList = memberBLL.ConverListToSet<RegionInfo>(RegionList); adminInfo.ManageRegionList = memberBLL.ConverListToSet<RegionInfo>(manageRegionList); baseResult = this.IAdminManage.UpdateTableInfo<AdminInfo>(adminInfo); resultMessage = "修改成功!"; return new { state = baseResult, message = resultMessage }; }