コード例 #1
0
 private void UpdateInvoiceInfo(List <EIMSInvoiceInfoEntityVM> editData)
 {
     if (editData.Count > 0)
     {
         facade.UpdateEIMSInvoiceInput(editData, (obj, args) =>
         {
             if (args.FaultsHandle())
             {
                 return;
             }
             if (args.Result.IsSucceed)
             {
                 this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_EditSuccess);
                 InvoiceInfoEntityViewList.Clear();
                 this.Dialog.ResultArgs.isForce = true;
                 this.Dialog.Close(true);
             }
             else
             {
                 this.CurrentWindow.Alert(args.Result.Error);
                 InvoiceInfoEntityViewList.Clear();
             }
         });
     }
 }
コード例 #2
0
 /// <summary>
 /// 防止两个异步方法同时执行,将录入发票代码提取出来
 /// </summary>
 private void CreateInvoiceInput(List <EIMSInvoiceInfoEntityVM> invoiceInfoEntityList, List <EIMSInvoiceInfoEntityVM> editData)
 {
     facade.CreateEIMSInvoiceInput(invoiceInfoEntityList, (obj, args) =>
     {
         if (args.FaultsHandle())
         {
             return;
         }
         EIMSInvoiceResultVM result = args.Result.Convert <EIMSInvoiceResult, EIMSInvoiceResultVM>();
         if (result.IsSucceed)
         {
             if (Type == "Input")
             {
                 this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_InputSuccess);
                 InvoiceInfoEntityViewList.Clear();
                 this.Dialog.ResultArgs.isForce = true;
                 this.Dialog.Close();
             }
             else if (Type == "Edit")
             {
                 if (editData != null)
                 {
                     UpdateInvoiceInfo(editData);
                 }
             }
         }
         else
         {
             this.CurrentWindow.Alert(result.Error);
             InvoiceInfoEntityViewList.Clear();
             return;
         }
     });
 }
コード例 #3
0
 /// <summary>
 /// 预览按钮事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPreview_Click(object sender, RoutedEventArgs e)
 {
     if (CehckEIMSInvoiceInputList())
     {
         BuildInvoiceInfoViewList();
         UCViewInvoice uc = new UCViewInvoice(InvoiceInfoEntityViewList, InvoicInputView, "Preview");
         uc.Dialog = CurrentWindow.ShowDialog("发票信息预览", uc, (obj, args) =>
         {
             InvoiceInfoEntityViewList.Clear();
         }, new Size(700, 350));
     }
 }
コード例 #4
0
 /// <summary>
 /// 确认按钮事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtInvoiceAmt.Text) ||
         string.IsNullOrEmpty(this.txtInvoiceInputSysNo.Text) ||
         this.dpInvoiceInputDate.SelectedDate == null)
     {
         this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_InfoNotNull);
     }
     else
     {
         if (this.txtInvoiceInputSysNo.Text.Length != 8)
         {
             this.CurrentWindow.Alert(string.Format(ResEIMSInvoiceEntry.Msg_InvoiceInputCheck, this.txtInvoiceInputSysNo.Text));
         }
         else
         {
             decimal invoiceAmt = 0m;
             if (Regex.IsMatch(this.txtInvoiceAmt.Text, @"(^\d+$)|(^\d+.\d+$)"))
             {
                 invoiceAmt = Convert.ToDecimal(this.txtInvoiceAmt.Text);
             }
             if (invoiceAmt != Convert.ToDecimal(this.txtBillAmt.Text))
             {
                 this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_InvoiceInputAmountNoEquels);
             }
             else
             {
                 BatchInvoiceInuputInfo();
                 facade.CreateEIMSInvoiceInput(InvoiceInfoEntityViewList, (obj, args) =>
                 {
                     if (args.FaultsHandle())
                     {
                         return;
                     }
                     if (args.Result.IsSucceed)
                     {
                         this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_InputSuccess);
                         InvoiceInfoEntityViewList.Clear();
                         this.Dialog.ResultArgs.isForce = true;
                         this.Dialog.Close();
                     }
                     else
                     {
                         this.CurrentWindow.Alert(ResEIMSInvoiceEntry.Msg_InputFailed);
                     }
                 });
             }
         }
     }
 }