private void oldUnitWeightBtn_Click(object sender, EventArgs e) { try { FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); if (zaikoEntity == null) { msgBox.Text = "库存数据不存在,不能更改单位重量"; return; } else { msgBox.Text = string.Empty; UnitWeightChange uwc = new UnitWeightChange(zaikoEntity); if (uwc.ShowDialog(this) == DialogResult.OK) { zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); //FMBUCKETEntity bucket = DbAccess.GetBucket(newBucketNoBox.Text); unitWeightBox.Text = (zaikoEntity.REAL_UNIT_WEIGHT * 1000).ToString(); planWeightBox.Text = (zaikoEntity.ZAIKOSU * zaikoEntity.REAL_UNIT_WEIGHT).ToString(); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }
private void ClearAll() { bucketNoBox.Clear(); bucketWeightBox.Clear(); ticketNoBox.Clear(); itemCodeBox.Clear(); itemName1Box.Clear(); itemName2Box.Clear(); itemName3Box.Clear(); colorCodeBox.Clear(); planCountBox.Clear(); planWeightBox.Clear(); unitWeightBox.Clear(); itemWeightErrorBox.Clear(); itemWeightRangeLimitFromBox.Clear(); itemWeightRangeLimitToBox.Clear(); itemWeightBox.Clear(); itemCountBox.Value = itemCountBox.Minimum; fixedWeightBox.Clear(); plasticBagStatusBox.Clear(); touCyaKu = null; zaiKo = null; zKey = null; bucket = null; itemCountBox.ReadOnly = true; }
private void unitWeightBtn_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(ticketNoBox.Text)) { msgBox.Text = "没有对应的作业数据"; return; } FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); if (zaikoEntity == null) { msgBox.Text = "库存数据不存在,不能更改单位重量"; return; } else { msgBox.Text = string.Empty; UnitWeightChange uwc = new UnitWeightChange(zaikoEntity); if (uwc.ShowDialog(this) == DialogResult.OK) { zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); unitWeightBox.Text = (zaikoEntity.REAL_UNIT_WEIGHT * 1000).ToString(); sendMessageBtn.PerformClick(); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }
private void DoMckey() { _hanso = DbAccess.GetHanSo(_mckey); if (_hanso == null) { msgBox.Text = "没有搬送数据"; return; } if (_hanso.SAGYOKBN == "5") { setStatusBox("盘库"); } _bucket = DbAccess.GetBucket(_hanso.BUCKET_NO); if (_bucket == null) { setStatusBox("空箱未登录"); return; } List <FNSIJIEntity> sijis = DbAccess.GetSiJis(_mckey); if (sijis != null && sijis.Count > 0) { _zKey = DbAccess.GetManagedZKey(sijis[0].ZAIKEY); bucketNoBox.Text = _bucket.BUCKET_NO; bucketWeightBox.Text = _bucket.PACKING_WEIGHT.ToString(); ticketNoBox.Text = sijis[0].TICKET_NO; //colorCodeBox.Text = sijis[0].COLOR_CODE; itemCodeBox.Text = _zKey.ZAIKEY; itemNameBox1.Text = _zKey.ZKNAME1; itemNameBox2.Text = _zKey.ZKNAME2; itemNameBox3.Text = _zKey.ZKNAME3; FNZAIKOEntity zaiKo = DbAccess.GetZaiKoByTicketNo(sijis[0].TICKET_NO); if (zaiKo == null) { msgBox.Text = "没有库存数据"; return; } unitWeightBox.Text = (zaiKo.REAL_UNIT_WEIGHT * 1000).ToString(); sectionBox.Text = zaiKo.MADE_SECTION; lineBox.Text = zaiKo.MADE_LINE; colorCodeBox.Text = zaiKo.COLOR_CODE; planCountBox.Text = zaiKo.ZAIKOSU.ToString(); planWeightBox.Text = (zaiKo.ZAIKOSU * zaiKo.REAL_UNIT_WEIGHT).ToString();// zaiKo.PLAN_WEIGHT.ToString(); plasticBagStatusBox.Text = zaiKo.BAG_FLAG == "1" ? "有" : "无"; chkUsingPlasticBag.Checked = zaiKo.BAG_FLAG == "1"; fixedWeightBox.Text = (GlobalAccess.FixedWeight * 1000).ToString(); setStatusBox("正常"); } else { msgBox.Text = "无数据"; return; } }
private void ClearAll() { bucketNoBox.Clear(); bucketWeightBox.Clear(); ticketNoBox.Clear(); itemCodeBox.Clear(); itemNameBox1.Clear(); itemNameBox2.Clear(); itemNameBox3.Clear(); colorCodeBox.Clear(); lineBox.Clear(); sectionBox.Clear(); planCountBox.Clear(); planWeightBox.Clear(); unitWeightBox.Clear(); measureFlagBox.Clear(); checkCountBox.Value = checkCountBox.Minimum; errorBox1.Clear(); memoBox.Clear(); //msgBox.Clear(); chkReStockIn.Checked = false; chkUsingPlasticBag.Checked = false; setStatusBox(string.Empty); _zaiKo = null; _zKey = null; _bucket = null; }
private bool DoBucketNo() { string bucketNo = bucketNoBox.Text; zaiKo = DbAccess.GetZaiKoByBucketNo(bucketNo); if (zaiKo == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "没有库存数据"; itemCodeBox.Text = string.Empty; itemName1Box.Text = string.Empty; itemName2Box.Text = string.Empty; itemName3Box.Text = string.Empty; colorCodeBox.Text = string.Empty; planCountBox.Text = string.Empty; planWeightBox.Text = string.Empty; unitWeightBox.Text = string.Empty; return(false); } else { if (zaiKo.STORAGE_PLACE_FLAG == "0") //非平库 { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "库存已存在"; return(false); } zKey = DbAccess.GetManagedZKey(zaiKo.ZAIKEY); if (zKey == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "没有此Item主数据"; return(false); } else { msgBox.Clear(); itemCodeBox.Text = zKey.ZAIKEY; itemName1Box.Text = zKey.ZKNAME1; itemName2Box.Text = zKey.ZKNAME2; itemName3Box.Text = zKey.ZKNAME3; colorCodeBox.Text = zaiKo.COLOR_CODE; planCountBox.Text = zaiKo.PLAN_QTY.ToString(); planWeightBox.Text = zaiKo.PLAN_WEIGHT.ToString(); unitWeightBox.Text = zaiKo.REAL_UNIT_WEIGHT.ToString(); plasticBagStatusBox.Text = zaiKo.BAG_FLAG.Trim() == "1" ? "有" : "无"; fixedWeightBox.Text = (GlobalAccess.FixedWeight * 1000).ToString(); DoRange(zaiKo); //处理原单位,入库许可上下限 return(true); } } }
private void ShowInfo(string systemId) { FNZAIKOEntity zaiKo = DbAccess.GetZaiKoBySystemId(systemId); if (zaiKo != null) { bucketNoBox.Text = zaiKo.BUCKET_NO; ticketNoBox.Text = zaiKo.TICKET_NO; itemCodeBox.Text = zaiKo.ZAIKEY; colorCodeBox.Text = zaiKo.COLOR_CODE; } }
private void DoRange(FNZAIKOEntity zaiKo) { FNRANGEEntity range = DbAccess.GetRange(zaiKo.MADE_SECTION, zaiKo.MADE_LINE); if (range == null) { itemWeightRangeLimitFromBox.Text = "100"; itemWeightRangeLimitToBox.Text = "100"; } else { itemWeightRangeLimitFromBox.Text = range.STORAGE_LOWER.ToString(); itemWeightRangeLimitToBox.Text = range.STORAGE_UPPER.ToString(); } }
private void DoRange(FNZAIKOEntity zaiKo) { FNRANGEEntity range = DbAccess.GetRange(zaiKo.MADE_SECTION, zaiKo.MADE_LINE); if (range == null) { rangeLimitFromBox1.Text = "100"; rangeLimitToBox1.Text = "100"; } else { rangeLimitFromBox1.Text = range.UNIT_WEIGHT_LOWER.ToString(); rangeLimitToBox1.Text = range.UNIT_WEIGHT_UPPER.ToString(); } }
private void ShowInfo(string systemId) { FNZAIKOEntity zaiKo = DbAccess.GetZaiKoBySystemId(systemId); if (zaiKo == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "没有库存数据"; return; } bucketNoBox.Text = zaiKo.BUCKET_NO; ticketNoBox.Text = zaiKo.TICKET_NO; itemCodeBox.Text = zaiKo.ZAIKEY; colorCodeBox.Text = zaiKo.COLOR_CODE; lineBox.Text = zaiKo.MADE_LINE; sectionBox.Text = zaiKo.MADE_SECTION; }
private void ClearAll() { bucketNoBox.Clear(); bucketWeightBox.Clear(); ticketNoBox.Clear(); itemCodeBox.Clear(); itemNameBox1.Clear(); itemNameBox2.Clear(); itemNameBox3.Clear(); colorCodeBox.Clear(); lineBox.Clear(); sectionBox.Clear(); planCountBox.Clear(); planWeightBox.Clear(); unitWeightBox.Clear(); measureFlagBox.Clear(); checkCountBox.Value = checkCountBox.Minimum; unitWeightErrorBox.Clear(); itemWeightErrorBox.Clear(); unitWeightRangeLimitFromBox.Clear(); itemWeightRangeLimitFromBox.Clear(); unitWeightRangeLimitToBox.Clear(); itemWeightRangeLimitToBox.Clear(); itemWeightBox.Clear(); itemCountBox.Value = itemCountBox.Minimum; memoBox.Clear(); chkReStockIn.Checked = false; // manCheck.Checked = false; chkUsingPlasticBag.Checked = false; fixedWeightBox.Clear(); _touCyaKu = null; _zaiKo = null; _zKey = null; _bucket = null; itemCountBox.ReadOnly = true; }
private void CheckTask() { pick_ctl = DbAccess.GetPick_Ctl(GlobalAccess.TermNo); if (pick_ctl == null || string.IsNullOrEmpty(pick_ctl.MCKEY == null ? pick_ctl.MCKEY : pick_ctl.MCKEY.Trim())) //无拣选预定 { ClearAll(); return; } FNHANSOEntity hanso = DbAccess.GetHanSo(pick_ctl.MCKEY.Trim()); if (hanso == null) { msgBox.Text = "没有搬送数据"; WriteLog("无法找到Hanso数据,Mckey为" + pick_ctl.MCKEY.Trim()); return; } if (hanso.HJYOTAIFLG != "6") //Bucket未到达 { return; } isOperating = true; //操作状态,不再刷数据库 cancelBtn.Enabled = hanso.SAGYOKBN != "7"; //直行搬送,取消按钮不可按下 try { mcKey = GetTaskMckey(); //取得MCKEY,PickingType,剩余作业数,剩余拣选数 } catch (Exception ex) { throw new Exception("GetTaskMckey出错:" + ex.Message); } if (string.IsNullOrEmpty(mcKey)) { msgBox.Text = "无法获得作业内容"; WriteLog("GetTaskMckey无法找到对应数据"); return; } if (pickingType == PickingType.Return) //如果是回库作业,弹出回库窗口 { StockBack frm = new StockBack(mcKey); frm.ShowDialog(this); isOperating = false; //回库结束,开启刷数据库 return; } sijis = DbAccess.GetSiJis(mcKey); if (sijis == null || sijis.Count == 0) { msgBox.Text = "没有指示数据"; WriteLog(string.Format("无法找到siji数据,mckey{0}", mcKey)); return; } if (sijis[0].ZAIKEY == null) { msgBox.Text = "无法找到siji.zaikey"; WriteLog("无法找到siji.zaikey"); return; } zKey = DbAccess.GetManagedZKey(sijis[0].ZAIKEY); if (zKey == null) { msgBox.Text = "无法找到ZAIKEY数据"; WriteLog(string.Format("无法找到ZAIKEY数据,zkey{0}", zKey)); return; } originalBucketNoBox.Text = hanso.BUCKET_NO; FMBUCKETEntity originalBucket = DbAccess.GetBucket(hanso.BUCKET_NO); originalBucketWeightBox.Text = originalBucket == null ? string.Empty : originalBucket.PACKING_WEIGHT.ToString(); ticketNoBox.Text = sijis[0].TICKET_NO; colorCodeBox.Text = sijis[0].COLOR_CODE; itemCodeBox.Text = zKey.ZAIKEY; itemName1Box.Text = zKey.ZKNAME1; itemName2Box.Text = zKey.ZKNAME2; itemName3Box.Text = zKey.ZKNAME3; zaikoEntity = DbAccess.GetZaiKoBySystemId(hanso.SYSTEMID); unitWeightBox.Text = zaikoEntity == null ? string.Empty : (zaikoEntity.REAL_UNIT_WEIGHT * 1000).ToString(); remainJobBox.Text = remainCount.ToString(); totalStockoutCountBox.Text = remainPickingQty.ToString(); planCount = 0; foreach (FNSIJIEntity siji in sijis) //作业数量 { planCount += siji.NYUSYUSU; } //全拣选时不可输入BucketNo newBucketNoBox.ReadOnly = (pickingType == PickingType.Total); //收、发计量报告按钮在盘库时不可用 sendMessageBtn.Enabled = (pickingType != PickingType.Cycle); receiveMessageBtn.Enabled = (pickingType != PickingType.Cycle); //BucketNo不一致时,出库取消按钮不可用 cancelBtn.Enabled = pick_ctl.BUCKETREADING_FLG != "2"; if (pickingType == PickingType.Total) { msgBox.Clear(); emptyBucketPositionBox.Text = "无设置"; jobTypeBox.Text = "全拣选"; jobCountBox.Text = planCount.ToString(); newBucketNoBox.Text = hanso.BUCKET_NO; //全拣选时自动读出重量,计量器自动送信 if (DoBucketNoOnTotal()) { sendMessageBtn.PerformClick(); } } if (pickingType == PickingType.Reverse) { msgBox.Clear(); emptyBucketPositionBox.Text = "设置在称重机前"; jobTypeBox.Text = "反拣选"; jobCountBox.Text = planCount.ToString(); newBucketNoBox.Focus(); newBucketNoBox.SelectAll(); } if (pickingType == PickingType.Normal || pickingType == PickingType.Subdivided) { msgBox.Clear(); emptyBucketPositionBox.Text = "设置于称重机上"; jobTypeBox.Text = pickingType == PickingType.Normal ? "拣选" : "拣选(细分)"; jobCountBox.Text = planCount.ToString(); newBucketNoBox.Focus(); newBucketNoBox.SelectAll(); } if (pickingType == PickingType.Abnormal) { msgBox.Clear(); emptyBucketPositionBox.Text = "无设置"; if (pick_ctl.BUCKETREADING_FLG == "2") { jobTypeBox.Text = "Bucket不一致"; } } if (pickingType == PickingType.Cycle) { msgBox.Clear(); jobCountBox.Text = "0"; newBucketNoBox.Text = hanso.BUCKET_NO; FMBUCKETEntity bucketEntity = DbAccess.GetBucket(hanso.BUCKET_NO); newBucketWeightBox.Text = bucketEntity == null ? string.Empty : bucketEntity.PACKING_WEIGHT.ToString(); emptyBucketPositionBox.Text = "无设置"; jobTypeBox.Text = "盘库"; } }
private void setBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (statusBox.Text == "系统Offline") { return; } if (isOperating == false) { return; } if (statusBox.Text == "空箱登录模式" || statusBox.Text == "正常") { if (statusBox.Text == "正常") { if (string.IsNullOrEmpty(unitWeightBox.Text)) { msgBox.Text = "请先获得单位重量"; unitWeightBox.Focus(); unitWeightBox.SelectAll(); return; } if (string.IsNullOrEmpty(itemWeightBox.Text)) { msgBox.Text = "请先读取Item重量"; itemWeightBox.Focus(); itemWeightBox.SelectAll(); return; } if (itemCountBox.Value <= 0) { msgBox.Text = "Item数量必须大于0"; weightLoadBtn.Focus(); return; } } else if (statusBox.Text == "空箱登录模式") { if (string.IsNullOrEmpty(itemWeightBox.Text)) { msgBox.Text = "请先读取Item重量"; return; } if (decimal.Parse(itemWeightBox.Text) == 0) { msgBox.Text = "Item重量不可为0"; weightLoadBtn.Focus(); return; } } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.SYORIFLG = "0"; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; if (statusBox.Text == "正常") { fngset.UNIT_WEIGHT = Convert.ToDecimal(unitWeightBox.Text) / 1000; fngset.MEASURE_WEIGHT = Convert.ToDecimal(itemWeightBox.Text); fngset.NYUSYUSU = itemCountBox.Value; //fngset.TICKET_NO = ticketNoBox.Text; fngset.BUCKET_NO = bucketNoBox.Text; } else if (statusBox.Text == "空箱登录模式") { fngset.PACKING_WEIGHT = Convert.ToDecimal(itemWeightBox.Text); } fngset.Save(); DbAccess.callProcedure(schno, "stockin_3"); if (statusBox.Text == "正常") { FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByBucketNo(bucketNoBox.Text); DbAccess.callAfterStockin(zaikoEntity.WEIGHT_REPORT_COMPLETE_FLAG); } else if (statusBox.Text == "空箱登录模式") { DbAccess.callAfterStockin(string.Empty); } msgBox.Text = "设定成功"; ClearAll(); weightLoadBtn.Focus(); isOperating = false; isRangeError = false; } else { exportBtn.PerformClick(); } } catch (Exception ex) { manCheck.Checked = true; msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }
private bool DoTouCyaKu(FNTOUCYAKUEntity touCyaKu) { bucketNoBox.Text = touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR" ? string.Empty : touCyaKu.BUCKET_NO; if (touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR") { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); setStatusBox("条码未读取"); setUIOnExport(); isOperating = true; return(false); } FNHANSOEntity hanSo = DbAccess.GetHanSo(touCyaKu.MCKEY); if (hanSo == null) { setStatusBox("排出"); touCyaKu.SYORIFLG = "1"; touCyaKu.Save(); setUIOnExport(); isOperating = true; return(false); } if (touCyaKu.HEIGHT_FLAG == "3") //货形高低异常 { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error); setStatusBox("Bucket高度异常"); setUIOnExport(); isOperating = true; return(false); } FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo); if (station == null) { return(false); } if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket) { setStatusBox("空箱登录模式"); isOperating = true; return(true); } if (station.NYUSYUMODE == Nyusyumode.Normal) //入库模式 { bucket = DbAccess.GetBucket(touCyaKu.BUCKET_NO); if (bucket == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); setStatusBox("空箱未登录"); setUIOnExport(); isOperating = true; return(false); } bucketWeightBox.Text = bucket.PACKING_WEIGHT.ToString(); if (bucket.HEIGHT_FLAG != touCyaKu.HEIGHT_FLAG) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error); setStatusBox("Bucket高度异常"); setUIOnExport(); isOperating = true; return(false); } if (DbAccess.IsBucketInLocation(bucket.BUCKET_NO)) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); setStatusBox("Bucket重复"); setUIOnExport(); isOperating = true; return(false); } zaiKo = DbAccess.GetZaiKoByBucketNo(bucket.BUCKET_NO); if (zaiKo == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); setStatusBox("Bucket未设定"); setUIOnExport(); isOperating = true; return(false); } msgBox.Clear(); setStatusBox("正常"); isOperating = true; ticketNoBox.Text = zaiKo.TICKET_NO; return(DoBucketNo()); } return(false); }
public UnitWeightChange(FNZAIKOEntity zaikoEntity) { InitializeComponent(); this.zaikoEntity = zaikoEntity; }
private void setBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (statusBox.Text == "系统Offline") { return; } if (statusBox.Text == "通过") { return; } if (_isOperating == false) { return; } if (_touCyaKu == null) { msgBox.Text = "没有到达报告"; return; } if (statusBox.Text == "空箱登录模式" || statusBox.Text == "正常") { if (statusBox.Text == "正常") { FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo); if (station == null) { msgBox.Text = "无法取得站台信息"; return; } if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket) { setStatusBox("空箱登录模式"); setUIOnEmptyBucketMode(); return; } if (ticketNoBox.Text.Trim() == string.Empty) { msgBox.Text = "TicketNo不能为空"; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } if (effectiveTicketNo != ticketNoBox.Text) { msgBox.Text = "TicketNo无效"; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } if (string.IsNullOrEmpty(unitWeightBox.Text)) { msgBox.Text = "请先获得单位重量"; unitWeightLoadBtn.Focus(); return; } if (decimal.Parse(unitWeightBox.Text) == 0) { msgBox.Text = "单位重量必须大于0"; unitWeightBox.Focus(); unitWeightBox.SelectAll(); return; } if (string.IsNullOrEmpty(itemWeightBox.Text)) { msgBox.Text = "请先读取Item重量"; weightLoadBtn.Focus(); return; } if (itemCountBox.Value <= 0) { msgBox.Text = "Item数量必须大于0"; itemCountBox.Focus(); itemCountBox.Select(); return; } if (Encoding.Default.GetByteCount(this.memoBox.Text) > memoBox.MaxLength) { msgBox.Text = "备注超长(规定长度是100个半角字符,1个汉字等于2个半角字符)"; memoBox.Focus(); memoBox.SelectAll(); return; } } else if (statusBox.Text == "空箱登录模式") { FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo); if (station == null) { msgBox.Text = "无法取得站台信息"; return; } if (station.NYUSYUMODE == Nyusyumode.Normal) { setStatusBox("空箱登录模式"); setUIOnNormalMode(); return; } if (string.IsNullOrEmpty(itemWeightBox.Text)) { msgBox.Text = "请先读取Item重量"; weightLoadBtn.Focus(); return; } if (decimal.Parse(itemWeightBox.Text) == 0) { msgBox.Text = "Item重量不可为0"; weightLoadBtn.Focus(); return; } } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.SYORIFLG = "0"; fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; if (statusBox.Text == "正常") { fngset.UNIT_WEIGHT = Convert.ToDecimal(unitWeightBox.Text) / 1000; fngset.MEASURE_WEIGHT = Convert.ToDecimal(itemWeightBox.Text); fngset.NYUSYUSU = itemCountBox.Value; fngset.MEMO = string.IsNullOrEmpty(memoBox.Text.Trim()) ? " " : memoBox.Text; fngset.TICKET_NO = effectiveTicketNo; fngset.SAINYUKBN = chkReStockIn.Checked ? "1" : " "; fngset.BAG_FLAG = chkUsingPlasticBag.Checked ? "1" : "0"; } else if (statusBox.Text == "空箱登录模式") { fngset.PACKING_WEIGHT = Convert.ToDecimal(itemWeightBox.Text); } fngset.Save(); DbAccess.callProcedure(schno, "stockin_1"); if (statusBox.Text == "正常") { FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(effectiveTicketNo); _preZaiKey = zaikoEntity.ZAIKEY; _preColorCode = zaikoEntity.COLOR_CODE; _preUnitWeight = decimal.Parse(unitWeightBox.Text); DbAccess.callAfterStockin(zaikoEntity.WEIGHT_REPORT_COMPLETE_FLAG); } else if (statusBox.Text == "空箱登录模式") { DbAccess.callAfterStockin(string.Empty); } msgBox.Text = "设定成功"; ClearAll(); ticketNoBox.Focus(); ticketNoBox.SelectAll(); _isOperating = false; isRangeError = false; } else { exportBtn.PerformClick(); } } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }
private void DoTicketNo() { string ticketNo = ticketNoBox.Text; if (string.IsNullOrEmpty(ticketNo.Trim())) { return; } _zaiKo = DbAccess.GetZaiKoByTicketNo(ticketNo); if (_zaiKo == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "库存未登录"; itemCodeBox.Text = string.Empty; itemNameBox1.Text = string.Empty; itemNameBox2.Text = string.Empty; itemNameBox3.Text = string.Empty; colorCodeBox.Text = string.Empty; sectionBox.Text = string.Empty; lineBox.Text = string.Empty; planCountBox.Text = string.Empty; planWeightBox.Text = string.Empty; unitWeightBox.Text = string.Empty; measureFlagBox.Text = string.Empty; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } if (_zaiKo.STORAGE_PLACE_FLAG == "0") //非平库 { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "库存已存在"; itemCodeBox.Text = string.Empty; itemNameBox1.Text = string.Empty; itemNameBox2.Text = string.Empty; itemNameBox3.Text = string.Empty; colorCodeBox.Text = string.Empty; sectionBox.Text = string.Empty; lineBox.Text = string.Empty; planCountBox.Text = string.Empty; planWeightBox.Text = string.Empty; unitWeightBox.Text = string.Empty; measureFlagBox.Text = string.Empty; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } _zKey = DbAccess.GetManagedZKey(_zaiKo.ZAIKEY); if (_zKey == null) { DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error); msgBox.Text = "没有此Item主数据"; itemCodeBox.Text = string.Empty; itemNameBox1.Text = string.Empty; itemNameBox2.Text = string.Empty; itemNameBox3.Text = string.Empty; colorCodeBox.Text = string.Empty; sectionBox.Text = string.Empty; lineBox.Text = string.Empty; planCountBox.Text = string.Empty; planWeightBox.Text = string.Empty; unitWeightBox.Text = string.Empty; measureFlagBox.Text = string.Empty; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } msgBox.Clear(); itemCodeBox.Text = _zKey.ZAIKEY; itemNameBox1.Text = _zKey.ZKNAME1; itemNameBox2.Text = _zKey.ZKNAME2; itemNameBox3.Text = _zKey.ZKNAME3; colorCodeBox.Text = _zaiKo.COLOR_CODE; sectionBox.Text = _zaiKo.MADE_SECTION; lineBox.Text = _zaiKo.MADE_LINE; planCountBox.Text = _zaiKo.PLAN_QTY.ToString(); planWeightBox.Text = _zaiKo.PLAN_WEIGHT.ToString(); unitWeightBox.Text = (_zKey.MASTER_UNIT_WEIGHT * 1000).ToString(); checkCountBox.Value = _zKey.MEASURE_QTY; measureFlagBox.Text = _zKey.MEASURE_FLAG.Trim() == "0" ? "不要" : "要"; memoBox.Text = _zaiKo.MEMO; chkUsingPlasticBag.Checked = _zKey.BAG_FLAG.Trim() == "1"; fixedWeightBox.Text = (GlobalAccess.FixedWeight * 1000).ToString(); DoRange(_zaiKo); //处理原单位,入库许可上下限 if (_preZaiKey != _zKey.ZAIKEY || _preColorCode != _zaiKo.COLOR_CODE) { if (_zKey.MEASURE_FLAG.Trim() != "0") { unitWeightBox.Text = string.Empty; } } else { unitWeightBox.Text = _preUnitWeight.ToString(); } }
private void setBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (statusBox.Text == "系统Offline") { return; } if (!DoBucketNo()) { bucketNoBox.Focus(); bucketNoBox.SelectAll(); return; } if (statusBox.Text == "正常") { if (ticketNoBox.Text.Trim() == string.Empty) { msgBox.Text = "TicketNo不能为空"; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } if (effectiveTicketNo != ticketNoBox.Text) { msgBox.Text = "TicketNo无效"; ticketNoBox.Focus(); ticketNoBox.SelectAll(); return; } if (string.IsNullOrEmpty(unitWeightBox.Text)) { msgBox.Text = "单位重量不能为空"; unitWeightLoadBtn.Focus(); return; } if (Encoding.Default.GetByteCount(this.memoBox.Text) > memoBox.MaxLength) { msgBox.Text = "备注超长(规定长度是100个半角字符,1个汉字等于2个半角字符)"; memoBox.Focus(); memoBox.SelectAll(); return; } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.UNIT_WEIGHT = Convert.ToDecimal(unitWeightBox.Text) / 1000; fngset.MEMO = string.IsNullOrEmpty(memoBox.Text.Trim()) ? " " : memoBox.Text; fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; fngset.SYORIFLG = "0"; fngset.TICKET_NO = effectiveTicketNo; fngset.BUCKET_NO = bucketNoBox.Text; fngset.SAINYUKBN = chkReStockIn.Checked ? "1" : " "; fngset.BAG_FLAG = chkUsingPlasticBag.Checked ? "1" : "0"; fngset.Save(); DbAccess.callProcedure(schno, "stockin_2"); DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; bucketNoBox.Focus(); bucketNoBox.SelectAll(); FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(effectiveTicketNo); _preZaiKey = _zKey.ZAIKEY; _preColorCode = zaikoEntity.COLOR_CODE; _preUnitWeight = decimal.Parse(unitWeightBox.Text); ClearAll(); bucketNoBox.Focus(); bucketNoBox.SelectAll(); } else { msgBox.Text = "非正常模式下不能进行设定"; } } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }