private void btnGenerate_Click(object sender, EventArgs e) { try { UpLoadCheckState.SetWenBenState(true); GenerateFPResult result = new GenerateFPResult(this.generBL.GenerateInvlist(this.listGeneratePreview)); UpLoadCheckState.SetWenBenState(false); if (result.ShowDialog() == DialogResult.OK) { base.DialogResult = DialogResult.OK; } } catch (Exception exception) { if (exception.ToString().Contains("超时")) { this.log.Error(exception.ToString()); } else { HandleException.HandleError(exception); } } finally { UpLoadCheckState.SetWenBenState(false); } }
private void backgroundWorker_2_DoWork(object sender, DoWorkEventArgs e) { try { if (base.TaxCardInstance.QYLX.ISTDQY) { this.bool_1 = true; } else { this.bool_1 = false; bool shouGongXiaZai = false; DateTime now = DateTime.Now; while (!this.backgroundWorker_2.CancellationPending) { if ((now.AddSeconds((double)this.int_2) > DateTime.Now) && !UpLoadCheckState.ShouGongXiaZai) { Thread.Sleep(0x3e8); } else { if (UpLoadCheckState.CheckState()) { Thread.Sleep(0x3e8); continue; } now = DateTime.Now; shouGongXiaZai = UpLoadCheckState.ShouGongXiaZai; this.class105_0.method_0(); if (shouGongXiaZai) { UpLoadCheckState.ShouGongXiaZai = false; shouGongXiaZai = false; } } } e.Cancel = true; this.bool_1 = true; BackWorkCancleStyle style = new BackWorkCancleStyle { CanclType = CancleStyle.Cancle }; e.Result = style; Class101.smethod_0("<下载线程>下载线程退出,准备软件退出!"); } } catch (Exception exception) { e.Cancel = true; BackWorkCancleStyle style2 = new BackWorkCancleStyle { CanclType = CancleStyle.Exception }; this.bool_1 = false; e.Result = style2; Class101.smethod_1("(下载线程异常:)" + exception.ToString()); } }
private void backgroundWorker_1_DoWork_1(object sender, DoWorkEventArgs e) { try { if (base.TaxCardInstance.QYLX.ISTDQY) { this.bool_0 = true; } else { this.bool_0 = false; this.class85_0.class90_0.method_0(); while (!this.backgroundWorker_1.CancellationPending) { if (UpLoadCheckState.CheckState()) { Thread.Sleep(0x3e8); } else { this.serverUP_0.UPDownLoadFP(); Thread.Sleep(0x3e8); } } e.Cancel = true; this.bool_0 = true; BackWorkCancleStyle style = new BackWorkCancleStyle { CanclType = CancleStyle.Cancle }; e.Result = style; Class101.smethod_0("(上传线程backWorkUploadForServerUp_DoWork)线程终止,软件准备退出!"); } } catch (Exception exception) { e.Cancel = true; BackWorkCancleStyle style2 = new BackWorkCancleStyle { CanclType = CancleStyle.Exception }; this.bool_0 = true; e.Result = style2; Class101.smethod_1("(上传线程backWorkUploadForServerUp_DoWork异常:)" + exception.ToString()); } }
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); } }
private void backgroundWorker_1_DoWork(object sender, DoWorkEventArgs e) { try { if (base.TaxCardInstance.QYLX.ISTDQY) { this.bool_0 = true; } else { this.bool_0 = false; bool flag2 = true; DateTime now = DateTime.Now; bool flag = true; bool shouGongShangChuan = false; this.class85_0.class90_0.method_0(); while (!this.backgroundWorker_1.CancellationPending) { if (UpLoadCheckState.CheckState()) { Thread.Sleep(0x3e8); } else { if ((!bContinuUpload && !flag2) && (!this.class85_0.method_4(now) && !UpLoadCheckState.ShouGongShangChuan)) { Thread.Sleep(0x3e8); continue; } if ((!bContinuUpload && !flag) && ((now.AddMinutes((double)(Class87.int_6 / 3)) > DateTime.Now) && !UpLoadCheckState.ShouGongShangChuan)) { Thread.Sleep(0x3e8); continue; } shouGongShangChuan = UpLoadCheckState.ShouGongShangChuan; this.class85_0.method_1(false, flag2); if (shouGongShangChuan) { UpLoadCheckState.ShouGongShangChuan = false; shouGongShangChuan = false; } flag = this.class85_0.method_6(); now = DateTime.Now; flag2 = false; if (bContinuUpload) { bContinuUpload = false; } } } e.Cancel = true; this.bool_0 = true; BackWorkCancleStyle style = new BackWorkCancleStyle { CanclType = CancleStyle.Cancle }; e.Result = style; Class101.smethod_0("(上传线程)线程终止,软件准备退出!"); } } catch (Exception exception) { e.Cancel = true; BackWorkCancleStyle style2 = new BackWorkCancleStyle { CanclType = CancleStyle.Exception }; this.bool_0 = true; e.Result = style2; Class101.smethod_1("(上传线程异常:)" + exception.ToString()); } }