public IHttpActionResult GetConsInvtChecking(string projectId, string entityId = "") { var checking = new ReimageConsInvtChecking(); if (!string.IsNullOrEmpty(projectId)) { checking = checking.GetConsInvtChecking(projectId, entityId); } return(Ok(checking)); }
public IHttpActionResult SaveConsInvtChecking(ReimageConsInvtChecking checkinfo) { try { checkinfo.Save(); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult RecallConsInvtChecking(ReimageConsInvtChecking checkinfo) { try { checkinfo.Recall(checkinfo.Comments); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult EditConsInvtChecking(ReimageConsInvtChecking checkinfo) { try { var taskUrl = checkinfo.Edit(); return(Ok(new ProjectEditResult { TaskUrl = taskUrl })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult ApproveConsInvtChecking(ReimageConsInvtChecking entity) { entity.ApproveConsInvtChecking(ClientCookie.UserCode); var app = ApproveDialogUser.GetApproveDialogUser(entity.Id.ToString()); if (app != null && app.FinanceControllerCode == ClientCookie.UserCode) { try { SendEmail(entity.ProjectId, entity.SerialNumber, entity.ProcInstID, app.VPGMCode); } catch (Exception e) { } } return(Ok(entity)); }
protected static BaseWFEntity GetEmptyWorkflowEntity(string flowCode) { BaseWFEntity wfEntity = null; switch (flowCode) { case FlowCode.MajorLease: wfEntity = new MajorLeaseInfo(); wfEntity.IsMainProject = true; break; case FlowCode.MajorLease_LegalReview: wfEntity = new MajorLeaseLegalReview(); break; case FlowCode.MajorLease_FinanceAnalysis: wfEntity = new MajorLeaseFinancAnalysis(); break; case FlowCode.MajorLease_ConsInfo: wfEntity = new MajorLeaseConsInfo(); break; case FlowCode.MajorLease_Package: wfEntity = new MajorLeaseChangePackage(); break; case FlowCode.MajorLease_ConsInvtChecking: wfEntity = new MajorLeaseConsInvtChecking(); break; case FlowCode.MajorLease_GBMemo: wfEntity = new MajorLeaseGBMemo(); break; case FlowCode.Closure: wfEntity = new ClosureInfo(); wfEntity.IsMainProject = true; break; case FlowCode.Closure_ClosurePackage: wfEntity = new ClosurePackage(); break; case FlowCode.Closure_ClosureTool: wfEntity = new ClosureTool(); break; case FlowCode.Closure_ConsInvtChecking: wfEntity = new ClosureConsInvtChecking(); break; case FlowCode.Closure_LegalReview: wfEntity = new ClosureLegalReview(); break; case FlowCode.Closure_WOCheckList: wfEntity = new ClosureWOCheckList(); break; case FlowCode.Closure_ExecutiveSummary: wfEntity = new ClosureExecutiveSummary(); break; case FlowCode.TempClosure: wfEntity = new TempClosureInfo(); wfEntity.IsMainProject = true; break; case FlowCode.TempClosure_LegalReview: wfEntity = new TempClosureLegalReview(); break; case FlowCode.TempClosure_ClosurePackage: wfEntity = new TempClosurePackage(); break; case FlowCode.Rebuild: wfEntity = new RebuildInfo(); wfEntity.IsMainProject = true; break; case FlowCode.Rebuild_LegalReview: wfEntity = new RebuildLegalReview(); break; case FlowCode.Rebuild_FinanceAnalysis: wfEntity = new RebuildFinancAnalysis(); break; case FlowCode.Rebuild_ConsInfo: wfEntity = new RebuildConsInfo(); break; case FlowCode.Rebuild_Package: wfEntity = new RebuildPackage(); break; case FlowCode.Rebuild_ConsInvtChecking: wfEntity = new RebuildConsInvtChecking(); break; case FlowCode.Rebuild_GBMemo: wfEntity = new GBMemo(); break; case FlowCode.Renewal: wfEntity = new RenewalInfo(); wfEntity.IsMainProject = true; break; case FlowCode.Renewal_Letter: wfEntity = new RenewalLetter(); break; case FlowCode.Renewal_LLNegotiation: wfEntity = new RenewalLLNegotiation(); break; case FlowCode.Renewal_ConsInfo: wfEntity = new RenewalConsInfo(); break; case FlowCode.Renewal_Tool: wfEntity = new RenewalTool(); break; case FlowCode.Renewal_Analysis: wfEntity = new RenewalAnalysis(); break; case FlowCode.Renewal_ClearanceReport: wfEntity = new RenewalClearanceReport(); break; case FlowCode.Renewal_ConfirmLetter: wfEntity = new RenewalConfirmLetter(); break; case FlowCode.Renewal_LegalApproval: wfEntity = new RenewalLegalApproval(); break; case FlowCode.Renewal_Package: wfEntity = new RenewalPackage(); break; case FlowCode.Renewal_GBMemo: wfEntity = new RenewalGBMemo(); break; case FlowCode.Reimage: wfEntity = new ReimageInfo(); wfEntity.IsMainProject = true; break; case FlowCode.Reimage_ConsInfo: wfEntity = new ReimageConsInfo(); break; case FlowCode.Reimage_Summary: wfEntity = new ReimageSummary(); break; case FlowCode.Reimage_Package: wfEntity = new ReimagePackage(); break; case FlowCode.Reimage_ConsInvtChecking: wfEntity = new ReimageConsInvtChecking(); break; case FlowCode.Reimage_GBMemo: wfEntity = new ReimageGBMemo(); break; } return(wfEntity); }
public IHttpActionResult ReturnConsInvtChecking(ReimageConsInvtChecking entity) { entity.ReturnConsInvtChecking(ClientCookie.UserCode); return(Ok(entity)); }
public Guid?GetRefId(string projectId, string flowTable) { Guid?refId = null; switch (flowTable) { case "MajorLeaseConsInfo": var majorConsInfo = MajorLeaseConsInfo.FirstOrDefault(e => e.ProjectId == projectId && !e.IsHistory); if (majorConsInfo != null && majorConsInfo.Id != Guid.Empty) { refId = majorConsInfo.Id; } else { refId = Guid.NewGuid(); majorConsInfo = new MajorLeaseConsInfo { Id = refId.Value, ProjectId = projectId, CreateTime = DateTime.Now, IsHistory = false }; MajorLeaseConsInfo.Add(majorConsInfo); } break; case "MajorLeaseConsInvtChecking": var checkInfo = MajorLeaseConsInvtChecking.Search(e => e.ProjectId == projectId && !e.IsHistory).FirstOrDefault(); if (checkInfo != null && checkInfo.Id != Guid.Empty) { refId = checkInfo.Id; } else { refId = Guid.NewGuid(); checkInfo = new MajorLeaseConsInvtChecking { Id = refId.Value, ProjectId = projectId, CreateTime = DateTime.Now, IsHistory = false }; MajorLeaseConsInvtChecking.Add(checkInfo); } break; case "ReimageConsInfo": var reimageConsInfo = ReimageConsInfo.FirstOrDefault(e => e.ProjectId == projectId && !e.IsHistory); if (reimageConsInfo != null && reimageConsInfo.Id != Guid.Empty) { refId = reimageConsInfo.Id; } else { refId = Guid.NewGuid(); reimageConsInfo = new ReimageConsInfo { Id = refId.Value, ProjectId = projectId, IsHistory = false, CreateTime = DateTime.Now, CreateUserAccount = ClientCookie.UserCode }; ReimageConsInfo.Add(reimageConsInfo); } break; case "ReimageConsInvtChecking": var reimageCheckInfo = ReimageConsInvtChecking.Search(e => e.ProjectId == projectId && !e.IsHistory).FirstOrDefault(); if (reimageCheckInfo != null && reimageCheckInfo.Id != Guid.Empty) { refId = reimageCheckInfo.Id; } else { refId = Guid.NewGuid(); reimageCheckInfo = new ReimageConsInvtChecking { Id = refId.Value, ProjectId = projectId, CreateTime = DateTime.Now, IsHistory = false }; ReimageConsInvtChecking.Add(reimageCheckInfo); } break; case "RebuildConsInfo": var rbdConsInfo = RebuildConsInfo.FirstOrDefault(e => e.ProjectId == projectId && !e.IsHistory); if (rbdConsInfo != null && rbdConsInfo.Id != Guid.Empty) { refId = rbdConsInfo.Id; } else { refId = Guid.NewGuid(); rbdConsInfo = new RebuildConsInfo { Id = refId.Value, ProjectId = projectId, IsHistory = false, CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now, CreateUserAccount = ClientCookie.UserCode, CreateUserNameENUS = ClientCookie.UserNameENUS, CreateUserNameZHCN = ClientCookie.UserNameZHCN }; RebuildConsInfo.Add(rbdConsInfo); } break; case "RebuildConsInvtChecking": var rbdCheckInfo = RebuildConsInvtChecking.Search(e => e.ProjectId == projectId && !e.IsHistory).FirstOrDefault(); if (rbdCheckInfo != null && rbdCheckInfo.Id != Guid.Empty) { refId = rbdCheckInfo.Id; } else { refId = Guid.NewGuid(); rbdCheckInfo = new RebuildConsInvtChecking { Id = refId.Value, ProjectId = projectId, IsHistory = false, CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now, CreateUserAccount = ClientCookie.UserCode, CreateUserNameENUS = ClientCookie.UserNameENUS, CreateUserNameZHCN = ClientCookie.UserNameZHCN }; RebuildConsInvtChecking.Add(rbdCheckInfo); } ProjectInfo.FinishNode(projectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Downlod); ProjectInfo.FinishNode(projectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Input); ProjectInfo.FinishNode(projectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Upload); break; case "ClosureWOCheckList": var closureWOCheckList = ClosureWOCheckList.Get(projectId); if (closureWOCheckList != null && closureWOCheckList.Id != Guid.Empty) { refId = closureWOCheckList.Id; _woCheckList = closureWOCheckList; } else { refId = Guid.NewGuid(); closureWOCheckList = new ClosureWOCheckList { Id = refId.Value, ProjectId = projectId, CreateTime = DateTime.Now, CreateUserAccount = ClientCookie.UserCode, CreateUserName = ClientCookie.UserNameENUS, IsHistory = false }; ClosureWOCheckList.Add(closureWOCheckList); } break; } return(refId); }