public void zt2() { this.txt_bz.ReadOnly = true; this.btnDetail.Enabled = false; this.blueFphm = this.txt_fphm.Text; this.blueFpdm = this.txt_fpdm.Text; int result = 0; if (int.TryParse(this.blueFphm, out result)) { IFpManager manager = new FpManager(); this.blueFpxx = manager.GetXxfp(this.fplx, this.blueFpdm, result); } if (this.blueFpxx != null) { this.lbl_title.Text = "本张发票可以开红字发票!"; this.txt_bz.Text = HzfpHelper.GetInvMainInfo(this.fplx, this.blueFpxx); this.but_xyb.Enabled = true; this.btnDetail.Enabled = true; } else { this.lbl_title.Text = "本张发票可以开红字发票!"; this.txt_bz.Text = "但在当前发票库没有找到相应信息。"; this.but_xyb.Enabled = true; } this.tabControl1.SelectedIndex = 1; this.SetTipStyle(1); this.but_syb.Visible = true; this.but_xyb.Visible = true; this.but_syb.Text = "上一步"; this.but_xyb.Text = "确 定"; this.but_xyb.Focus(); this.start = 1; }
public void zt3() { this.btnDetail.Enabled = false; this.blueFpdm = this.txt_fpdm.Text.Trim(); this.blueFphm = this.txt_fphm.Text.Trim(); if ((this.blueFpdm.Length == 0) || (this.blueFphm.Length != 0)) { if (!(this.blueFphm != "")) { goto Label_0099; } char[] trimChars = new char[] { '0' }; if (!(this.blueFphm.Trim(trimChars) == "")) { goto Label_0099; } } MessageManager.ShowMsgBox("INP-242149"); this.start = 1; return; Label_0099: if (this.blueFpdm != "") { char[] chArray2 = new char[] { '0' }; if (this.blueFpdm.Trim(chArray2) == "") { MessageManager.ShowMsgBox("INP-242150"); this.start = 1; return; } } if (((this.blueFpdm.Length == 0) && (this.blueFphm.Length != 0)) || ((this.blueFpdm.Length > 0) && (this.blueFpdm.Length != 10))) { MessageManager.ShowMsgBox("INP-242107"); this.start = 1; } else { int result = 0; if ((this.blueFpdm != "") && (this.blueFphm != "")) { Regex regex = new Regex(@"^\d{1,}$"); if ((!new Regex(@"^\d{10,12}$").IsMatch(this.blueFpdm) || !regex.IsMatch(this.blueFphm)) || !int.TryParse(this.blueFphm, out result)) { MessageManager.ShowMsgBox("INP-242190"); this.start = 1; return; } } IFpManager manager = new FpManager(); string[] current = manager.GetCurrent(this.fplx); if (((current != null) && (current.Length == 2)) && ((current[0] == this.blueFpdm) && (int.Parse(current[1]) == result))) { MessageManager.ShowMsgBox("A074"); this.start = 1; } else { this.blueFpxx = manager.GetXxfp(this.fplx, this.blueFpdm, result); if (this.blueFpxx != null) { string str = this.CheckBlueFp(); if (str != "") { this.lbl_title.Text = "本张发票不能开红字发票!"; this.txt_bz.Text = string.Format("(原因:{0})", str); this.but_xyb.Enabled = false; } else { this.lbl_title.Text = "本张发票可以开红字发票!"; this.txt_bz.Text = HzfpHelper.GetInvMainInfo(this.fplx, this.blueFpxx); this.but_xyb.Enabled = true; } this.btnDetail.Enabled = true; } else { this.lbl_title.Text = "本张发票可以开红字发票!"; this.txt_bz.Text = "在当前发票库没有找到相应信息。"; this.but_xyb.Enabled = true; } this.tabControl1.SelectedIndex = 2; this.SetTipStyle(2); this.but_xyb.Focus(); this.but_syb.Visible = true; this.but_xyb.Visible = true; this.but_syb.Text = "上一步"; this.but_xyb.Text = "确 定"; this.start = 2; } } }