public object PostAddEditDocumentDef(DocumentDefDTO DocumentDefDTO) { using (DocumentDefService documentDefService = new DocumentDefService()) { sysBpmsDocumentDef documentDef = DocumentDefDTO.ID != Guid.Empty ? documentDefService.GetInfo(DocumentDefDTO.ID) : new sysBpmsDocumentDef(); documentDef.Update(DocumentDefDTO.DocumentFolderID, DocumentDefDTO.NameOf, DocumentDefDTO.DisplayName, DocumentDefDTO.MaxSize, DocumentDefDTO.ValidExtentions, DocumentDefDTO.IsMandatory, DocumentDefDTO.Description, DocumentDefDTO.IsSystemic, DocumentDefDTO.IsActive); ResultOperation resultOperation = null; if (documentDef.ID != Guid.Empty) { resultOperation = documentDefService.Update(documentDef); } else { resultOperation = documentDefService.Add(documentDef); } if (resultOperation.IsSuccess) { return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success)); } else { return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error)); } } }
public void Delete(Guid DocumentDefId) { sysBpmsDocumentDef documentDef = this.Context.sysBpmsDocumentDefs.FirstOrDefault(d => d.ID == DocumentDefId); if (documentDef != null) { this.Context.sysBpmsDocumentDefs.Remove(documentDef); } }
public ResultOperation Update(sysBpmsDocumentDef documentDef) { ResultOperation resultOperation = new ResultOperation(); if (resultOperation.IsSuccess) { this.UnitOfWork.Repository <IDocumentDefRepository>().Update(documentDef); this.UnitOfWork.Save(); } return(resultOperation); }
public DocumentDefDTO(sysBpmsDocumentDef documentDef) { if (documentDef != null) { this.ID = documentDef.ID; this.DocumentFolderID = documentDef.DocumentFolderID; this.NameOf = documentDef.NameOf; this.DisplayName = documentDef.DisplayName; this.MaxSize = documentDef.MaxSize; this.ValidExtentions = documentDef.ValidExtentions; this.IsMandatory = documentDef.IsMandatory; this.Description = documentDef.Description; this.IsSystemic = documentDef.IsSystemic; this.IsActive = documentDef.IsActive; } }
public object GetInActiveDocumentDef(Guid id) { using (DocumentDefService documentDefService = new DocumentDefService()) { sysBpmsDocumentDef documentDef = documentDefService.GetInfo(id); documentDef.IsActive = false; ResultOperation resultOperation = documentDefService.Update(documentDef); if (resultOperation.IsSuccess) { return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success)); } else { return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error)); } } }
public void Update(sysBpmsDocumentDef documentDef) { this.Context.Entry(documentDef).State = EntityState.Modified; }
public void Add(sysBpmsDocumentDef documentDef) { documentDef.ID = Guid.NewGuid(); this.Context.sysBpmsDocumentDefs.Add(documentDef); }