Beispiel #1
0
        private void ultraGrid1_DoubleClick(object sender, EventArgs e)
        {
            if (m_parentForm == "TrackPrdict")
            {
                WeightPlan          pi = (WeightPlan)this.Owner;
                System.Data.DataRow dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;

                default:
                    break;
                }
            }

            if (m_parentForm == "TrackWeight")
            {
                TrackWeight         pi = (TrackWeight)this.Owner;
                System.Data.DataRow dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;

                default:
                    break;
                }
            }

            if (m_parentForm == "HanderFirstWeightData")
            {
                HanderFirstWeightData pi = (HanderFirstWeightData)this.Owner;
                System.Data.DataRow   dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }

            if (m_parentForm == "HanderHistoryWeightData")
            {
                HanderHistoryWeightData pi = (HanderHistoryWeightData)this.Owner;
                System.Data.DataRow     dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }
            this.Close();
        }
Beispiel #2
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            //strReturnCode = tbMaterialCode.Text.Trim();
            //strReturnName = tbMaterialName.Text.Trim();
            //if (ultraGrid1.Rows.Count > 0 && ultraGrid1.ActiveRow != null)
            //{
            //    strReturnHelpCode = ultraGrid1.ActiveRow.Cells["FS_HELPCODE"].Text.Trim();
            //}
            //CarWeightPrediction pi = (CarWeightPrediction)this.Owner;
            //if (ultraGrid1.ActiveRow == null || ultraGrid1.ActiveRow.Index < 0)
            //    return;
            //switch (m_DataType)
            //{
            //    case "Material":
            //        pi.cbWLMC.Text = strReturnName;
            //        break;
            //    case "Receiver":
            //        pi.cbSHDW.Text = strReturnName;
            //        break;
            //    case "Sender":
            //        pi.cbFHDW.Text = strReturnName;
            //        break;
            //    case "Transport":
            //        pi.cbCYDW.Text = strReturnName;
            //        break;
            //    default:
            //        break;
            //}
            //this.DialogResult = DialogResult.OK;
            //this.Close();
            if (m_parentForm == "TrackPrdict")
            {
                WeightPlan          pi = (WeightPlan)this.Owner;
                System.Data.DataRow dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }

            if (m_parentForm == "TrackWeight")
            {
                TrackWeight         pi = (TrackWeight)this.Owner;
                System.Data.DataRow dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }

            if (m_parentForm == "HanderFirstWeightData")
            {
                HanderFirstWeightData pi = (HanderFirstWeightData)this.Owner;
                System.Data.DataRow   dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }

            if (m_parentForm == "HanderHistoryWeightData")
            {
                HanderHistoryWeightData pi = (HanderHistoryWeightData)this.Owner;
                System.Data.DataRow     dr;
                switch (m_DataType)
                {
                case "Material":
                    dr = pi.tempMaterial.NewRow();
                    dr["fs_materialname"] = this.tbMaterialName.Text.Trim();
                    dr["FS_MATERIALNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempMaterial.Rows.Add(dr.ItemArray);
                    pi.cbMaterial.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Receiver":
                    dr                = pi.tempReveiver.NewRow();
                    dr["fs_memo"]     = this.tbMaterialName.Text.Trim();
                    dr["FS_Receiver"] = this.tbMaterialCode.Text.Trim();
                    pi.tempReveiver.Rows.Add(dr.ItemArray);
                    pi.cbReceiver.Text = this.tbMaterialName.Text.Trim();
                    break;

                case "Sender":
                    dr = pi.tempSender.NewRow();
                    dr["FS_SUPPLIERNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_SUPPLIER"]     = this.tbMaterialCode.Text.Trim();
                    pi.tempSender.Rows.Add(dr.ItemArray);
                    pi.cbSender.Text = this.tbMaterialName.Text.Trim();
                    break;

                //case "Provider":
                //    dr = pi.tempProvider.NewRow();
                //    dr["FS_PROVIDERNAME"] = this.tbMaterialName.Text.Trim();
                //    dr["FS_PROVIDER"] = this.tbMaterialCode.Text.Trim();
                //    pi.tempProvider.Rows.Add(dr.ItemArray);
                //    pi.cbProvider.Text = this.tbMaterialName.Text.Trim();
                //    break;
                case "Transport":
                    dr = pi.tempTrans.NewRow();
                    dr["FS_TRANSNAME"] = this.tbMaterialName.Text.Trim();
                    dr["FS_TRANSNO"]   = this.tbMaterialCode.Text.Trim();
                    pi.tempTrans.Rows.Add(dr.ItemArray);
                    pi.cbTrans.Text = this.tbMaterialName.Text.Trim();
                    break;


                default:
                    break;
                }
            }
            this.Close();
        }