예제 #1
0
     private void FixupFundFlow2(FundFlow previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (previousValue != null && previousValue.FundFlow1.Contains(this))
         {
             previousValue.FundFlow1.Remove(this);
         }
 
         if (FundFlow2 != null)
         {
             if (!FundFlow2.FundFlow1.Contains(this))
             {
                 FundFlow2.FundFlow1.Add(this);
             }
 
             FundFlowId = FundFlow2.Id;
         }
         else if (!skipKeys)
         {
             FundFlowId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("FundFlow2")
                 && (ChangeTracker.OriginalValues["FundFlow2"] == FundFlow2))
             {
                 ChangeTracker.OriginalValues.Remove("FundFlow2");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("FundFlow2", previousValue);
             }
             if (FundFlow2 != null && !FundFlow2.ChangeTracker.ChangeTrackingEnabled)
             {
                 FundFlow2.StartTracking();
             }
         }
     }
예제 #2
0
        protected override void Create()
        {
            var fundFlow = new FundFlow
                               {
                                   RorP = (int) ROrP,
                                   BankAccountId =
                                       SelectedBankAccountId == null ? 0 : Int32.Parse(SelectedBankAccountId.ToString()),
                                   FinancialAccountId =
                                       SelectedFinancialAccountId == null
                                           ? 0
                                           : Int32.Parse(SelectedFinancialAccountId.ToString()),
                                   Rate = Rate == null ? 0 : decimal.Parse(Rate.ToString()),
                                   CurrencyId =
                                       SelectedPaymentCurrencyId == null
                                           ? 0
                                           : Int32.Parse(SelectedPaymentCurrencyId.ToString()),
                                   QuotaId = SelectedQuotaId,
                                   InternalBPId = ICId == null ? 0 : Int32.Parse(ICId.ToString()),
                                   BPId = SelectedBPartnerId == null ? 0 : Int32.Parse(SelectedBPartnerId.ToString()),
                                   TradeDate = TradeDate,
                                   Amount = Amount,
                                   Description = Description,
                                   PaymentRequestId = PaymentRequestId,
                                   PaymentMeanId = PaymentMeanId == 0 ? null : PaymentMeanId
                               };
            //fundFlow.Quota.IsFundflowFinished = IsFundflowFinished;

            using (var fundFlowService = SvcClientManager.GetSvcClient<FundFlowServiceClient>(SvcType.FundFlowSvc))
            {
                fundFlowService.AddNewFundFlow(IsFundflowFinished, fundFlow, CurrentUser.Id);
            }
        }