Exemplo n.º 1
0
        private void InputCutting_Load(object sender, EventArgs e)
        {
            seticon_forbutton();
            List <object[]> dtlot = new List <object[]>();
            MainMenu        flot  = new MainMenu();

            if (Properties.Settings.Default.module.Equals("CUTTING"))
            {
                dtlot                    = flot.get_data_table_string_exclude("tbreceiving", "tbcuttingdetails", "intlotcode");
                btnnew.Text              = "Create Cutting";
                btnopen.Text             = "Open Cutting";
                groupproductname.Visible = false;
            }
            else if (Properties.Settings.Default.module.Equals("RETOUCHING"))
            {
                dtlot                    = flot.get_data_table_string_exclude("tbcuttingdetails", "tbretouchingdetails", "intlotcode");
                btnnew.Text              = "Create Retouching";
                btnopen.Text             = "Open Retouching";
                groupproductname.Visible = true;

                List <object[]> data = new List <object[]>();
                data = flot.get_data_table_string("tbproductsetup", "", "");
                if (data.Count > 0)
                {
                    cbproductname.Items.Clear();
                    for (int i = 0; i < data.Count; i++)
                    {
                        cbproductname.Items.Add(data[i][5].ToString().ToUpper());
                    }

                    if (data.Count == 1)
                    {
                        cbproductname.Text = data[0][5].ToString().ToUpper();
                    }
                }
            }

            String previntlotcode = "";

            if (dtlot.Count > 0)
            {
                for (int i = 0; i < dtlot.Count; i++)
                {
                    if (!previntlotcode.Equals(dtlot[i][1].ToString()))
                    {
                        cbexistinglot.Items.Add(dtlot[i][1]);
                    }
                    previntlotcode = dtlot[i][1].ToString();
                }
            }

            previntlotcode = "";
            List <object[]> dtplot = new List <object[]>();
            MainMenu        frm    = new MainMenu();

            if (Properties.Settings.Default.module.Equals("CUTTING"))
            {
                dtplot = frm.get_data_table_string_exclude("tbcuttingdetails", "tbretouchingdetails", "intlotcode");
                //dtplot = frm.get_data_table_daysearlier(14, "tbcuttingdetails");
            }
            else if (Properties.Settings.Default.module.Equals("RETOUCHING"))
            {
                //dtplot = frm.get_data_table_string_exclude("tbretouchingdetails", "tbpacking", "intlotcode");
                dtplot = frm.get_data_table_daysearlier(7, "tbretouchingdetails");
            }

            String value = "";

            if (dtplot.Count > 0)
            {
                for (int i = 0; i < dtplot.Count; i++)
                {
                    value = dtplot[i][1].ToString();
                    if (!cbprevlotcode.Items.Contains(value))
                    {
                        cbprevlotcode.Items.Add(value);
                    }
                }
            }
        }