Пример #1
0
        private void SavePaymentAgencyFee(List <PaymentAgencyFee> fees)
        {
            var saveTask = ServiceProxyFactory.LifeTime(async factory =>
            {
                var service = factory.Create <PaymentAgencyFeeMasterClient>();
                PaymentAgencyFeesResult result = await service.SaveAsync(SessionKey, CustomerId, CurrencyId, fees.ToArray());
                if (result.ProcessResult.Result)
                {
                    if (result.PaymentAgencyFees != null)
                    {
                        DispStatusMessage(MsgInfSaveSuccess);

                        string currencyCode = UseForeignCurrency ? txtCurrencyCode.Text : DefaultCurrencyCode;
                        ProgressDialog.Start(ParentForm, LoadCurrencyCode(currencyCode), false, SessionKey);

                        Modified         = false;
                        PaymentChangeFee = true;
                    }
                    else
                    {
                        ShowWarningDialog(MsgErrSaveError);
                    }
                }
            });

            ProgressDialog.Start(ParentForm, saveTask, false, SessionKey);
        }
Пример #2
0
 /// <summary> CurrencyIdで取得したデータを設定</summary>
 private async Task SetDataWithCurrencyId()
 {
     if (PaymentAgencyFlag)
     {
         await ServiceProxyFactory.LifeTime(async factory =>
         {
             var service = factory.Create <PaymentAgencyFeeMasterClient>();
             PaymentAgencyFeesResult result = await service.GetAsync(SessionKey, CustomerId, CurrencyId);
             {
                 if (result.ProcessResult.Result)
                 {
                     AgencyCheckList = result.PaymentAgencyFees.ToList();
                     List <PaymentAgencyFee> paymentFeeList = new List <PaymentAgencyFee>(result.PaymentAgencyFees);
                     if (paymentFeeList.Count > 0)
                     {
                         paymentFeeList.ForEach(f => f.NewFee = f.Fee);
                         Invoke(new System.Action(() =>
                         {
                             paymentFeeList.Add(new PaymentAgencyFee {
                             });
                             grid.DataSource            = new BindingSource(paymentFeeList, null);
                             grid.CurrentCellBorderLine = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentRowBorderLine  = new Line(LineStyle.None, Color.Empty);
                         }));
                     }
                     else
                     {
                         grid.Rows.Clear();
                         Invoke(new System.Action(() =>
                         {
                             paymentFeeList.Add(new PaymentAgencyFee {
                             });
                             grid.DataSource            = new BindingSource(paymentFeeList, null);
                             grid.CurrentCellBorderLine = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentRowBorderLine  = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentCell.Selected  = false;
                         }));
                     }
                     Modified = false;
                 }
             }
         });
     }
     else
     {
         await ServiceProxyFactory.LifeTime(async factory =>
         {
             var service = factory.Create <CustomerFeeMasterClient>();
             CustomerFeeResult result = await service.GetAsync(SessionKey, CustomerId, CurrencyId);
             {
                 if (result.ProcessResult.Result)
                 {
                     CustomerCheckList = result.CustomerFee.ToList();
                     List <CustomerFee> customerFees = new List <CustomerFee>(result.CustomerFee);
                     if (customerFees.Count > 0)
                     {
                         customerFees.ForEach(f => f.NewFee = f.Fee);
                         Invoke(new System.Action(() =>
                         {
                             customerFees.Add(new CustomerFee {
                             });
                             grid.DataSource            = new BindingSource(customerFees, null);
                             grid.CurrentCellBorderLine = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentRowBorderLine  = new Line(LineStyle.None, Color.Empty);
                         }));
                     }
                     else
                     {
                         grid.Rows.Clear();
                         Invoke(new System.Action(() =>
                         {
                             customerFees.Add(new CustomerFee {
                             });
                             grid.DataSource            = new BindingSource(customerFees, null);
                             grid.CurrentCellBorderLine = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentRowBorderLine  = new Line(LineStyle.None, Color.Empty);
                             grid.CurrentCell.Selected  = false;
                         }));
                     }
                     Modified = false;
                 }
             }
         });
     }
 }