/// <summary> /// 提交失败单据状况 /// </summary> /// <returns>是否提交成功</returns> private bool ErrSubmit() { string cCode = txtOrder.Text; DataSet ds; StockIn sk; sk = StockInBusiness.CreateSIOrderByDismantle("21", "", cCode, out ds); if (sk == null) { return(true); } if (sk.U8Details == null || sk.U8Details.Count < 1) { return(true); } if (sk.U8Details.Count != tempSIO.U8Details.Count) { return(true); } StockInDetail opera = tempSIO.OperateDetails[0]; StockInDetail sd = null; sd = sk.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == opera.cInvCode.ToUpper() && sdd.Batch.ToUpper() == opera.Batch.ToUpper()); }); if (sd == null || sd.fShallInQuan != opera.fShallInQuan) { return(true); } return(false); }
private bool ReadMoDetails() { if (cbxMoDetails.DataSource == null || cbxMoDetails.Items.Count < 1 || string.IsNullOrEmpty(cbxMoDetails.SelectedValue.ToString())) { return(false); } string strMoDID = cbxMoDetails.SelectedValue.ToString(); if (tempSIO != null && tempSIO.U8Details != null && tempSIO.U8Details.Count > 0) { StockInDetail sdl; sdl = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.Nquantity > 0 && sdd.cMoDetailsID == strMoDID); }); if (sdl != null) { return(true); } } tempSDL = null; tempSDL = StockInBusiness.GetOMMOBody(strMoDID); if (tempSDL == null || tempSDL.Count < 1) { return(false); } tempSIO.U8Details.Concat(tempSDL); return(true); }
/// <summary> /// 提交失败单据状况 /// </summary> /// <returns>是否提交成功</returns> private bool ErrSubmit() { string cCode = txtOrder.Text; DataSet ds; StockIn sk; sk = StockInBusiness.GetOMMOHead(cCode, out MODetails, out ds); if (sk.U8Details == null || sk.U8Details.Count < 1) { return(true); } if (sk.U8Details.Count != tempSIO.U8Details.Count) { return(true); } StockInDetail opera = tempSIO.OperateDetails[0]; StockInDetail sd = null; sd = sk.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == opera.cInvCode.ToUpper() && sdd.Batch.ToUpper() == opera.Batch.ToUpper()); }); if (sd == null || sd.Nquantity != opera.Nquantity) { return(true); } return(false); }
/// <summary> /// 提交单据 /// </summary> /// <returns>是否提交成功</returns> private bool SubmitData() { if (rbtArrival.Checked == true) { tempSIO.Source = "采购到货单"; } else { tempSIO.Source = "入库验收单"; } try { Cursor.Current = Cursors.WaitCursor; this.Enabled = false; StockInBusiness.Save(tempSIO, tempSIO.SaveVouch); return(true); } catch { return(false); } finally { this.Enabled = true; Cursor.Current = Cursors.Default; } }
/// <summary> /// 获取到货单信息 /// </summary> /// <param name="ArriveCode">到货单号</param> /// <returns>是否存在</returns> private bool verifyArrive(string ArriveCode) { ArriveCode = ArriveCode.ToUpper(); try { VerifyLength(ArriveCode); DataSet ds; if (rbtArrival.Checked) { tempSIO = StockInBusiness.CreateSIOrderArrive(ArriveCode, "", "", 0, out ds); } else { if (ArriveCode.Length < 12) { tempSIO = StockInBusiness.CreateSIOrderByGSPVouch(ArriveCode, null, out ds);//质检单来源 } else { tempSIO = StockInBusiness.CreateSIOrderByGSPVouch(null, ArriveCode, out ds);//到货单来源 } } if (tempSIO.U8Details == null || tempSIO.U8Details.Count < 1) { return(false); } //是否录入仓库编码 if (string.IsNullOrEmpty(tempSIO.Whcode)) { MessageBox.Show("对不起,该单据尚未指明入库仓库!"); return(false); } //是否有单据仓库操作权限 Warehouse stock = null; stock = Common.s_Warehouse.Find(delegate(Warehouse wh) { return(wh.cwhcode.Trim() == tempSIO.Whcode.Trim()); }); if (stock == null) { MessageBox.Show("对不起,您没有该单据仓库的操作权限!"); return(false); } //补全仓库信息 if (string.IsNullOrEmpty(tempSIO.Whname)) { tempSIO.Whname = stock.cwhname; tempSIO.WhPos = stock.bwhpos == 1 ? true : false; } //仓库名赋值 lblStore.Text = tempSIO.Whname; return(true); } catch (Exception er) { MessageBox.Show(er.Message); Init(); return(false); } }
private bool verifyArrive(string OrderCode) { try { DataSet ds; if (rbtOther.Checked) { tempSIO = StockInBusiness.CreateSIOrderByDismantle("21", "", OrderCode, out ds); } else if (rbtRecord.Checked) { tempSIO = StockInBusiness.CreateSIOrderByDismantle("21", OrderCode, "", out ds); } if (tempSIO.U8Details == null || tempSIO.U8Details.Count < 1) { return(false); } if (string.IsNullOrEmpty(tempSIO.Whcode)) { MessageBox.Show("对不起,该单据尚未指明入库仓库!"); return(false); } Warehouse stock = null; stock = Common.s_Warehouse.Find(delegate(Warehouse wh) { return(wh.cwhcode.Trim() == tempSIO.Whcode.Trim()); }); if (stock == null) { MessageBox.Show("对不起,您没有该单据仓库的操作权限!"); return(false); } if (string.IsNullOrEmpty(tempSIO.Whname)) { tempSIO.Whname = stock.cwhname; tempSIO.WhPos = stock.bwhpos == 1 ? true : false; } //Clear(); lblStore.Text = tempSIO.Whname; return(true); } catch (Exception er) { MessageBox.Show(er.Message); Init(); return(false); } }
private bool ReadPosition() { txtPosition.Text = txtPosition.Text.Trim().ToUpper(); if (txtPosition.Text.IndexOf('-') != -1 || txtPosition.Text.IndexOf('@') != -1 || txtPosition.Text.Length > 12) { return(false); } StockInDetail position = null; position = tempSIO.OperateDetails.Find(delegate(StockInDetail sd) { return(sd.Position.ToUpper() == txtPosition.Text); }); if (position != null) { return(true); } return(StockInBusiness.GetPTExist(tempSIO.Whcode, txtPosition.Text)); }
private bool verifyArrive(string ArriveCode) { ArriveCode = ArriveCode.ToUpper(); try { DataSet ds; tempSIO = StockInBusiness.CreateSIOrderArrive(ArriveCode, "", "", 1, out ds); if (tempSIO.U8Details == null || tempSIO.U8Details.Count < 1) { return(false); } if (!ConvertValue()) { return(false); } if (string.IsNullOrEmpty(tempSIO.Whcode)) { MessageBox.Show("对不起,该单据尚未指明入库仓库!"); return(false); } Warehouse stock = null; stock = Common.s_Warehouse.Find(delegate(Warehouse wh) { return(wh.cwhcode.Trim() == tempSIO.Whcode.Trim()); }); if (stock == null) { MessageBox.Show("对不起,您没有该单据仓库的操作权限!"); return(false); } if (string.IsNullOrEmpty(tempSIO.Whname)) { tempSIO.Whname = stock.cwhname; tempSIO.WhPos = stock.bwhpos == 1 ? true : false; } //Clear(); lblStore.Text = tempSIO.Whname; return(true); } catch (Exception er) { MessageBox.Show(er.Message); Init(); return(false); } }
private bool SubmitData() { try { this.Enabled = false; Cursor.Current = Cursors.WaitCursor; StockInBusiness.Save(tempSIO, tempSIO.SaveVouch); return(true); } catch { return(false); } finally { Cursor.Current = Cursors.Default; this.Enabled = true; } }
private bool verifyArrive(string cCode) { cCode = cCode.ToUpper(); try { DataSet ds; tempSIO = StockInBusiness.GetOMMOHead(cCode, out MODetails, out ds); if (MODetails == null || MODetails.Count < 1) { return(false); } if (string.IsNullOrEmpty(tempSIO.Whcode)) { MessageBox.Show("对不起,该单据尚未指明入库仓库!"); return(false); } Warehouse stock = null; stock = Common.s_Warehouse.Find(delegate(Warehouse wh) { return(wh.cwhcode.Trim() == tempSIO.Whcode.Trim()); }); if (stock == null) { MessageBox.Show("对不起,您没有该单据仓库的操作权限!"); return(false); } if (string.IsNullOrEmpty(tempSIO.Whname)) { tempSIO.Whname = stock.cwhname; tempSIO.WhPos = stock.bwhpos == 1 ? true : false; } tempSIO.U8Details = StockInBusiness.GetOMMOBody(MODetails[0].MoDetailsID); //Clear(); return(true); } catch (Exception er) { MessageBox.Show(er.Message); Init(); return(false); } }
private bool SubmitData() { try { this.Enabled = false; Cursor.Current = Cursors.WaitCursor; //if (!ConvertValue()) // return false; StockInBusiness.Save(tempSIO, tempSIO.SaveVouch); return(true); } catch { return(false); } finally { this.Enabled = true; } }
/// <summary> /// 提交失败单据状况 /// </summary> /// <returns>是否提交成功</returns> private bool ErrSubmit() { string cCode = txtOrder.Text; DataSet ds; StockIn sk; if (rbtArrival.Checked) { sk = StockInBusiness.CreateSIOrderArrive(cCode, "", "", 0, out ds); } else { sk = StockInBusiness.CreateSIOrderByGSPVouch(null, cCode, out ds); } //行数是否相同 if (sk == null) { return(true); } if (sk.U8Details == null || sk.U8Details.Count < 1) { return(true); } if (sk.U8Details.Count != tempSIO.U8Details.Count) { return(true); } //数量是否相同 StockInDetail opera = tempSIO.OperateDetails[0]; StockInDetail sd = null; sd = sk.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == opera.cInvCode.ToUpper() && sdd.Batch.ToUpper() == opera.Batch.ToUpper()); }); if (sd == null || sd.fShallInQuan != opera.fShallInQuan) { return(true); } return(false); }
private bool RecordNum() { string _qty = txtCount.Text.Trim(); try { if (txtOrder.Tag != null) { decimal qty = Convert.ToDecimal(_qty) * scanCount; decimal inQty = 0; StockInDetail sdl; sdl = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == txtLabel.Text.Trim().ToUpper() && sdd.Batch.ToUpper() == lblBatch.Text.Trim().ToUpper() && sdd.Nquantity > 0); }); if (sdl == null) { MessageBox.Show("该批次货物已全部扫描!"); return(false); } inQty = sdl.fShallInQuan - sdl.Nquantity; if (sdl.bInvBatch && string.IsNullOrEmpty(sdl.Batch)) { MessageBox.Show("该货物有批次管理,请输入批次后重试!"); return(false); } else if (!sdl.bInvBatch && !string.IsNullOrEmpty(lblBatch.Text)) { MessageBox.Show("该货物没有批次管理,请勿输入批次!"); return(false); } if (qty + inQty > sdl.fShallInQuan) { MessageBox.Show("扫描数量大于应出库数量!" + Environment.NewLine + "应不大于" + sdl.Nquantity.ToString("F4") + sdl.Inva_unit); return(false); } if (!string.IsNullOrEmpty(txtPosition.Text)) { if (qty + inQty > StockInBusiness.GetPTQuan(txtLabel.Text, lblBatch.Text, tempSIO.Whcode, txtPosition.Text)) { MessageBox.Show("扫描数量大于货位现有数量!"); Clear(); return(false); } } if (qty + inQty > StockInBusiness.GetWHQuan(txtLabel.Text, lblBatch.Text, tempSIO.Whcode)) { MessageBox.Show("扫描数量大于库存现有数量!"); Clear(); return(false); } StockInDetail tempSDL = sdl.getNewDetail(); if (!addData(qty, tempSDL)) { return(false); } AddPosition(qty); sdl.Nquantity -= qty; Clear(); txtLabel.Focus(); } return(true); } catch (Exception er) { MessageBox.Show(er.Message); txtCount.Focus(); return(false); } }
private bool ScanLabel() { string errMsg = ""; string cInvCode = ""; string strBarCode = txtLabel.Text.Trim().ToUpper(); txtLabel.Text = ""; string[] barcode = new string[7] { "", "", "", "", "", "", "" }; try { if (strBarCode.IndexOf('@') == -1) { //一维码 is2Code = false; barcode[0] = strBarCode; if (!Common.GetCInvCode(strBarCode, out cInvCode, out errMsg)) { MessageBox.Show("没有找到对应的存货编码!"); return(false); } barcode[2] = cInvCode; lblBarCode.Text = barcode[0]; txtLabel.Text = barcode[2]; StockInDetail sd; sd = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode == cInvCode); }); if (sd != null && sd.bInvBatch) { cbxBatch.Visible = true; cbxBatch.Enabled = true; batchList = StockInBusiness.GetBatchInfo(cInvCode, "", tempSIO.Whcode); cbxBatch.DataSource = batchList; cbxBatch.DisplayMember = "DisPlayMember"; cbxBatch.ValueMember = "Batch"; if (cbxBatch.DataSource != null && cbxBatch.Items.Count > 0) { cbxBatch.SelectedIndex = 0; } else { MessageBox.Show("该仓库暂无存货!"); return(false); } lblBatch.Text = cbxBatch.SelectedValue.ToString(); } } else { //二维码 is2Code = true; barcode = strBarCode.Split('@'); cbxBatch.Visible = false; cbxBatch.Enabled = false; batchList = null; lblBatch.Enabled = true; lblBatch.Visible = true; if (!Common.GetCInvCode(barcode[0], out cInvCode, out errMsg)) { MessageBox.Show("没有找到对应的存货编码!"); return(false); } barcode[2] = cInvCode; lblBarCode.Text = barcode[0]; txtLabel.Text = barcode[2]; lblBatch.Text = string.IsNullOrEmpty(barcode[3]) ? "" : barcode[3]; try { lblProDate.Text = DateTime.Parse(barcode[4]).ToString("yyyy-MM-dd"); lblValityDate.Text = DateTime.Parse(barcode[5]).ToString("yyyy-MM-dd"); } catch { lblProDate.Text = Common.err_Time.ToString("yyy-MM-dd"); lblValityDate.Text = Common.err_Time.ToString("yyy-MM-dd"); } } if (barcode.Length < 7 || string.IsNullOrEmpty(barcode[6])) { scanCount = 1; } else { try { scanCount = decimal.Parse(barcode[6]); } catch { scanCount = 1; } } return(true); } catch { Clear(); MessageBox.Show("对不起,条码格式错误!"); return(false); } finally { SetFocus(); } }
private bool RecordNum() { string _qty = txtCount.Text.Trim(); try { if (txtOrder.Tag != null) { decimal qty = Convert.ToDecimal(_qty) * scanCount; decimal inQty = 0; StockInDetail sdl; sdl = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == txtLabel.Text.Trim().ToUpper() && sdd.Nquantity > 0); }); if (sdl == null) { MessageBox.Show("该批次货物已全部扫描!"); return(false); } //if (sdl.Nquantity <= 0) //{ // DialogResult res = MessageBox.Show("该货物已全部扫描,仍需要扫描吗?", "提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); // if (res == DialogResult.No) // { // return false; // } //} inQty = sdl.fShallInQuan - sdl.Nquantity; if (sdl.bInvBatch && string.IsNullOrEmpty(lblBatch.Text)) { MessageBox.Show("该货物有批次管理,请输入批次后重试!"); return(false); } else if (!sdl.bInvBatch && !string.IsNullOrEmpty(lblBatch.Text)) { MessageBox.Show("该货物没有批次管理,请勿输入批次!"); return(false); } if (qty + inQty > sdl.fShallInQuan) { MessageBox.Show("扫描数量大于最大出库数量!" + Environment.NewLine + "应不大于" + sdl.Nquantity.ToString("F4") + sdl.Inva_unit); Clear(); return(false); } if (!string.IsNullOrEmpty(txtPosition.Text)) { if (qty + inQty > StockInBusiness.GetPTQuan(txtLabel.Text, "", tempSIO.Whcode, txtPosition.Text)) { MessageBox.Show("扫描数量大于货位现有数量!"); Clear(); return(false); } } if (qty + inQty > StockInBusiness.GetWHQuan(txtLabel.Text, "", tempSIO.Whcode)) { MessageBox.Show("扫描数量大于库存现有数量!"); Clear(); return(false); } if (batchList != null && batchList.Count > 0) { if (inQty > 0) { StockInDetail sid; sid = tempSIO.OperateDetails.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == txtLabel.Text.Trim().ToUpper() && sdd.Batch == lblBatch.Text && sdd.Quantity > 0); }); if (sid != null) { inQty = sid.Quantity; } else { inQty = 0; } } if (qty + inQty > batchList[cbxBatch.SelectedIndex].Quantity) { MessageBox.Show("扫描数量大于该批次现有数量!"); Clear(); return(false); } } StockInDetail tempSDL = sdl.getNewDetail(); if (!addData(qty, tempSDL)) { return(false); } AddPosition(qty); sdl.Nquantity -= qty; Clear(); txtLabel.Focus(); } return(true); } catch (Exception er) { MessageBox.Show(er.Message); txtCount.Focus(); return(false); } }
private bool RecordNum() { string _qty = txtCount.Text.Trim(); try { if (txtOrder.Tag != null) { //ln.Write("qty:", _qty); if (_qty == "") { MessageBox.Show("未输入数量!"); return(false); } if (!isNumeric(_qty)) { MessageBox.Show("请输入数字!"); return(false); } decimal qty = Convert.ToDecimal(_qty) * scanCount; decimal inQty = 0; StockInDetail sdl; sdl = tempSIO.U8Details.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == txtLabel.Text.Trim().ToUpper() && sdd.Batch.ToUpper() == lblBatch.Text.Trim().ToUpper() && sdd.Nquantity > 0); }); if (sdl == null) { MessageBox.Show("该批次货物已全部扫描!"); return(false); } inQty = sdl.fShallInQuan - sdl.Nquantity; if (sdl.bInvBatch && string.IsNullOrEmpty(lblBatch.Text)) { MessageBox.Show("该货物有批次管理,请输入批次后重试!"); return(false); } if (qty + inQty > sdl.Nquantity) { MessageBox.Show("扫描数量大于应出库数量!"); return(false); } if (qty + inQty > StockInBusiness.GetPTQuan(txtLabel.Text, lblBatch.Text, tempSIO.Whcode, txtPosition.Text)) { MessageBox.Show("扫描数量大于货位现有数量!"); return(false); } StockInDetail tempSDL = sdl.getNewDetail(); if (!addData(qty, tempSDL)) { return(false); } AddPosition(qty); Clear(); txtLabel.Focus(); } return(true); } catch (Exception er) { MessageBox.Show(er.Message); txtCount.Focus(); return(false); } }