public FormBoxLabel( Bean.BoxBean bean) { InitializeComponent(); this._bean = bean; if (_bean != null) { txtName.Text = _bean.name; txtNumber.Text = _bean.number; txtRFID.Text = _bean.rfid; } }
protected void Go() { lblOne.Text = lblTwo.Text = ""; bool isPass = true; if (String.IsNullOrEmpty(txtName.Text)) { isPass = false; txtName.Focus(); lblOne.Text = "请输入名称"; lblOne.Visible = true; } if (String.IsNullOrEmpty(txtRFID.Text)) { isPass = false; lblTwo.Visible = true; txtRFID.Focus(); lblTwo.Text = "请扫描标签"; } if (!isPass) { return; } if (_bean == null) { _bean = new Bean.BoxBean(); } _bean.name = txtName.Text.Trim(); _bean.rfid = txtRFID.Text.Trim(); _bean.number = txtNumber.Text.Trim(); if (backgroundWorker1.IsBusy) return; this.panelLoading.Visible = true; this.lblLoadingText.Text = "正在请求操作,请稍等......"; this.panelLoading.BringToFront(); this.panelLoading.Location = new Point((this.Width / 2 - this.panelLoading.Width / 2), this.Height / 2 - this.panelLoading.Height - 20); backgroundWorker1.RunWorkerAsync(_bean); }
protected void SelectBoxLabel(BoxBean bean) { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.SelectedBoxLabel = bean; }