private void FaPiaoZuoFei_WeiKai_FormClosing(object sender, EventArgs e)
 {
     this.xxfpChaXunBll = null;
     this.progressBar   = null;
     this.FpList        = null;
     base.Dispose();
 }
示例#2
0
 private void FPZJDaoChu_FormClosing(object sender, EventArgs e)
 {
     this._AisinoGrid   = null;
     this.xxfpChaXunBll = null;
     this.progressBar   = null;
     this.dict          = null;
     base.Dispose();
 }
 public void ZuoFeiMainFunction(int ZuoFeiNum)
 {
     try
     {
         UpLoadCheckState.SetFpxfState(true);
         int num  = 0;
         int num2 = 0;
         int num3 = 0x1770;
         this.FpList.Clear();
         InvCodeNum invCodeNum = new InvCodeNum();
         if (this.progressBar == null)
         {
             this.progressBar = new FPProgressBar();
         }
         this.progressBar.SetTip("正在作废未开发票", "请等待任务完成", "未开发票作废过程");
         this.progressBar.Visible = true;
         this.progressBar.Refresh();
         this.progressBar.Show();
         this.progressBar.Refresh();
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         for (int i = 0; i < ZuoFeiNum; i++)
         {
             if (this.GetTaxCardCurrentFpNum(ref invCodeNum) != "0000")
             {
                 MessageManager.ShowMsgBox("FPZF-000012");
                 this.progressBar.Visible = false;
                 this.progressBar.Refresh();
                 return;
             }
             string dbfpzl = this.GetInvoiceType(this.FaPiaoType).dbfpzl;
             string str3   = this.lab_fpdm.Text.Trim();
             string str4   = ShareMethods.FPHMTo8Wei(invCodeNum.InvNum);
             string str5   = this.IsEmpty_DengYu(base.TaxCardInstance.Address) + " " + base.TaxCardInstance.Telephone;
             string str6   = this.IsEmpty_DengYu(base.TaxCardInstance.BankAccount);
             string title  = "正在作废发票代码:" + str3 + "发票号码:" + str4;
             this.progressBar.SetTip(title, "请等待任务完成", "未开发票作废过程");
             this.ProcessStartThread(num3 / ZuoFeiNum);
             this.progressBar.Refresh();
             object[] param = new object[] { dbfpzl, str3, str4, DingYiZhiFuChuan1._UserMsg.MC, str5, str6 };
             Fpxx     item  = this.BlankWasteTaxCardZuoFei(param);
             if ((item == null) || !(item.retCode == "0000"))
             {
                 break;
             }
             this.FpList.Add(item);
             num++;
         }
         this.xxfpChaXunBll.SaveXxfp(this.FpList);
         this.progressBar.SetTip("正在将作废发票写入数据库", "请等待任务完成", "未开发票作废过程");
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         this.progressBar.Visible = false;
         num2 = ZuoFeiNum - num;
         MessageManager.ShowMsgBox("FPZF-000010", new string[] { ZuoFeiNum.ToString(), num.ToString(), num2.ToString() });
     }
     catch (Exception exception)
     {
         this.loger.Error("[ZuoFeiMainFunction函数异常]" + exception.ToString());
     }
     finally
     {
         if (this.progressBar != null)
         {
             this.progressBar.Visible = false;
             this.progressBar.Close();
             this.progressBar.Dispose();
             this.progressBar = null;
             GC.Collect();
         }
         UpLoadCheckState.SetFpxfState(false);
     }
 }
示例#4
0
 private void MenuItem_DaoChuSelect_Click(object sender, EventArgs e)
 {
     try
     {
         if (((aisinoGrid == null) || (aisinoGrid.Rows == null)) || (aisinoGrid.Rows.Count == 0))
         {
             MessageManager.ShowMsgBox("FPCX-000039");
         }
         else if ((aisinoGrid.SelectedRows == null) || (aisinoGrid.SelectedRows.Count == 0))
         {
             MessageManager.ShowMsgBox("FPCX-000040");
         }
         else
         {
             FolderBrowserDialog dialog = new FolderBrowserDialog();
             string str = string.Empty;
             if (!string.IsNullOrEmpty(str))
             {
                 if (Directory.Exists(str))
                 {
                     dialog.SelectedPath = str;
                 }
             }
             else
             {
                 dialog.SelectedPath = Application.StartupPath;
             }
             if (dialog.ShowDialog() != DialogResult.OK)
             {
                 dialog.Dispose();
             }
             else
             {
                 dialog.Dispose();
                 this.Refresh();
                 if (this.progressBar == null)
                 {
                     this.progressBar = new FPProgressBar();
                 }
                 this.progressBar.SetTip("正在生成发票记录", "请等待任务完成", "加密发票导出过程");
                 this.progressBar.fpxf_progressBar.Value = 1;
                 this.progressBar.Visible = true;
                 this.progressBar.Show();
                 this.progressBar.Refresh();
                 this.ProcessStartThread(2 * this.step);
                 this.progressBar.Refresh();
                 this.progressBar.SetTip("正在生成导出文件", "请等待任务完成", "加密发票导出过程");
                 this.ProcessStartThread(this.step);
                 this.progressBar.Refresh();
                 string str2 = "增值税发票明细(";
                 if (this.com_fpzl.Text == "普通发票")
                 {
                     str2 = "增值税普通发票明细(";
                 }
                 else if (this.com_fpzl.Text == "专用发票")
                 {
                     str2 = "增值税专用发票明细(";
                 }
                 string       path      = dialog.SelectedPath + @"\" + str2 + this.date_ksrq.Value.ToString("yyyy.MM.dd") + "-" + this.date_jsrq.Value.ToString("yyyy.MM.dd") + ")";
                 XMLOperation operation = new XMLOperation();
                 if (this.check_tongbutxt.Checked)
                 {
                     this.progressBar.SetTip("正在导出同步TXT文件", "请等待任务完成", "加密发票导出过程");
                     this.ProcessStartThread(this.step);
                     this.progressBar.Refresh();
                 }
                 else
                 {
                     this.ProcessStartThread(this.step);
                     this.progressBar.Refresh();
                 }
                 operation.SaveSelectToTxt(aisinoGrid.SelectedRows, path, this.date_ksrq.Value, this.date_jsrq.Value, this.check_tongbutxt.Checked);
                 this.ProcessStartThread(this.step);
                 this.progressBar.Refresh();
                 this.progressBar.Visible = false;
                 this.progressBar.Refresh();
                 MessageManager.ShowMsgBox("FPCX-000038");
             }
         }
     }
     catch (Exception exception)
     {
         this.loger.Error("[MenuItem_DaoChuAll_Click异常]" + exception.Message);
     }
     finally
     {
         if (this.progressBar != null)
         {
             this.progressBar.Visible = false;
             this.progressBar.Close();
             this.progressBar.Dispose();
             this.progressBar = null;
             GC.Collect();
         }
     }
 }