public void EditLeasePaymentTransactionApprovalWorkflow(LeasePaymentTransactionApprovalWorkflow leaseWorkflow) { var original = leasePaymentTransactionApprovalWorkflowRepository.GetById(w => w.Id == leaseWorkflow.Id); leasePaymentTransactionApprovalWorkflowRepository .Update(original, leaseWorkflow.AutoMapObject <LeasePaymentTransactionApprovalWorkflow, DB.LeasePaymentTransactionApprovalWorkflow>()); }
public IHttpActionResult DoPaymentWorkflowAction(LeasePaymentTransactionApprovalWorkflow workflow) { if (workflow == null) { return(BadRequest("workflow object must be passed in the request body")); } try { var wfProcessor = new LeasePaymentWorkflowProcessor(); var dbWorkflow = wfProcessor.ChangeWorkflowStageAction(workflow.Id, (int)workflow.Status, workflow.Remarks, User.FullName); var currentStageOrderNumber = workflowService. GetWorkflowStage(dbWorkflow.StageId). StageOrderNumber; var nextStageSerialNumber = currentStageOrderNumber + 1; var nextStage = workflowService.GetWorkflowStages().SingleOrDefault(w => w.StageOrderNumber == nextStageSerialNumber); if (nextStage != null) { var nextPaymentWorkflow = new LeasePaymentTransactionApprovalWorkflow() { CreatedBy = User.UserId, CreatedDate = DateTime.Now, Duration = "", IsActive = true, LeaseId = dbWorkflow.LeaseId, ReceivedDate = DateTime.Now, StageId = nextStage.StageId, Status = (int)WorkflowLevelStatus.Forwarded, TransactionId = dbWorkflow.TransactionId, ReferenceNumber = "", SequentialId = nextStageSerialNumber.ToString() }; wfProcessor.ForwardNextStage(nextPaymentWorkflow, nextStage); } var workflows = leaseContractsService.GetUserLeasePaymentWorkflow(User.UserId).Where(l => l.TransactionId == dbWorkflow.TransactionId); var html = Helpers.RenderPartial("~/Views/Shared/Partial/Leases/LeasePaymentWorkflowList.cshtml", workflows); return(Ok(html)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void CreateLeasePaymentTransactionApprovalWorkflow(LeasePaymentTransactionApprovalWorkflow leaseWorkflow) { throw new NotImplementedException(); }