public ActionResult Check(int Id) { var dto = new PartnerManageCheck() { PartnerManageId = Id }; var mod = _PartnerManageCheckContract.Entities.FirstOrDefault(a => a.PartnerManageId == Id); if (mod.IsNotNull()) { dto = mod; } ViewBag.StoreTypes = CacheAccess.GetStoreType(_StoreTypeContract, false); Dictionary <int, string> dic = new Dictionary <int, string>(); var rols = CacheAccess.GetRoles(_roleContract).Where(c => c.IsDeleted == false && c.IsEnabled == true); foreach (var item in rols) { dic.Add(item.Id, item.RoleName); } ViewBag.roles = dic; return(PartialView(dto)); }
public ActionResult ExisRoleName(string name) { OperationResult resul = new OperationResult(OperationResultType.Error); if (!string.IsNullOrEmpty(name)) { bool exis = CacheAccess.GetRoles(_roleContract).Where(c => c.IsDeleted == false && c.IsEnabled == true && c.RoleName == name).Count() > 0; if (exis) { resul = new OperationResult(OperationResultType.Success, "已存在同名的角色"); } } return(Json(resul)); }
public ActionResult Update(int Id) { var modDes = _designerContract.View(Id); ViewBag.Designer = modDes; var modAdmin = modDes.Admin; Dictionary <int, string[]> roles = new Dictionary <int, string[]>(); List <int> adRole = new List <int>(); if (modAdmin != null) { adRole = modAdmin.Roles.Where(c => c.IsDeleted == false && c.IsEnabled == true).Select(c => c.Id).ToList(); } var roleLis = CacheAccess.GetRoles(_roleContract).Where(c => c.IsDeleted == false && c.IsEnabled == true); foreach (var item in roleLis) { string selected = adRole.Contains(item.Id) ? "1" : "0"; roles.Add(item.Id, new string[] { item.RoleName, selected }); } ViewBag.roles = roles; return(PartialView(modAdmin)); }