コード例 #1
0
        private void paidEventInvoked(object sender, ExternalDataEventArgs e)
        {
            var workflowEventArgs = e as WorkflowEventArgsWithInitiator;
            if (workflowEventArgs == null)
                return;

            TransitionInitiator = workflowEventArgs.InitiatorId;
            ImpersonatedIdentityId = workflowEventArgs.ImpersonatedIdentityId;
            LastCommand = WorkflowCommand.SetPaid;

            var paidCommandEventArgs = e as PaidCommandEventArgs;
            if (paidCommandEventArgs == null)
                return;

            var externalState = new BillDemandExternalState()
                                    {
                                        DocumentNumber = paidCommandEventArgs.DocumentNumber,
                                        PaymentDate =
                                            paidCommandEventArgs.PaymentDate.HasValue
                                                ? paidCommandEventArgs.PaymentDate.Value
                                                : DateTime.Now
                                    };

            Budget2WorkflowRuntime.BillDemandBuinessService.SetExternalParameters(WorkflowInstanceId, externalState);


        }
コード例 #2
0
 public void SetExternalParameters(Guid billDemandUid, BillDemandExternalState externalState)
 {
     using (var scope = ReadCommittedSupressedScope)
     {
         using (var context = this.CreateContext())
         {
             BillDemand billDemand = GetBillDemand(context, billDemandUid);
             billDemand.DateOfPerformance = externalState.PaymentDate;
             billDemand.AccountNumber = externalState.DocumentNumber;
             context.SubmitChanges();
             context.spRecalcBillDemandCurrencySum(billDemandUid);
         }
         scope.Complete();
     }
 }
コード例 #3
0
 private void CheckExternalStatus_ExecuteCode(object sender, EventArgs e)
 {
     _externalState = Budget2WorkflowRuntime.BillDemandExportService.GetBillDemandExternalStaus(WorkflowInstanceId);
 }