public IEnumerable<DocumentMappingModel> GetDocumentMapping(string workflow, string process, string subProcess, string classification) { Node node = this.nodeService.GetNodeByCode(workflow, process, subProcess, classification); var documentMappingList = this.documentMappingService.GetDataByNode(node.Id.ToString()); List<DocumentMappingModel> modelList = new List<DocumentMappingModel>(); foreach (var item in documentMappingList) { DocumentMappingModel model = new DocumentMappingModel(); model.Active = item.Active; model.Code = item.Document.Code; model.Description = item.Document.Description; model.Mandatory = item.Mandatory; model.Name = item.Document.Name; model.NodeId = item.Node.Id; modelList.Add(model); } return modelList; }
public IEnumerable<DocumentMappingModel> GetDocumentMappingByWorkflow(long id) { var workflow = this.workflowService.GetDataById(id); var documentMappingList = this.documentMappingService.GetFilteredDataByWorkflow(workflow); List<DocumentMappingModel> modelList = new List<DocumentMappingModel>(); foreach (var item in documentMappingList) { DocumentMappingModel model = new DocumentMappingModel(); model.Code = item.Document.Code; model.Name = item.Document.Name; model.Description = item.Document.Description; model.Mandatory = item.Mandatory; model.WorkflowCode = item.Workflow.Code; model.WorkflowId = item.Workflow.Id; model.Active = item.Active; modelList.Add(model); } return modelList; }