Example #1
0
 public IMTRForm(string[] xml, string skuid, string errinfo, string[] retried, DataTable dtmaterial, string[][] check)
 {
     InitializeComponent();
     Xml     = xml;
     Retried = retried;
     Check   = check;
     dt      = DBhelp.XML2Table(Xml[0]);
     cm      = (CurrencyManager)this.BindingContext[dt];
     textEdit1.DataBindings.Add("Text", dt, "AgencyLeaf");
     textEdit2.DataBindings.Add("Text", dt, "SysLogID");
     textEdit3.DataBindings.Add("Text", dt, "StationID");
     textEdit4.DataBindings.Add("Text", dt, "RoleLeaf");
     textEdit5.DataBindings.Add("Text", dt, "CommunityID");
     textEdit6.DataBindings.Add("Text", dt, "UserCode");
     textEdit7.DataBindings.Add("Text", dt, "ExCode");
     textEdit8.DataBindings.Add("Text", dt, "UserID");
     textEdit9.DataBindings.Add("Text", dt, "PassWord");
     textEdit10.DataBindings.Add("Text", dt, "ItemNumber");
     textEdit11.DataBindings.Add("Text", dt, "StockroomFrom");
     textEdit12.DataBindings.Add("Text", dt, "BinFrom");
     textEdit13.DataBindings.Add("Text", dt, "InventoryCategoryFrom");
     textEdit14.DataBindings.Add("Text", dt, "LotNumberFrom");
     textEdit15.DataBindings.Add("Text", dt, "InventoryQuantity");
     textEdit16.DataBindings.Add("Text", dt, "StockroomTo");
     textEdit17.DataBindings.Add("Text", dt, "BinTo");
     textEdit18.DataBindings.Add("Text", dt, "InventoryCategoryTo");
     textEdit19.DataBindings.Add("Text", dt, "LotNumberTo");
     textEdit20.DataBindings.Add("Text", dt, "DocumentNumber");
     textEdit21.DataBindings.Add("Text", dt, "ItemLotReceiptWindow");
     textEdit22.DataBindings.Add("Text", dt, "LotIdentifier");
     textEdit23.Text = skuid;
     cm.Position     = 0;
     if (dtmaterial != null)
     {
         textEdit24.DataBindings.Add("Text", dtmaterial, "LotNumber");
         textEdit25.DataBindings.Add("Text", dtmaterial, "RecvBatchNo");
         textEdit26.DataBindings.Add("Text", dtmaterial, "MaterialTrackID");
         textEdit27.DataBindings.Add("Text", dtmaterial, "QtyInStore");
         check[0][1] = check[0][2] = dtmaterial.Rows[0]["RecvBatchNo"].ToString();
         check[1][1] = check[1][2] = dtmaterial.Rows[0]["QtyInStore"].ToString();
     }
     else
     {
         this.checkEdit2.Enabled = false;
         this.checkEdit3.Enabled = false;
     }
     if (errinfo.Trim() != "")
     {
         this.textBox1.WordWrap = true;
         this.textBox1.Text     = errinfo;
     }
     if (Retried[0] == "True")
     {
         this.checkEdit1.Checked    = true;
         this.simpleButton1.Enabled = false;
         this.btn_delete.Enabled    = false;
     }
     else
     {
         this.checkEdit1.Checked = false;
     }
 }
Example #2
0
 public PICKForm(string[] xml, string skuid, string errinfo, string[] retried, DataTable dtmaterial, string[][] check)
 {
     InitializeComponent();
     Xml        = xml;
     Retried    = retried;
     Skuid      = skuid;
     dtMaterial = dtmaterial;
     Check      = check;
     dt         = DBhelp.XML2Table(Xml[0]);
     cm         = (CurrencyManager)this.BindingContext[dt];
     textEdit1.DataBindings.Add("Text", dt, "AgencyLeaf");
     textEdit2.DataBindings.Add("Text", dt, "SysLogID");
     textEdit3.DataBindings.Add("Text", dt, "StationID");
     textEdit4.DataBindings.Add("Text", dt, "RoleLeaf");
     textEdit5.DataBindings.Add("Text", dt, "CommunityID");
     textEdit6.DataBindings.Add("Text", dt, "UserCode");
     textEdit7.DataBindings.Add("Text", dt, "ExCode");
     textEdit8.DataBindings.Add("Text", dt, "UserID");
     textEdit9.DataBindings.Add("Text", dt, "PassWord");
     textEdit10.DataBindings.Add("Text", dt, "OrderType");
     textEdit11.DataBindings.Add("Text", dt, "IssueType");
     textEdit12.DataBindings.Add("Text", dt, "OrderNumber");
     textEdit13.DataBindings.Add("Text", dt, "LineNumber");
     textEdit14.DataBindings.Add("Text", dt, "ComponentLineType");
     textEdit15.DataBindings.Add("Text", dt, "PointOfUseID");
     textEdit16.DataBindings.Add("Text", dt, "OperationSequenceNumber");
     textEdit17.DataBindings.Add("Text", dt, "ItemNumber");
     textEdit18.DataBindings.Add("Text", dt, "Stockroom");
     textEdit19.DataBindings.Add("Text", dt, "Bin");
     textEdit20.DataBindings.Add("Text", dt, "LotNumber");
     textEdit21.DataBindings.Add("Text", dt, "IssuedQuantity");
     textEdit22.DataBindings.Add("Text", dt, "ResourceComponentPolicy");
     textEdit23.DataBindings.Add("Text", dt, "QuantityType");
     textEdit24.Text = skuid;
     cm.Position     = 0; // 如 index = 0;
     if (dtmaterial != null)
     {
         textEdit25.DataBindings.Add("Text", dtmaterial, "LotNumber");
         textEdit26.DataBindings.Add("Text", dtmaterial, "RecvBatchNo");
         textEdit27.DataBindings.Add("Text", dtmaterial, "MaterialTrackID");
         textEdit28.DataBindings.Add("Text", dtmaterial, "QtyInStore");
         check[0][1] = check[0][2] = dtmaterial.Rows[0]["RecvBatchNo"].ToString();
         check[1][1] = check[1][2] = dtmaterial.Rows[0]["QtyInStore"].ToString();
     }
     else
     {
         this.checkEdit2.Enabled = false;
         this.checkEdit3.Enabled = false;
     }
     if (errinfo.Trim() != "")
     {
         this.textBox1.WordWrap = true;
         this.textBox1.Text     = errinfo;
     }
     if (Retried[0] == "True")
     {
         this.checkEdit1.Checked    = true;
         this.simpleButton1.Enabled = false;
         this.btn_delete.Enabled    = false;
     }
     else
     {
         this.checkEdit1.Checked = false;
     }
 }
Example #3
0
        //卡片显示
        private void ShowCard()
        {
            if (gridView1.DataRowCount > 0)
            {
                string xml = gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExChangeXML"].ToString();
                gridControl2.DataSource = DBhelp.XML2Table(xml);
                gridControl2.MainView.PopulateColumns();
                //隐藏cardView1无用属性
                for (int i = 0; i < 9; i++)
                {
                    cardView1.Columns[i].Visible = false;
                }
                if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["Properties"].ToString() != "")
                {
                    string    xml2        = gridView1.GetDataRow(gridView1.FocusedRowHandle)["Properties"].ToString();
                    DataTable tempstoredt = DBhelp.XML2Table(xml2);
                    tempstoredt.Columns.Add("LotNumber");
                    tempstoredt.Columns.Add("RecvBatchNo");
                    tempstoredt.Columns.Add("MaterialTrackID");
                    tempstoredt.Columns.Add("QtyInStore");
                    string selectsql3 = null;
                    if (tempstoredt.Columns.Contains("SKUID"))
                    {
                        selectsql3 = string.Format("SKUID = '{0}'", tempstoredt.Rows[0]["SKUID"].ToString());
                    }
                    DataTable tempdt = materialdt.Clone();
                    if (selectsql3 != null)
                    {
                        DataRow[] drArr = materialdt.Select(selectsql3);
                        if (drArr.Length > 0)
                        {
                            tempdt.ImportRow(drArr[0]);
                        }
                    }
                    if (tempdt.Rows.Count > 0)
                    {
                        tempstoredt.Rows[0]["LotNumber"]       = tempdt.Rows[0]["LotNumber"];
                        tempstoredt.Rows[0]["RecvBatchNo"]     = tempdt.Rows[0]["RecvBatchNo"];
                        tempstoredt.Rows[0]["MaterialTrackID"] = tempdt.Rows[0]["MaterialTrackID"];
                        tempstoredt.Rows[0]["QtyInStore"]      = tempdt.Rows[0]["QtyInStore"];
                    }
                    else
                    {
                        tempstoredt.Rows[0]["LotNumber"]       = "无记录";
                        tempstoredt.Rows[0]["RecvBatchNo"]     = "无记录";
                        tempstoredt.Rows[0]["MaterialTrackID"] = "无记录";
                        tempstoredt.Rows[0]["QtyInStore"]      = "无记录";
                    }

                    gridControl3.DataSource = tempstoredt;
                    gridControl3.MainView.PopulateColumns();

                    //隐藏cardView2无用属性
                    if (tempstoredt != null)
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            cardView2.Columns[i].Visible = false;
                        }
                    }
                }

                //错误信息显示
                textBox1.Multiline = true; //多行显示
                textBox1.WordWrap  = true; //文字断行显示
                textBox1.Width     = 15;   //这里设置显示10个文字的宽度像素
                if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrCode"].ToString() != "0" && gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrCode"] != null)
                {
                    this.panelControl2.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(244)))), ((int)(((byte)(191)))));
                    this.textBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(244)))), ((int)(((byte)(191)))));
                    this.textBox1.Text      = gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrCode"].ToString() + ":" + gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrText"].ToString();
                }
                else
                {
                    this.panelControl2.Appearance.BackColor = System.Drawing.Color.White;
                    this.textBox1.BackColor = System.Drawing.Color.White;
                    this.textBox1.Text      = "";
                }
            }
            else
            {
                this.gridControl2.DataSource            = null;
                this.gridControl3.DataSource            = null;
                this.panelControl2.Appearance.BackColor = System.Drawing.Color.White;
                this.textBox1.BackColor = System.Drawing.Color.White;
                this.textBox1.Text      = "";
            }
            cardView1.OptionsBehavior.Editable        = false;
            cardView1.Appearance.FieldValue.BackColor = Color.Transparent;
            cardView1.Appearance.FieldValue.ForeColor = Color.Black;
        }
Example #4
0
        //显示编辑窗口
        public void ShowEditForm()
        {
            string[][] check = new string[3][];
            check[0] = new string[] { "False", "False", "False" };  //是否提交
            check[1] = new string[] { "", "", "" };                 //返回 RecvBatchNo,QtyInStore,QtyLoaded的值
            check[2] = new string[] { "", "", "" };                 //默认值
            string selectsql3  = null;
            long   LogID       = long.Parse(gridView1.GetDataRow(gridView1.FocusedRowHandle)["LogID"].ToString());
            long   LinkedLogID = long.Parse(gridView1.GetDataRow(gridView1.FocusedRowHandle)["LinkedLogID"].ToString());
            string skuid       = "";

            string[]  retried = { gridView1.GetDataRow(gridView1.FocusedRowHandle)["Retried"].ToString(), gridView1.GetDataRow(gridView1.FocusedRowHandle)["Retried"].ToString() };
            string[]  xml     = { gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExChangeXML"].ToString(), gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExChangeXML"].ToString() };
            DataTable tempdt  = DBhelp.XML2Table(xml[0]);

            if (xml[0] != "")
            {
                XmlDocument xdoc = new XmlDocument();
                if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["Properties"].ToString().Trim() != "")
                {
                    xdoc.LoadXml(gridView1.GetDataRow(gridView1.FocusedRowHandle)["Properties"].ToString());
                    if (xdoc.FirstChild.SelectSingleNode("SKUID") != null)
                    {
                        skuid      = xdoc.FirstChild.SelectSingleNode("SKUID").InnerText;
                        selectsql3 = string.Format("SKUID = '{0}'", skuid);
                    }
                }
                DialogResult dia     = new DialogResult();
                DataTable    dtNew3  = materialdt.Clone();
                string       errinfo = gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrCode"].ToString() + ":" + gridView1.GetDataRow(gridView1.FocusedRowHandle)["ErrText"].ToString();
                if (selectsql3 != null)
                {
                    DataRow[] drArr3 = materialdt.Select(selectsql3);
                    if (drArr3.Length > 0)
                    {
                        dtNew3.ImportRow(drArr3[0]);
                    }
                    if (dtNew3.Rows.Count <= 0)
                    {
                        dtNew3 = null;
                    }
                }
                if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExCode"].ToString() == "IMTR01")
                {
                    IMTRForm im = null;
                    im  = new IMTRForm(xml, skuid, errinfo, retried, dtNew3, check);
                    dia = im.ShowDialog();
                }
                else if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExCode"].ToString() == "PORV01")
                {
                    PORVForm po = null;
                    po  = new PORVForm(xml, skuid, errinfo, retried, dtNew3, check);
                    dia = po.ShowDialog();
                }
                else if (gridView1.GetDataRow(gridView1.FocusedRowHandle)["ExCode"].ToString() == "PICK08")
                {
                    PICKForm pi = null;
                    pi  = new PICKForm(xml, skuid, errinfo, retried, dtNew3, check);
                    dia = pi.ShowDialog();
                }
                if (dia == DialogResult.OK)
                {
                    string         sql   = "update IRAP..stb_Log_WebServiceShuttling set ExChangeXML = @ExChangeXML where LogID = @LogID and PartitioningKey ='600100000'";
                    SqlParameter[] paras = new SqlParameter[2];
                    if (GetLastLogID(LinkedLogID) != null)
                    {
                        long LastLogID = (long)GetLastLogID(LinkedLogID);
                        WriteLog.Instance.WriteBeginSplitter("开始编辑记录LogID =" + LastLogID.ToString() + string.Format(";Retried = {0}", retried[0]));
                        paras[0] = new SqlParameter("@ExChangeXML", xml[0]);
                        paras[1] = new SqlParameter("@LogID", LastLogID);
                        int i = 2;
                        try
                        {
                            i = DBhelp.ExecuteSQL(sql, paras);
                        }
                        catch (SqlException err)
                        {
                            WriteLog.Instance.Write(err.Message, "更改ExChangeXml失败");
                            WriteLog.Instance.Write(xml[1], "更改前的ExChangeXml");
                            WriteLog.Instance.Write(xml[0], "更改后的ExChangeXml");
                            MessageBox.Show(err.Message);
                        }
                        if (i == 0)
                        {
                            WriteLog.Instance.Write("未找到记录:", "更改ExChangeXml失败");
                            WriteLog.Instance.Write(xml[1], "更改前的ExChangeXml");
                            WriteLog.Instance.Write(xml[0], "更改后的ExChangeXml");
                            MessageBox.Show("保存失败");
                        }
                        else if (i == 1)
                        {
                            WriteLog.Instance.Write("成功", "更改ExChangeXml成功");
                            WriteLog.Instance.Write(xml[1], "更改前的ExChangeXml");
                            WriteLog.Instance.Write(xml[0], "更改后的ExChangeXml");
                            string         name   = "IRAP..ssp_BackgroundJob_WSRetry";
                            SqlParameter[] paras3 = new SqlParameter[5];
                            paras3[0]           = new SqlParameter("@SysLogID", 1);
                            paras3[1]           = new SqlParameter("@CommunityID", 60010);
                            paras3[2]           = new SqlParameter("@WSSLogID", LastLogID);
                            paras3[3]           = new SqlParameter("@ErrCode", SqlDbType.Int, 4);
                            paras3[3].Direction = ParameterDirection.Output;
                            paras3[4]           = new SqlParameter("@ErrText", SqlDbType.NVarChar, 400);
                            paras3[4].Direction = ParameterDirection.Output;
                            int j = 2;
                            try
                            {
                                j = DBhelp.ExecuteProc(name, paras3);
                            }
                            catch (SqlException err)
                            {
                                MessageBox.Show(err.Message);
                                WriteLog.Instance.Write(err.Message, "WSRrtry执行失败");
                            }
                            if (j == -1)
                            {
                                WriteLog.Instance.Write(string.Format("ErrCode = {0},{1}", paras3[3].Value.ToString(), paras3[4].Value.ToString()), "WSRetry执行成功");
                                MessageBox.Show(string.Format("ErrCode = {0},{1}", paras3[3].Value.ToString(), paras3[4].Value.ToString()));

                                // 如果是 PORV01 交易成功,则需要将 utb_MaterialStore 表中的 RecvBatchNo 更新为四班中生成的 RecvBatchNo
                                // 代码待定

                                if (check[0][0] == "True")
                                {
                                    int            flag   = 2;
                                    string         sql2   = "update IRAPRIMCS..utb_MaterialStore set RecvBatchNo = @RecvBatchNo where SKUID =@SKUID";
                                    SqlParameter[] paras2 = new SqlParameter[2];
                                    paras2[0] = new SqlParameter("@RecvBatchNo", check[0][1]);
                                    paras2[1] = new SqlParameter("@SKUID", skuid);
                                    try
                                    {
                                        flag = DBhelp.ExecuteSQL(sql2, paras2);
                                        if (flag == 0)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改RecvbatcNo = {0}为RecvBatchNo = {1}", check[0][2], check[0][1]), "更改RecvBatchNo失败,未找到记录");
                                        }
                                        else if (flag == 1)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改RecvbatcNo = {0}为RecvBatchNo = {1}", check[0][2], check[0][1]), "更改RecvBatchNo成功");
                                        }
                                    }
                                    catch (SqlException err)
                                    {
                                        MessageBox.Show(err.Message);
                                        WriteLog.Instance.Write(string.Format("更改RecvbatcNo = {0}更改RecvbatcNo = {1}", check[0][2], check[0][1]), "更改更改RecvbatcNo失败" + err.Message);
                                    }
                                }
                                if (check[1][0] == "True")
                                {
                                    int            flag   = 2;
                                    string         sql2   = "update IRAPRIMCS..utb_MaterialStore set QtyInStore = @QtyInStore where SKUID =@SKUID";
                                    SqlParameter[] paras2 = new SqlParameter[2];
                                    paras2[0] = new SqlParameter("@QtyInStore", check[1][1]);
                                    paras2[1] = new SqlParameter("@SKUID", skuid);
                                    try
                                    {
                                        flag = DBhelp.ExecuteSQL(sql2, paras2);
                                        if (flag == 0)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改QtyInStore = {0}为QtyInStore = {1}", check[1][2], check[1][1]), "更改QtyInStore失败,未找到记录");
                                        }
                                        else if (flag == 1)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改QtyInStore = {0}为QtyInStore = {1}", check[1][2], check[1][1]), "更改QtyInStore成功");
                                        }
                                    }
                                    catch (SqlException err)
                                    {
                                        MessageBox.Show(err.Message);
                                        WriteLog.Instance.Write(string.Format("更改QtyInStore = {0}更改QtyInStore = {1}", check[1][2], check[1][1]), "更改更改QtyInStore失败" + err.Message);
                                    }
                                }
                                if (check[2][1] != check[2][2] && check[2][0] == "True")
                                {
                                    int            flag   = 2;
                                    string         sql2   = "update IRAPMES..RSFact_PWOMaterialTrack set QtyLoaded = @QtyLoaded where WFInstanceID in (SELECT WFInstanceID from IRAPMES..AuxFact_PWOIssuing where MONumber =@MONumber and MOLineNo =@MOLineNo) and SKUID =@SKUID";
                                    SqlParameter[] paras2 = new SqlParameter[4];
                                    paras2[0] = new SqlParameter("@QtyLoaded", check[2][1]);
                                    paras2[1] = new SqlParameter("@MONumber", tempdt.Rows[0]["OrderNumber"].ToString());
                                    paras2[2] = new SqlParameter("@MOLineNo", tempdt.Rows[0]["LineNumber"].ToString());
                                    paras2[3] = new SqlParameter("@SKUID", skuid);
                                    try
                                    {
                                        flag = DBhelp.ExecuteSQL(sql2, paras2);
                                        if (flag == 0)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改QtyLoaded = {0}为QtyLoaded = {1}", check[2][2], check[2][1]), "更改QtyLoaded失败,未找到记录");
                                        }
                                        else if (flag == 1)
                                        {
                                            WriteLog.Instance.Write(string.Format("更改QtyLoaded = {0}为QtyLoaded = {1}", check[2][2], check[2][1]), "更改QtyLoaded成功");
                                        }
                                    }
                                    catch (Exception err)
                                    {
                                        MessageBox.Show(err.Message);
                                        WriteLog.Instance.Write(string.Format("更改QtyLoaded = {0}为QtyLoaded = {1}", check[2][2], check[2][1]), "更改QtyLoaded失败" + err.Message);
                                    }
                                }
                                WriteLog.Instance.WriteEndSplitter("结束编辑记录");
                                RefreshData();
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("该LinkedLogID下无Retried=0的记录,请刷新数据");
                    }
                }
                else if (dia == DialogResult.Abort)
                {
                    string         sql   = "update IRAP..stb_Log_WebServiceShuttling set Retried = @Retried where LogID = @LogID";
                    SqlParameter[] paras = new SqlParameter[2];
                    if (GetLastLogID(LinkedLogID) != null)
                    {
                        long LastLogID = (long)(LogID);
                        paras[0] = new SqlParameter("@Retried", 1);
                        paras[1] = new SqlParameter("@LogID", LastLogID);
                        try
                        {
                            if (DBhelp.ExecuteSQL(sql, paras) == 1)
                            {
                                MessageBox.Show("删除成功");
                                WriteLog.Instance.WriteBeginSplitter("开始删除记录LogID =" + LastLogID.ToString() + string.Format(";Retried = {0}", retried[0]));
                                WriteLog.Instance.Write(xml[1], "删除记录成功");
                                WriteLog.Instance.WriteEndSplitter("结束删除记录");
                                RefreshData();
                            }
                        }
                        catch (SqlException err)
                        {
                            MessageBox.Show("删除失败:" + err.Message);
                            WriteLog.Instance.WriteBeginSplitter("开始删除记录LogID =" + LastLogID.ToString() + string.Format(";Retried = {0}", retried[0]));
                            WriteLog.Instance.Write(err.Message, "删除记录失败");
                            WriteLog.Instance.Write(xml[1], "删除记录失败");
                            WriteLog.Instance.WriteEndSplitter("结束删除记录");
                        }
                    }
                    else
                    {
                        MessageBox.Show("该LinkedLogID下无Retried=0的记录,请刷新数据");
                    }
                }
            }
        }
Example #5
0
        //获取解析的XML数据
        private void SetDTRow(long LogID, int mode)
        {
            DataRow   dr     = maindt.Rows.Find(LogID);
            DataTable tempdt = DBhelp.XML2Table(dr["ExChangeXML"].ToString());

            if (dr["Properties"].ToString() != "")
            {
                DataTable tempdt2 = DBhelp.XML2Table(dr["Properties"].ToString());
                if (tempdt2.Columns.Contains("SKUID"))
                {
                    dr["SKUID"] = tempdt2.Rows[0]["SKUID"];
                }
            }
            if (dr["ExCode"].ToString() == "PICK08" || dr["ExCode"].ToString() == "提料")
            {
                dr["ExCode"]      = "PICK08";
                dr["ItemNumber"]  = tempdt.Rows[0]["ItemNumber"];
                dr["LotNumber"]   = tempdt.Rows[0]["LotNumber"];
                dr["BinFrom"]     = tempdt.Rows[0]["Bin"];
                dr["Quantity"]    = tempdt.Rows[0]["IssuedQuantity"];
                dr["OrderNumber"] = tempdt.Rows[0]["OrderNumber"];
                dr["OLineNO"]     = tempdt.Rows[0]["LineNumber"];
                if (mode == 2)
                {
                    gridView1.SetFocusedRowCellValue("ItemNumber", tempdt.Rows[0]["ItemNumber"]);
                    gridView1.SetFocusedRowCellValue("LotNumber", tempdt.Rows[0]["LotNumber"]);
                    gridView1.SetFocusedRowCellValue("BinFrom", tempdt.Rows[0]["Bin"]);
                    gridView1.SetFocusedRowCellValue("Quantity", tempdt.Rows[0]["IssuedQuantity"]);
                }
            }
            else if (dr["ExCode"].ToString() == "IMTR01" || dr["ExCode"].ToString() == "移库")
            {
                dr["ExCode"]     = "IMTR01";
                dr["ItemNumber"] = tempdt.Rows[0]["ItemNumber"];
                dr["LotNumber"]  = tempdt.Rows[0]["LotNumberFrom"];
                dr["BinFrom"]    = tempdt.Rows[0]["BinFrom"];
                dr["BinTo"]      = tempdt.Rows[0]["BinTo"];
                dr["Quantity"]   = tempdt.Rows[0]["InventoryQuantity"];
                if (mode == 2)
                {
                    gridView1.SetFocusedRowCellValue("ItemNumber", tempdt.Rows[0]["ItemNumber"]);
                    gridView1.SetFocusedRowCellValue("LotNumber", tempdt.Rows[0]["LotNumberFrom"]);
                    gridView1.SetFocusedRowCellValue("BinFrom", tempdt.Rows[0]["BinFrom"]);
                    gridView1.SetFocusedRowCellValue("BinTo", tempdt.Rows[0]["BinTo"]);
                    gridView1.SetFocusedRowCellValue("Quantity", tempdt.Rows[0]["InventoryQuantity"]);
                }
            }
            else if (dr["ExCode"].ToString() == "PORV01" || dr["ExCode"].ToString() == "入库")
            {
                dr["ExCode"]      = "PORV01";
                dr["ItemNumber"]  = tempdt.Rows[0]["ItemNumber"];
                dr["LotNumber"]   = tempdt.Rows[0]["LotNumberDefault"];
                dr["BinTo"]       = tempdt.Rows[0]["Bin1"];
                dr["Quantity"]    = tempdt.Rows[0]["ReceiptQuantityMove1"];
                dr["OrderNumber"] = tempdt.Rows[0]["PONumber"];
                dr["OLineNO"]     = tempdt.Rows[0]["POLineNumber"];
                if (mode == 2)
                {
                    gridView1.SetFocusedRowCellValue("ItemNumber", tempdt.Rows[0]["ItemNumber"]);
                    gridView1.SetFocusedRowCellValue("LotNumber", tempdt.Rows[0]["LotNumberDefault"]);
                    gridView1.SetFocusedRowCellValue("BinTo", tempdt.Rows[0]["Bin1"]);
                    gridView1.SetFocusedRowCellValue("Quantity", tempdt.Rows[0]["ReceiptQuantityMove1"]);
                }
            }
            else if (dr["ExCode"].ToString() == "MORV00")
            {
                dr["ExCode"]      = "MORV00";
                dr["ItemNumber"]  = tempdt.Rows[0]["ItemNumber"];
                dr["LotNumber"]   = tempdt.Rows[0]["LotNumber"];
                dr["BinFrom"]     = tempdt.Rows[0]["Bin1"];
                dr["Quantity"]    = tempdt.Rows[0]["ReceiptQuantity"];
                dr["OrderNumber"] = tempdt.Rows[0]["MONumber"];
                dr["OLineNO"]     = tempdt.Rows[0]["MOLineNumber"];
            }
            else if (dr["ExCode"].ToString() == "INVA01")
            {
                dr["ExCode"]     = "INVA01";
                dr["ItemNumber"] = tempdt.Rows[0]["ItemNumber"];
                dr["LotNumber"]  = tempdt.Rows[0]["LotNumber"];
                dr["BinTo"]      = tempdt.Rows[0]["Bin"];
                dr["Quantity"]   = tempdt.Rows[0]["AdjustQuantity"];
            }
            tempdt.Clear();
        }
Example #6
0
 public PORVForm(string[] xml, string skuid, string errinfo, string[] retried, DataTable dtmaterial, string[][] check)
 {
     InitializeComponent();
     Xml     = xml;
     Retried = retried;
     Check   = check;
     dt      = DBhelp.XML2Table(Xml[0]);
     cm      = (CurrencyManager)this.BindingContext[dt];
     textEdit1.DataBindings.Add("Text", dt, "AgencyLeaf");
     textEdit2.DataBindings.Add("Text", dt, "SysLogID");
     textEdit3.DataBindings.Add("Text", dt, "StationID");
     textEdit4.DataBindings.Add("Text", dt, "RoleLeaf");
     textEdit5.DataBindings.Add("Text", dt, "CommunityID");
     textEdit6.DataBindings.Add("Text", dt, "UserCode");
     textEdit7.DataBindings.Add("Text", dt, "ExCode");
     textEdit8.DataBindings.Add("Text", dt, "UserID");
     textEdit9.DataBindings.Add("Text", dt, "PassWord");
     textEdit10.DataBindings.Add("Text", dt, "PONumber");
     textEdit11.DataBindings.Add("Text", dt, "POLineNumber");
     textEdit12.DataBindings.Add("Text", dt, "POReceiptActionType");
     textEdit13.DataBindings.Add("Text", dt, "POLineUM");
     textEdit14.DataBindings.Add("Text", dt, "ReceiptQuantityMove1");
     textEdit15.DataBindings.Add("Text", dt, "Stockroom1");
     textEdit16.DataBindings.Add("Text", dt, "Bin1");
     textEdit17.DataBindings.Add("Text", dt, "InventoryCategory1");
     textEdit18.DataBindings.Add("Text", dt, "POLineType");
     textEdit19.DataBindings.Add("Text", dt, "ItemNumber");
     textEdit20.DataBindings.Add("Text", dt, "NewLot");
     textEdit21.DataBindings.Add("Text", dt, "LotNumberAssignmentPolicy");
     textEdit22.DataBindings.Add("Text", dt, "LotNumberDefault");
     if (dt.Columns.Contains("VendorLotNumber"))
     {
         textEdit23.DataBindings.Add("Text", dt, "VendorLotNumber");
     }
     else
     {
         textEdit23.Text = "";
     }
     if (dt.Columns.Contains("FirstReceiptDate"))
     {
         textEdit24.DataBindings.Add("Text", dt, "FirstReceiptDate");
     }
     else
     {
         textEdit24.Text = "";
     }
     textEdit25.DataBindings.Add("Text", dt, "PromisedDate");
     textEdit26.DataBindings.Add("Text", dt, "POReceiptDate");
     textEdit27.Text = skuid;
     cm.Position     = 0; // 如 index = 0;
     if (dtmaterial != null)
     {
         textEdit28.DataBindings.Add("Text", dtmaterial, "LotNumber");
         textEdit29.DataBindings.Add("Text", dtmaterial, "RecvBatchNo");
         textEdit30.DataBindings.Add("Text", dtmaterial, "MaterialTrackID");
         textEdit31.DataBindings.Add("Text", dtmaterial, "QtyInStore");
         check[0][1] = check[0][2] = dtmaterial.Rows[0]["RecvBatchNo"].ToString();
         check[1][1] = check[1][2] = dtmaterial.Rows[0]["QtyInStore"].ToString();
     }
     else
     {
         this.checkEdit2.Enabled = false;
         this.checkEdit3.Enabled = false;
     }
     if (errinfo.Trim() != "")
     {
         this.textBox1.WordWrap = true;
         this.textBox1.Text     = errinfo;
     }
     if (Retried[0] == "True")
     {
         this.checkEdit1.Checked    = true;
         this.simpleButton1.Enabled = false;
         this.btn_delete.Enabled    = false;
     }
     else
     {
         this.checkEdit1.Checked = false;
     }
 }