public JsonResult SaveAdmin(int adminId, string lname, string rname, string pwd) { RetechWing.Models.Oper.SysAdmin admin; if (adminId == 0) { admin = new Models.Oper.SysAdmin(); admin.IsDelete = 0; admin.IsLock = 0; admin.LoginFailureCount = 0; admin.LoginName = lname; } else { admin = _adminManager.GetAdminById(adminId); } admin.Realname = rname; admin.Password = pwd.GetMd5(); if (adminId == 0) { _adminManager.AddAdmin(admin); } else { _adminManager.UpdateAdmin(admin); } return(Json(new { result = 1, msg = @RetechWing.LanguageResources.Exam.Exampaper.SaveSuccess }, JsonRequestBehavior.DenyGet)); }
public ActionResult AdminDetail(int adminId = 0, string mode = "edit") { var admin = _adminManager.GetAdminById(adminId); if (admin == null) { admin = new Models.Oper.SysAdmin(); } ViewBag.mode = string.IsNullOrEmpty(mode) ? "edit" : mode; return(View(admin)); }