protected override void ScanBarCode() { string barCode = this.tbBarCode.Text.Trim(); this.tbBarCode.Focus(); this.tbBarCode.Text = string.Empty; string op = Utility.GetBarCodeType(this.user.BarCodeTypes, barCode); if (barCode.Length < 3) { throw new BusinessException("条码格式不合法"); } if (_bin == null && !this.isCancel) { if (op == CodeMaster.BarCodeType.B.ToString()) { barCode = barCode.Substring(2, barCode.Length - 2); this._bin = smartDeviceService.GetBin(barCode); if (this._bin == null) { throw new BusinessException("扫描的库格不存在"); } else { this.lblMessage.Text = "请扫描物料/容器条码"; this.lblMessage.ForeColor = Color.Black; } } else { throw new BusinessException("请先扫描库格条码"); } } else if (!this.isCancel) { if (op == CodeMaster.BarCodeType.COT.ToString()) { var huList = smartDeviceService.GetContainerHu(barCode).ToList(); this.hus.AddRange(huList); } else if (op == CodeMaster.BarCodeType.HU.ToString()) { Hu hu = this.smartDeviceService.GetHu(barCode); if (hu == null) { throw new BusinessException("此条码不存在"); } else if (hu.Status != HuStatus.Location) { throw new BusinessException("条码不在库存中,不能装入容器"); } else if(hu.IsFreeze) { throw new BusinessException("条码被冻结,不能装入容器"); } else if (hu.OccupyType != OccupyType.None) { throw new BusinessException("条码被{0}占用!", hu.OccupyReferenceNo); } else { hus.Add(hu); this.isCancel = false; } } else { throw new BusinessException("条码格式不合法"); } } else { if (op == CodeMaster.BarCodeType.HU.ToString()) { if (hus.Where(h => h.HuId == barCode).ToList().Count > 0) { this.hus = this.hus.Where(h => h.HuId != barCode).ToList(); base.gvHuListDataBind(); } else { throw new BusinessException("条码{0}未扫入不需取消", barCode); } } } this.gvHuListDataBind(); }
private void ScanBarCode() { this.tbBarCode.Focus(); string barCode = this.tbBarCode.Text.Trim(); if (barCode.Length < 3) { return; //throw new BusinessException("条码格式不合法"); } string op = Utility.GetBarCodeType(this.user.BarCodeTypes, barCode); if (op == CodeMaster.BarCodeType.B.ToString()) { barCode = barCode.Substring(2, barCode.Length - 2); this.bin = this.smartDeviceService.GetBin(barCode); this.lblMessage.Text = "当前库格: " + this.bin.Code; this.lbl06.Text = this.bin.Code; } else if (op == CodeMaster.BarCodeType.HU.ToString()) { if (this.bin == null) { throw new BusinessException("请先扫描库格"); } this.hu = this.smartDeviceService.GetHu(barCode); if (this.hu == null) { throw new BusinessException("此条码不存在"); } if (!Utility.HasPermission(user.Permissions, null, true, false, this.hu.Region, null)) { throw new BusinessException("没有操作此区域{0}的权限", hu.Region); } this.smartDeviceService.DoPutAway(barCode, this.bin.Code, this.user.Code); this.lbl01.Text = this.hu.Item; this.lbl02.Text = this.hu.ReferenceItemCode; this.lbl03.Text = this.hu.LotNo; this.lbl04.Text = this.hu.Qty.ToString("0.########"); this.lbl05.Text = this.hu.Uom; //this.lbl06.Text = this.hu.Location; this.lbl07.Text = this.hu.ManufactureDate.ToString("yyyy-MM-dd HH:mm"); this.lbl08.Text = this.hu.ManufactureParty; this.lblBarCodeInfo.Text = this.hu.HuId; this.lblItemDescInfo.Text = this.hu.ItemDescription; this.lblMessage.Text = "上架成功!"; } else { throw new BusinessException("条码格式不合法"); } this.tbBarCode.Text = string.Empty; }
protected override void Reset() { this.hus = new List<Hu>(); this._bin = null; base.lblMessage.Text = "请扫描库格条码"; base.lblMessage.ForeColor = Color.Black; //this.lblMessage.Text = string.Empty; this.tbBarCode.Text = string.Empty; this.isCancel = false; this.isMasterBind = true; this.lblBarCode.ForeColor = Color.Black; this.gvHuListDataBind(); this.tbBarCode.Focus(); }
private void Reset() { this.lbl01.Text = string.Empty; this.lbl02.Text = string.Empty; this.lbl03.Text = string.Empty; this.lbl04.Text = string.Empty; this.lbl05.Text = string.Empty; this.lbl06.Text = string.Empty; this.lbl07.Text = string.Empty; this.lbl08.Text = string.Empty; this.lblBarCodeInfo.Text = string.Empty; this.lblItemDescInfo.Text = string.Empty; this.tbBarCode.Text = string.Empty; this.lblMessage.Text = "请扫描库格条码"; this.tbBarCode.Focus(); this.hu = new Hu(); this.bin = null; this.keyCodeDiff = Utility.GetKeyCodeDiff(); }