public ResponseResult ScanRepLabel(string serialno, string repno, string jobno, string mcno, string userid) { response = new ResponseResult(); using (ReplenishBLL repBll = new ReplenishBLL()) { response = repBll.ScanRepLabel(serialno, repno, jobno, mcno, userid); } return response; }
public void ScanLabel(string serialNo) { try { ResponseResult res = new ResponseResult(); using (ReplenishBLL repBll = new ReplenishBLL()) { res = repBll.ScanRepLabel(serialNo, this.REP_NO, txtJobNo.Text, txtMCNo.Text, this.USER_ID); } if (res.Status) { if (res.Data != null) { MaterialCard matInfo = new MaterialCard(); matInfo = JsonConvert.DeserializeObject <MaterialCard>(res.Data.ToString()); this.lblLabelScan.Text = serialNo; this.lblMtlCode.Text = matInfo.MTL_CODE; this.lblMtlName.Text = matInfo.MTL_NAME; this.lblGrade.Text = matInfo.MTL_GRADE; this.lblColor.Text = matInfo.MTL_COLOR; this.lblQty.Text = matInfo.QTY.ToString() + " " + matInfo.UNIT_ID; if (res.Message == "OK") { this.SERIAL_NO = serialNo; this.MATERIAL_CODE = matInfo.MTL_CODE; this.SCAN_COUNTER++; this.lblTotalQty.Text = String.Format("{0} / {1}", this.SCAN_COUNTER, this.txtNoOfLabel.Text); this.SetActiveColor("txtSerialNo"); this.SetTextFocusControl(this.txtSerialNo, true); if (this.SCAN_COUNTER == Convert.ToInt32(this.txtNoOfLabel.Text, NumberFormatInfo.CurrentInfo)) { base.ShowCompletelyBox(string.Format("'{0}' {1}", this.lblProductNo.Text, ResourceManager.Instance.GetString("REPLENISH_COMPLETE")), ResourceManager.Instance.GetString("TITLE_INFORMATION")); this.txtJobNo.Text = String.Empty; this.txtMCNo.Text = String.Empty; this.txtNoOfLabel.Text = String.Empty; this.txtSerialNo.Text = string.Empty; this.SetActiveColor("txtJobNo"); this.SetTextFocusControl(this.txtJobNo, true); } } else { base.ShowWarningBox(string.Format("'{0}' {1}", serialNo, ResourceManager.Instance.GetString(res.Message)), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK")); this.SetActiveColor("txtSerialNo"); this.SetTextFocusControl(this.txtSerialNo, true); } } else { base.ShowWarningBox(string.Format("'{0}' {1}", serialNo, ResourceManager.Instance.GetString(res.Message)), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK")); this.SetActiveColor("txtSerialNo"); this.SetTextFocusControl(this.txtSerialNo, true); } } } catch (WebException wex) { base.HideWaitProcess(); base.ShowErrorBox(wex.Message, "WebException"); this.SetActiveColor("txtSerialNo"); this.SetTextFocusControl(this.txtSerialNo, true); } catch (Exception ex) { base.HideWaitProcess(); base.ShowErrorBox(ex.Message, "Exception"); this.SetActiveColor("txtSerialNo"); this.SetTextFocusControl(this.txtSerialNo, true); } }