public override DB.LeasePaymentTransactionApprovalWorkflow ChangeWorkflowStageAction(int workflowId, int action, string remarks, string userName)
        {
            var orginalWorkflow = leasePaymentTransactionApprovalWorkflowRepository.GetById(w => w.Id == workflowId);
            var editWorkflow    = leasePaymentTransactionApprovalWorkflowRepository.GetById(w => w.Id == workflowId);

            editWorkflow.OwnerName     = userName;
            editWorkflow.ProcessedDate = DateTime.Now;
            editWorkflow.Status        = action;
            editWorkflow.Remarks       = remarks;
            editWorkflow.IsFinished    = true;
            leasePaymentTransactionApprovalWorkflowRepository.Update(orginalWorkflow, editWorkflow);

            var stage = new WorkflowStagesRepository(new PmcsDbContext()).GetById(s => s.StageId == orginalWorkflow.StageId);

            if (stage != null)
            {
                var roleId = stage.RoleId;
                if (roleId != null)
                {
                    var roleUsers = CommonRoutines.GetRoleUsers((int)roleId, usersAccountsRepository);
                    //Notifications.Notification.Email(roleUsers.ToList(), Notifications.Config.NotificationObjectType.LeaseContractWorkflowAction, editWorkflow.AutoMapObject<DB.LeasePaymentTransactionApprovalWorkflow, Model.Contracts.LeasePaymentTransactionApprovalWorkflow>());
                    Notifications.Notification.System(roleUsers.ToList(), Notifications.Config.NotificationObjectType.LeaseContractWorkflowAction, (HttpContext.Current.User as PmcsUserPrincipal).UserId, "/Contracts/LeaseContracts#workflow", editWorkflow.AutoMapObject <DB.LeasePaymentTransactionApprovalWorkflow, Model.Contracts.LeasePaymentTransactionApprovalWorkflow>());
                }
            }
            return(editWorkflow);
        }
Ejemplo n.º 2
0
        public void EditLeasePaymentTransactionApprovalWorkflow(LeasePaymentTransactionApprovalWorkflow leaseWorkflow)
        {
            var original = leasePaymentTransactionApprovalWorkflowRepository.GetById(w => w.Id == leaseWorkflow.Id);

            leasePaymentTransactionApprovalWorkflowRepository
            .Update(original,
                    leaseWorkflow.AutoMapObject <LeasePaymentTransactionApprovalWorkflow, DB.LeasePaymentTransactionApprovalWorkflow>());
        }