public Response <string> SetProjectWorkflow([FromBody] QueryProjectWorkflow projectWorkflows) { var result = new Response <string>(); try { ProjectManagerApp.SetProjectWorkflow(projectWorkflows); } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return(result); }
public void SetProjectWorkflow(QueryProjectWorkflow projectWorkFlows) { UnitWork.Delete <ProjectWorkflow>(d => projectWorkFlows.ProjectWorkflows.Any(pw => pw.ProjectId.Contains(d.ProjectId))); foreach (var pw in projectWorkFlows.ProjectWorkflows) { if (!string.IsNullOrEmpty(pw.WorkflowId)) { UnitWork.Add(new ProjectWorkflow() { ProjectId = pw.ProjectId, WorkflowId = pw.WorkflowId }); } } UnitWork.Save(); }