private void cancelBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (isOperating == false) { msgBox.Text = "当前无作业"; 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; fngset.Save(); DbAccess.callProcedure(schno, "picking_cancel"); DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; uiClearBtn.PerformClick(); isOperating = false; } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }
private void pickOutBtn_Click(object sender, EventArgs e) { if (!matchMckey()) { this.Close(); } else { string schno = string.Empty; try { FNPICK_CTLEntity pickCtlEntity = DbAccess.GetPick_Ctl(GlobalAccess.TermNo); if (pickCtlEntity == null) { msgBox.Text = "当前没有作业"; return; } FNHANSOEntity hansoEntity = DbAccess.GetHanSo(pickCtlEntity.MCKEY); if (hansoEntity == null) { msgBox.Text = "没有搬送数据"; return; } if (hansoEntity.HJYOTAIFLG != "6") { msgBox.Text = "Bucket还没有到达"; 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; fngset.Save(); DbAccess.callProcedure(schno, "stock_back_export"); DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; //ClearAll(); this.Close(); } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } } }
private void exportBtn_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; } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.SYORIFLG = "0"; fngset.Save(); DbAccess.callProcedure(schno, "stockin_1_export"); DbAccess.callAfterExport(); msgBox.Text = "设定成功"; ClearAll(); ticketNoBox.Focus(); ticketNoBox.SelectAll(); _isOperating = false; } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }
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 void setBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (parentWindowType == 1) { touCyaKu = DbAccess.GetTouCyaKu(GlobalAccess.StationNo); if (touCyaKu == null) { msgBox.Text = "没有到达报告"; return; } } if (string.IsNullOrEmpty(itemCodeBox.Text)) { msgBox.Text = "Item Name不能为空"; itemCodeBox.Focus(); itemCodeBox.SelectAll(); return; } else if (DoItemCode(itemCodeBox.Text) == false) { return; } else if (string.IsNullOrEmpty(colorCodeBox.Text)) { msgBox.Text = "Color Code不能为空"; colorCodeBox.Focus(); colorCodeBox.SelectAll(); return; } else if (itemCountBox.Value == 0) { msgBox.Text = "Item个数不能为0"; itemCountBox.Focus(); itemCountBox.Select(); return; } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.BUCKET_NO = bucketNoBox.Text; fngset.ZAIKEY = itemCodeBox.Text; fngset.COLOR_CODE = colorCodeBox.Text; fngset.NYUSYUSU = itemCountBox.Value; fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; fngset.SYORIFLG = "0"; fngset.Save(); if (parentWindowType == 1) { DbAccess.callProcedure(schno, "unmanaged_stockin_1_start"); } else if (parentWindowType == 2) { DbAccess.callProcedure(schno, "unmanaged_stockin_2_start"); } DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; ClearAll(); this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }
private void setBtn_Click(object sender, EventArgs e) { if (!matchMckey()) { this.Close(); } else { string schno = string.Empty; try { FNPICK_CTLEntity pickCtlEntity = DbAccess.GetPick_Ctl(GlobalAccess.TermNo); if (pickCtlEntity == null) { msgBox.Text = "当前没有作业"; return; } FNHANSOEntity hansoEntity = DbAccess.GetHanSo(pickCtlEntity.MCKEY); if (hansoEntity == null) { msgBox.Text = "没有搬送数据"; return; } if (hansoEntity.HJYOTAIFLG != "6") { msgBox.Text = "Bucket还没有到达"; return; } if (!DoBucket()) { return; } if (itemCountBox.Value == 0) { msgBox.Text = "请先称重或输入Item个数"; itemCountBox.Focus(); itemCountBox.Select(); return; } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; fngset.UNIT_WEIGHT = Convert.ToDecimal(unitWeightBox.Text) / 1000; fngset.MEASURE_WEIGHT = (itemCountBox.Value * Convert.ToDecimal(unitWeightBox.Text)) / 1000 > 99.9999m ? 99.9999m : (itemCountBox.Value * Convert.ToDecimal(unitWeightBox.Text)) / 1000; fngset.NYUSYUSU = itemCountBox.Value; fngset.MEMO = string.IsNullOrEmpty(remarkBox.Text) ? " " : remarkBox.Text.Trim(); fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; fngset.SYORIFLG = "0"; fngset.TICKET_NO = ticketNoBox.Text; fngset.BUCKET_NO = bucketNoBox.Text; fngset.BAG_FLAG = chkUsingPlasticBag.Checked ? "1" : "0"; fngset.Save(); DbAccess.callProcedure(schno, "stock_back"); DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; //ClearAll(); this.Close(); } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } } }
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 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); } }
private void setBtn_Click(object sender, EventArgs e) { string schno = string.Empty; try { if (isOperating == false) { msgBox.Text = "当前没有作业"; return; } FNPICK_CTLEntity pickCtlEntity = DbAccess.GetPick_Ctl(GlobalAccess.TermNo); if (pickCtlEntity == null) { msgBox.Text = "当前没有作业"; return; } FNHANSOEntity hansoEntity = DbAccess.GetHanSo(pickCtlEntity.MCKEY); if (hansoEntity == null) { msgBox.Text = "没有搬送数据"; return; } if (hansoEntity.HJYOTAIFLG != "6") { msgBox.Text = "Bucket还没有到达"; return; } if (pickingType != PickingType.Abnormal) { if (pickingType != PickingType.Total) { if (string.IsNullOrEmpty(this.newBucketNoBox.Text)) { msgBox.Text = "请输入BucketNo"; newBucketNoBox.Focus(); newBucketNoBox.SelectAll(); return; } else if (DbAccess.GetBucket(this.newBucketNoBox.Text) == null) { msgBox.Text = "空箱未登录"; newBucketNoBox.Focus(); newBucketNoBox.SelectAll(); return; } } if (pickingType != PickingType.Cycle) { if (string.IsNullOrEmpty(this.pickingCountBox.Text)) { msgBox.Text = "Picking数不能为空"; receiveMessageBtn.Focus(); return; } } } schno = DbAccess.generateScheduleNo(); FNGSETEntity fngset = new FNGSETEntity(); fngset.SCHNO = schno; fngset.MOTOSTNO = GlobalAccess.StationNo; if (pickingType != PickingType.Abnormal) { fngset.BUCKET_NO = newBucketNoBox.Text; if (pickingType != PickingType.Cycle) { fngset.NYUSYUSU = Decimal.Parse(this.pickingCountBox.Text); } } fngset.SYORIFLG = "0"; fngset.USERID = GlobalAccess.UserId; fngset.USERNAME = GlobalAccess.UserName; fngset.PRINTER_NO = GlobalAccess.PrinterNo; fngset.Save(); DbAccess.callProcedure(schno, "picking_start"); DbAccess.callAfterStockin(string.Empty); msgBox.Text = "设定成功"; if (pickingType != PickingType.Abnormal) { LabelPublish frm = new LabelPublish(sijis); frm.ShowDialog(this); } ClearAll(); isOperating = false; } catch (Exception ex) { msgBox.Text = ex.Message; } finally { DbAccess.UpdateFngset(schno); } }