public void SubmitForm(RoleBaseEntity roleBaseEntity, string[] permissionIds, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { roleBaseEntity.F_Id = keyValue; } else { roleBaseEntity.F_Id = Common.Common.GuId(); } var moduledata = _moduleService.GetList(); var buttondata = _moduleButtonService.GetList(); List <RoleAuthorizeBaseEntity> roleAuthorizeEntitys = new List <RoleAuthorizeBaseEntity>(); foreach (var itemId in permissionIds) { RoleAuthorizeBaseEntity roleAuthorizeBaseEntity = new RoleAuthorizeBaseEntity(); roleAuthorizeBaseEntity.F_Id = Common.Common.GuId(); roleAuthorizeBaseEntity.F_ObjectType = 1; roleAuthorizeBaseEntity.F_ObjectId = roleBaseEntity.F_Id; roleAuthorizeBaseEntity.F_ItemId = itemId; if (moduledata.Find(t => t.F_Id == itemId) != null) { roleAuthorizeBaseEntity.F_ItemType = 1; } if (buttondata.Find(t => t.F_Id == itemId) != null) { roleAuthorizeBaseEntity.F_ItemType = 2; } roleAuthorizeEntitys.Add(roleAuthorizeBaseEntity); } service.SubmitForm(roleBaseEntity, roleAuthorizeEntitys, keyValue); }
public void SubmitForm(RoleBaseEntity roleBaseEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { roleBaseEntity.Modify(keyValue); service.Update(roleBaseEntity); } else { roleBaseEntity.Create(); roleBaseEntity.F_Category = 2; service.Insert(roleBaseEntity); } }
public ActionResult SubmitForm(RoleBaseEntity roleBaseEntity, string keyValue) { _dutyService.SubmitForm(roleBaseEntity, keyValue); return(Success("操作成功。")); }
public ActionResult SubmitForm(RoleBaseEntity roleBaseEntity, string permissionIds, string keyValue) { _roleService.SubmitForm(roleBaseEntity, permissionIds.Split(','), keyValue); return(Success("操作成功。")); }