예제 #1
0
        private static void UPDATE_WIPSTATION(string STOCK_NO)
        {
            DataTable dt = OperateDB.Get_Wip_Tracking("STORENUMBER", STOCK_NO, "DISTINCT WOID");

            foreach (DataRow dr in dt.Rows)
            {
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("WOID", dr["WOID"].ToString());
                dic.Add("STORENUMBER", STOCK_NO);
                dic.Add("WIPSTATION", OperateDB.GetWOLoc(dr["WOID"].ToString()));
                List <string> ListFields = new List <string>();
                ListFields = new List <string>();
                ListFields.Add("WOID");
                ListFields.Add("STORENUMBER");
                OperateDB.UPDATE_WIP_TRACKING(dic, ListFields);
            }
        }
예제 #2
0
        private void UpLoad_System()
        {
            if (listBoxEsn.Items.Count == 0 && listBoxTray.Items.Count == 0 && listBoxCarton.Items.Count == 0 && listBoxPallet.Items.Count == 0)
            {
                SendMsg(mLogMsgType.Error, "No Data Upload");
                return;
            }
            else
            {
                SendMsg(mLogMsgType.Normal, "更改入库单号");
                #region 更改入库单号
                StockNo = OperateDB.GetStockinNumber();
                Dictionary <string, object> mst = null;
                List <string> Fields            = null;
                string        _StrErr           = string.Empty;
                if (listBoxEsn.Items.Count > 0)
                {
                    Fields = new List <string>();
                    Fields.Add("ESN");
                    foreach (string ItemStr in listBoxEsn.Items)
                    {
                        mst = new Dictionary <string, object>();
                        mst.Add("STORENUMBER", StockNo);
                        mst.Add("ESN", ItemStr);
                        _StrErr = OperateDB.UPDATE_WIP_TRACKING(mst, Fields);
                        if (_StrErr != "OK")
                        {
                            SendMsg(mLogMsgType.Error, "UPDATE STOCKNO Faill: " + _StrErr);
                            return;
                        }
                    }
                }
                if (listBoxTray.Items.Count > 0)
                {
                    Fields = new List <string>();
                    Fields.Add("TRAYNO");
                    foreach (string ItemStr in listBoxTray.Items)
                    {
                        mst = new Dictionary <string, object>();
                        mst.Add("STORENUMBER", StockNo);
                        mst.Add("TRAYNO", ItemStr);
                        _StrErr = OperateDB.UPDATE_WIP_TRACKING(mst, Fields);
                        if (_StrErr != "OK")
                        {
                            SendMsg(mLogMsgType.Error, "UPDATE STOCKNO Faill: " + _StrErr);
                            return;
                        }
                    }
                }
                if (listBoxCarton.Items.Count > 0)
                {
                    Fields = new List <string>();
                    Fields.Add("CARTONNUMBER");
                    foreach (string ItemStr in listBoxCarton.Items)
                    {
                        mst = new Dictionary <string, object>();
                        mst.Add("STORENUMBER", StockNo);
                        mst.Add("CARTONNUMBER", ItemStr);
                        _StrErr = OperateDB.UPDATE_WIP_TRACKING(mst, Fields);
                        if (_StrErr != "OK")
                        {
                            SendMsg(mLogMsgType.Error, "UPDATE STOCKNO Faill: " + _StrErr);
                            return;
                        }
                    }
                }
                if (listBoxPallet.Items.Count > 0)
                {
                    Fields = new List <string>();
                    Fields.Add("PALLETNUMBER");
                    foreach (string ItemStr in listBoxPallet.Items)
                    {
                        mst = new Dictionary <string, object>();
                        mst.Add("STORENUMBER", StockNo);
                        mst.Add("PALLETNUMBER", ItemStr);
                        _StrErr = OperateDB.UPDATE_WIP_TRACKING(mst, Fields);
                        if (_StrErr != "OK")
                        {
                            SendMsg(mLogMsgType.Error, "UPDATE STOCKNO Faill: " + _StrErr);
                            return;
                        }
                    }
                }
                #endregion

                LabError.Text = string.Empty;
                SendMsg(mLogMsgType.Normal, "执行过站...");
                Call_TEST_STOCKIN(StockNo);
                if (!string.IsNullOrEmpty(LabError.Text))
                {
                    SendMsg(mLogMsgType.Error, "Call_TEST_STOCKIN Error");
                    return;
                }
                SendMsg(mLogMsgType.Normal, "更改WIP STATION");
                UPDATE_WIPSTATION(StockNo);
                SendMsg(mLogMsgType.Normal, "写入数据到仓库...");
                Insert_Z_WIP_TRACKING(StockNo);
                ClearData();
                SendMsg(mLogMsgType.Normal, "数据上传完成....");
                PrintInventoryDocuments(StockNo);
            }
        }