public object PostAddEdit(ProcessGroupDTO processGroupDTO) { using (ProcessGroupService ProcessGroupService = new ProcessGroupService()) { sysBpmsProcessGroup ProcessGroup = processGroupDTO.ID != Guid.Empty ? ProcessGroupService.GetInfo(processGroupDTO.ID) : new sysBpmsProcessGroup(); ResultOperation resultOperation = ProcessGroup.Update(processGroupDTO.ProcessGroupID, processGroupDTO.Name, processGroupDTO.Description); if (!resultOperation.IsSuccess) { return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error)); } if (processGroupDTO.ID != Guid.Empty) { resultOperation = ProcessGroupService.Update(ProcessGroup); } else { resultOperation = ProcessGroupService.Add(ProcessGroup); } if (resultOperation.IsSuccess) { return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success)); } else { return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error)); } } }
public void Delete(Guid processGroupId) { sysBpmsProcessGroup ProcessGroup = this.Context.sysBpmsProcessGroups.FirstOrDefault(d => d.ID == processGroupId); if (ProcessGroup != null) { this.Context.sysBpmsProcessGroups.Remove(ProcessGroup); } }
public ProcessGroupDTO(sysBpmsProcessGroup processGroup) { if (processGroup != null) { this.ID = processGroup.ID; this.ProcessGroupID = processGroup.ProcessGroupID; this.Name = processGroup.Name; this.Description = processGroup.Description; } }
private void FillTree(sysBpmsProcessGroup ProcessGroup, List <TreeViewModel> Items, List <sysBpmsProcessGroup> ProcessGroups, Guid?SelectedID) { Items.Add(new TreeViewModel() { id = ProcessGroup.ID.ToString(), text = ProcessGroup.Name, icon = ProcessGroups.Any(d => d.ProcessGroupID == ProcessGroup.ID) ? "fa fa-folder text-primary" : "fa fa-file text-primary", state = SelectedID.HasValue && ProcessGroup.ID == SelectedID ? new TreeNodeStateModel() { selected = true } : null }); foreach (sysBpmsProcessGroup item in ProcessGroups.Where(d => d.ProcessGroupID == ProcessGroup.ID)) { this.FillTree(item, Items.LastOrDefault().children, ProcessGroups, SelectedID); } }
public ResultOperation Update(sysBpmsProcessGroup ProcessGroup) { ResultOperation resultOperation = new ResultOperation(); try { this.BeginTransaction(); if (resultOperation.IsSuccess) { this.UnitOfWork.Repository <IProcessGroupRepository>().Update(ProcessGroup); this.UnitOfWork.Save(); } } catch (Exception ex) { return(base.ExceptionHandler(ex)); } base.FinalizeService(resultOperation); return(resultOperation); }
public void Update(sysBpmsProcessGroup processGroup) { this.Context.Entry(processGroup).State = EntityState.Modified; }
public void Add(sysBpmsProcessGroup processGroup) { processGroup.ID = Guid.NewGuid(); this.Context.sysBpmsProcessGroups.Add(processGroup); }