/// <summary> /// 重写管理员信息 /// </summary> public static bool Add(M_AdminInfo madmin) { string strHostIP = HttpContext.Current.Request.UserHostAddress; madmin.AdminPassword = StringHelper.MD5(madmin.AdminPassword); madmin.RoleList = "1"; madmin.UserName = madmin.AdminName; madmin.LastLoginIP = strHostIP; madmin.EnableModifyPassword = true; madmin.EnableMultiLogin = true; madmin.RandNumber = "123456"; madmin.RandNumber = "123456"; madmin.AdminType = 1; madmin.PubRole = 1; madmin.DefaultStart = 99; if (B_Admin.IsExist(madmin.AdminName)) { madmin.ManageNode = ""; madmin.AdminId = B_Admin.GetAdminByAdminName(madmin.AdminName).AdminId; return(B_Admin.Update(madmin)); } else { madmin.Theme = ""; madmin.LastLoginTime = DateTime.Now; madmin.LastLogoutTime = DateTime.Now; madmin.LastModifyPasswordTime = DateTime.Now; madmin.ManageNode = ""; madmin.AdminTrueName = madmin.AdminName; return(B_Admin.Add(madmin)); } }
/// <summary> /// 重写管理员信息 /// </summary> public static bool Add(M_AdminInfo madmin) { madmin.AdminPassword = StringHelper.MD5(madmin.AdminPassword); madmin.UserName = madmin.AdminName; if (B_Admin.IsExist(madmin.AdminName)) { madmin.AdminId = B_Admin.GetAdminByAdminName(madmin.AdminName).AdminId; return(B_Admin.Update(madmin)); } else { madmin.AdminTrueName = madmin.AdminName; return((B_Admin.Add(madmin)) > 0); } }