Epicor_Integration.Item_Master.TS_Click C# (CSharp) Méthode

TS_Click() public méthode

public TS_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void
        void TS_Click(object sender, EventArgs e)
        {
            trackserial.CheckedChanged -= trackserial_CheckedChanged;

            ToolStripMenuItem TS = (ToolStripMenuItem)sender;

            PartData Pdata = Templates.ParseItemTemplate(TS.Name);

            type_cbo.SelectedValue = Pdata.PMT;

            //uom_cbo.SelectedValue = Pdata.UOM_Class;

            qtybearing.Checked = Pdata.QtyBearing;

            phantom_chk.Checked = Pdata.Phantom;

            userevision.Checked = Pdata.UseRevision;

            group_cbo.Text = Pdata.PartGroup;

            class_cbo.Text = Pdata.PartClass;

            plant_cbo.Text = Pdata.PartPlant;

            planner_cbo.Text = Pdata.Planner;

            DataTable DT = new DataTable();

            if (whse_cbo.DataSource != null)
            {
                DT = (DataTable)whse_cbo.DataSource;
            }
            else
            {
                DT.Columns.Add(new DataColumn("WarehouseCode", typeof(System.String)));

                DT.Columns.Add(new DataColumn("WarehouseDescription", typeof(System.String)));

                DT.Columns.Add(new DataColumn("Company", typeof(System.String)));

                DT.Columns.Add(new DataColumn("Plant", typeof(System.String)));

                DT.Columns.Add(new DataColumn("PartNum", typeof(System.String)));
            }

            for (int i = 0; i < Pdata.PlantWhse.Count ; i++)
            {
                bool toAdd = true;

                string Wh = Pdata.PlantWhse[i];

                string WhC = Pdata.PlantWhse_Code[i];

                foreach (DataRow Dr in DT.Rows)
                {
                    if (Dr["WarehouseDescription"].ToString() == Wh)
                    {
                        toAdd = false;

                        break;
                    }
                }

                if (toAdd)
                {
                    DataRow DR = DT.NewRow();

                    DR["WarehouseCode"] = WhC;

                    DR["WarehouseDescription"] = Wh;

                    DR["Company"] = "NORCO";

                    DR["PartNum"] = Partnumber_txt.Text;

                    DR["Plant"] = Pdata.PartPlant;

                    DT.Rows.Add(DR);
                }

                whse_cbo.DataSource = DT;

                whse_cbo.DisplayMember = "WarehouseDescription";

                whse_cbo.ValueMember = "WarehouseCode";
            }

            if (Pdata.TrackSerial)
            {
                trackserial.Checked = Pdata.TrackSerial;

                SerialPrefix = Pdata.TrackSerial_Mask;

                //SerialMask_Master SM = new SerialMask_Master(Pdata.TrackSerial_Mask);

                //SM.ShowDialog();
            }

            trackserial.CheckedChanged += trackserial_CheckedChanged;
        }