public AllocateInput(List <object> oSelectedItems) { this.Initialize(); foreach (object obj2 in oSelectedItems) { this.SelectedItems.Add(obj2.ToString()); } this.tbxAmountAlloc.set_RegexText("^[0-9]*$"); this.tbxAmountAlloc.MaxLength = 8; this.tbxMachineAlloc.set_RegexText("^[0-9]*$"); this.tbxMachineAlloc.MaxLength = 3; this.lblInvTypeInfo.Text = this.SelectedItems[0].ToString().Trim(); string str = Convert.ToString(ShareMethods.StringToInt(this.SelectedItems[3].ToString().Trim())); if (str.Length < 8) { str = str.PadLeft(8, '0'); } this.lblStartNumInfo.Text = str; string str2 = Convert.ToString((int)((ShareMethods.StringToInt(this.SelectedItems[3].ToString().Trim()) + ShareMethods.StringToInt(this.SelectedItems[4].ToString().Trim())) - 1)); if (str2.Length < 8) { str2 = str2.PadLeft(8, '0'); } this.lblEndNumInfo.Text = str2; this.lblStartNumAlloc.Text = str; this.tbxAmountAlloc.Text = Convert.ToString(ShareMethods.StringToInt(this.SelectedItems[4].ToString())); this.tbxMachineAlloc.Text = string.Empty; }
private bool IsRightData() { try { int num = ShareMethods.StringToInt(this.lblQshm.Text.Trim()); int num2 = ShareMethods.StringToInt(this.lblZjhm.Text.Trim()); int num3 = ShareMethods.StringToInt(this.tbxCount.Text.Trim()); int num4 = (num2 - num) + 1; if (num3 <= 0) { this.tbxCount.Focus(); MessageManager.ShowMsgBox("INP-441222"); return(false); } if (num3 > num4) { this.tbxCount.Focus(); MessageManager.ShowMsgBox("INP-441223"); return(false); } } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); return(false); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); return(false); } return(true); }
private bool IsRightData() { try { if (this.tbxAmountAlloc.Text.Equals(string.Empty)) { this.tbxAmountAlloc.Focus(); MessageManager.ShowMsgBox("INP-441206", new string[] { "分配张数" }); return(false); } if (this.tbxMachineAlloc.Text.Equals(string.Empty)) { this.tbxMachineAlloc.Focus(); MessageManager.ShowMsgBox("INP-441206", new string[] { "分开票机号" }); return(false); } int num = ShareMethods.StringToInt(this.lblStartNumInfo.Text.Trim()); int num2 = ShareMethods.StringToInt(this.lblEndNumInfo.Text.Trim()); int num3 = ShareMethods.StringToInt(this.tbxAmountAlloc.Text.Trim()); int num4 = ShareMethods.StringToInt(this.tbxMachineAlloc.Text.Trim()); int num5 = (num2 - num) + 1; if (num3 <= 0) { this.tbxAmountAlloc.Focus(); MessageManager.ShowMsgBox("INP-441205", new string[] { "发票张数", "为1-65535内的整数" }); return(false); } if (num3 > num5) { this.tbxAmountAlloc.Focus(); MessageManager.ShowMsgBox("INP-441223"); return(false); } if ((num4 <= 0) || (num4 > 0x3e7)) { this.tbxMachineAlloc.Focus(); MessageManager.ShowMsgBox("INP-441205", new string[] { "开票机号", "为1-999内的整数" }); return(false); } } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); return(false); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); return(false); } return(true); }
public XfkpjfpfpForm(List <object> oSelectedItems) { try { this.Initialize(); foreach (object obj2 in oSelectedItems) { this.SelectedItems.Add(obj2.ToString()); } this.tbxCount.set_RegexText("^[0-9]*$"); this.tbxCount.MaxLength = 9; string str = Convert.ToString(ShareMethods.StringToInt(this.SelectedItems[4].ToString().Trim())); if (str.Length < 8) { str = str.PadLeft(8, '0'); } this.lblQshm.Text = str; string str2 = Convert.ToString((int)((ShareMethods.StringToInt(this.SelectedItems[4].ToString().Trim()) + ShareMethods.StringToInt(this.SelectedItems[5].ToString().Trim())) - 1)); if (str2.Length < 8) { str2 = str2.PadLeft(8, '0'); } this.lblZjhm.Text = str2; this.lblFpqshm.Text = str; this.tbxCount.Text = Convert.ToString(ShareMethods.StringToInt(this.SelectedItems[5].ToString())); } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); } }
private void btnAllot_Click(object sender, EventArgs e) { try { string deviceType; if (this.IsRightData()) { if (DialogResult.OK != MessageManager.ShowMsgBox("INP-441221")) { goto Label_02C4; } deviceType = string.Empty; ChooseAllocateMedium medium = new ChooseAllocateMedium(); if (DialogResult.OK == medium.ShowDialog()) { deviceType = medium.GetDeviceType(); goto Label_0040; } } return; Label_0040: if (base.TaxCardInstance.InvAllot(ShareMethods.StringToInt(this.SelectedItems[0].ToString()), this.lblFpqshm.Text.Trim(), ShareMethods.StringToInt(this.tbxCount.Text.Trim()), deviceType)) { new AllocateSuccess(this.SelectedItems[4].ToString(), this.tbxCount.Text.Trim()).ShowDialog(); string str2 = this.SelectedItems[2].ToString(); uint num = (Convert.ToUInt32(this.SelectedItems[4]) + Convert.ToUInt32(this.SelectedItems[5])) - Convert.ToUInt32(this.SelectedItems[7]); uint num2 = (Convert.ToUInt32(this.SelectedItems[4]) + Convert.ToUInt32(this.SelectedItems[5])) - 1; InvVolumeApp invVolume = new InvVolumeApp { TypeCode = str2, HeadCode = num, Number = Convert.ToUInt16(this.SelectedItems[5]), BuyNumber = Convert.ToInt32(this.SelectedItems[7]) }; string specificFormat = this.jpxxDal.GetSpecificFormat(invVolume); Convert.ToUInt32(this.SelectedItems[4]); uint num3 = (Convert.ToUInt32(this.SelectedItems[4]) + Convert.ToUInt32(this.tbxCount.Text)) - 1; if (num3 < num2) { InvVolumeApp invVolumn = new InvVolumeApp { BuyDate = Convert.ToDateTime(this.SelectedItems[6]), BuyNumber = (int)(num2 - num3), HeadCode = num3 + 1, InvType = ShareMethods.GetTypeCode(this.SelectedItems[1].ToString()), Number = (ushort)(num2 - num3), TypeCode = this.SelectedItems[2].ToString() }; this.jpxxDal.InsertSingleVolumn(invVolumn, specificFormat); } this.jpxxDal.DeleteSingleVolumn(invVolume); } else { if (base.TaxCardInstance.get_RetCode() != 0) { base.TaxCardInstance.get_RetCode(); MessageManager.ShowMsgBox(base.TaxCardInstance.get_ErrCode()); } return; } } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); } Label_02C4: base.DialogResult = DialogResult.OK; }