private void Check_woId_Data() { dgvwiptracking.DataSource = null; string woId = InputQuery.ShowInputBox("请输入工单", string.Empty); if (!string.IsNullOrEmpty(woId)) { DataTable dt = oDB.Get_woId_Info(woId); DataTable _dtStock = new DataTable(); if (dt != null && dt.Rows.Count > 0) { LabCraft.Text = dt.Rows[0]["OUTPUTGROUP"].ToString(); My_WipStation = dt.Rows[0]["LOC"].ToString(); //if (!CHECK_PRODUCT_LINE(dt.Rows[0]["LINEID"].ToString())) // return; DataTable dtwip = oDB.Get_WIP_Tracking(woId, LabCraft.Text); if (dtwip.Rows.Count > 0) { _dtStock = dtwip.Clone(); ShowMsg(mLogMsgType.Normal, "开始检查途程....."); foreach (DataRow dr in dtwip.Rows) { string _StrErr = oDB.CheckRoute(dr["ESN"].ToString(), LabCraft.Text); if (_StrErr == "OK") { _dtStock.ImportRow(dr); } else { ShowMsg(mLogMsgType.Warning, string.Format("检查途程失败,ESN [{0}]-> {1}", dr["ESN"].ToString(), _StrErr)); } } dgvwiptracking.DataSource = _dtStock; ShowMsg(mLogMsgType.Incoming, string.Format("工单[{0}] OK,共计[{1}]笔", woId, dgvwiptracking.Rows.Count.ToString())); } else { ShowMsg(mLogMsgType.Incoming, string.Format("没有待入库数据")); } } else { ShowMsg(mLogMsgType.Error, string.Format("工单[{0}]不存在", woId)); Check_woId_Data(); } } }
private void Imbt_ReUpload_Click(object sender, EventArgs e) { string STOCK_NO = InputQuery.ShowInputBox("输入入库单号", string.Empty); if (!string.IsNullOrEmpty(STOCK_NO)) { DataTable dt = oDB.Get_WIP_Tracking_ReUpload(STOCK_NO); if (dt.Rows.Count > 0) { DataTable dtwoinfo = oDB.Get_woId_Info(dt.Rows[0]["WOID"].ToString()); if (dtwoinfo.Rows.Count > 0) { //UpLoadToDB = new UpLoadDB(UpLoad_DB); //UpLoadToDB.BeginInvoke(dt, STOCK_NO, dtwoinfo.Rows[0]["OUTPUTGROUP"].ToString(), LabLine.Text, 0, dtwoinfo.Rows[0]["LOC"].ToString(), null, null); UpLoad_DB(dt, STOCK_NO, dtwoinfo.Rows[0]["OUTPUTGROUP"].ToString(), LabLine.Text, 0, dtwoinfo.Rows[0]["LOC"].ToString()); } else { ShowMsg(mLogMsgType.Error, "没有找到工单"); } } else { ShowMsg(mLogMsgType.Error, "没有未完上抛完成数据"); try { DataTable dtPrintDoc = oDB.GetStockInPrint(STOCK_NO); if (dtPrintDoc.Rows.Count == 0) { return; } ShowMsg(mLogMsgType.Normal, "重新传入单据信息"); foreach (DataRow dr in dtPrintDoc.Rows) { oDB.Insert_SAP_BackFlush(STOCK_NO, dr["WOID"].ToString(), dr["PARTNUMBER"].ToString(), dr["PRODUCTNAME"].ToString(), Convert.ToInt32(dr["QTY"].ToString())); WriteLog(string.Format("Insert_SAP_BackFlush [{0}] [{1}] [{2}] [{3}] [{4}]", STOCK_NO, dr["WOID"].ToString(), dr["PARTNUMBER"].ToString(), dr["PRODUCTNAME"].ToString(), dr["QTY"].ToString())); } ShowMsg(mLogMsgType.Normal, "重新传入单据完成"); } catch (Exception ex) { ShowMsg(mLogMsgType.Error, ex.Message); } } } }
private void rePrintMenu_Click(object sender, EventArgs e) { string STOCK_NO = InputQuery.ShowInputBox("输入入库单号", string.Empty); if (!string.IsNullOrEmpty(STOCK_NO)) { DataTable dt = oDB.GetStockInPrint(STOCK_NO); if (dt.Rows.Count > 0) { PrintInventoryDocuments(dt, STOCK_NO); } else { MessageBox.Show("输入单据号错误"); } } }