public object GetEditApplicationPage(Guid ApplicationPageID) { //base.SetMenuIndex(AdminMenuIndex.ApplicationPageEdit); using (DynamicFormService dynamicFormService = new DynamicFormService()) { DynamicFormDTO dynamicFormDTO = new DynamicFormDTO(dynamicFormService.GetInfoByPageID(ApplicationPageID)); using (LURowService luRowService = new LURowService()) { dynamicFormDTO.ApplicationPageDTO.ListGroupLU = luRowService.GetList(sysBpmsLUTable.e_LUTable.ApplicationPageGroupLU.ToString()).Select(c => new LURowDTO(c)).ToList(); } using (ApplicationPageAccessService applicationPageAccessService = new ApplicationPageAccessService()) using (LURowService luRowService = new LURowService()) using (UserService userService = new UserService()) using (DepartmentService departmentService = new DepartmentService()) return(Json(new { ListApplicationPageAccess = applicationPageAccessService.GetList(dynamicFormDTO.ApplicationPageID, null).Select(c => new ApplicationPageAccessDTO(c)).ToList(), ListDepartments = departmentService.GetList(true, "", null).Select(c => new DepartmentDTO(c)).ToList(), ListRoles = luRowService.GetList(sysBpmsLUTable.e_LUTable.DepartmentRoleLU.ToString()).Select(c => new LURowDTO(c)).ToList(), ListUsers = userService.GetList("", null).Select(c => new UserDTO(c)).ToList(), Model = dynamicFormDTO })); } }
public object PostEditApplicationPage(PostEditApplicationPageDTO model) { using (DynamicFormService dynamicFormService = new DynamicFormService()) { sysBpmsDynamicForm dynamicForm = dynamicFormService.GetInfo(model.DynamicFormDTO.ID); dynamicForm.Update(null, model.DynamicFormDTO.ApplicationPageID, model.DynamicFormDTO.Name, model.DynamicFormDTO.Version, model.DynamicFormDTO.ShowInOverview); DynamicFormConfigXmlModel configXmlModel = dynamicForm.ConfigXmlModel; configXmlModel.IsEncrypted = model.DynamicFormDTO.IsEncrypted; dynamicForm.Update(configXmlModel); dynamicFormService.Update(dynamicForm, base.userName); using (ApplicationPageService applicationPageService = new ApplicationPageService()) { sysBpmsApplicationPage applicationPage = applicationPageService.GetInfo(model.DynamicFormDTO.ApplicationPageID.Value); applicationPage.Update(model.DynamicFormDTO.ApplicationPageDTO.GroupLU, model.DynamicFormDTO.ApplicationPageDTO.Description, model.DynamicFormDTO.ApplicationPageDTO.ShowInMenu); applicationPageService.Update(applicationPage); using (ApplicationPageAccessService applicationPageAccessService = new ApplicationPageAccessService()) { List <sysBpmsApplicationPageAccess> newApplicationPageAccess = (model.listRole ?? new List <ApplicationPageAccessDTO>()).Select(c => new sysBpmsApplicationPageAccess().Update(c.ID, model.DynamicFormDTO.ApplicationPageID.Value, c.DepartmentID, c.RoleLU, c.UserID, c.AllowAdd, c.AllowEdit, c.AllowDelete, c.AllowView)).ToList() .Union((model.listUser ?? new List <ApplicationPageAccessDTO>()).Select(c => new sysBpmsApplicationPageAccess().Update(c.ID, model.DynamicFormDTO.ApplicationPageID.Value, c.DepartmentID, c.RoleLU, c.UserID, c.AllowAdd, c.AllowEdit, c.AllowDelete, c.AllowView))).ToList(); applicationPageAccessService.AddEdit(applicationPage.ID, newApplicationPageAccess); } } } return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success)); }