Пример #1
0
        private void InputPacking_Load(object sender, EventArgs e)
        {
            seticon_forbutton();
            String txt  = "";
            Int32  xPos = 173;
            Int32  yPos = 135;//66;



            //Product Type
            MainMenu frm = new MainMenu();
            //get data from table
            List <object[]> data = new List <object[]>();

            //species
            data = frm.get_data_table_string("tbproductsetup", "", "");
            string producttype = "";

            cbproducttype.Items.Clear();
            if (data.Count > 0)
            {
                for (int i = 0; i < data.Count; i++)
                {
                    producttype = data[i][5].ToString();
                    cbproducttype.Items.Add(producttype);
                }
                if (data.Count == 1)
                {
                    cbproducttype.Text = producttype.Trim();
                }
            }



            data = frm.get_data_table_string("tbgrade", "module", "retouching");

            frmRetouching fcut = new frmRetouching();

            if (data.Count > 0)
            {
                for (int i = 0; i < data.Count; i++)
                {
                    txt = data[i][1].ToString();
                    tombolgrade(100, 60, 24, xPos, yPos, txt, Color.WhiteSmoke);
                    xPos = xPos + 104;
                    //tombolgrade(Int32 width, Int32 height, Int32 fontsize, Int32 xPos, Int32 yPos, String txt, Color btncolor);
                }
            }


            txt  = "";
            xPos = 173;
            yPos = 205;   //135;

            //get data from table
            data = frm.get_data_table_string("tbpackingsize", "", "");

            if (data.Count > 0)
            {
                for (int i = 0; i < data.Count; i++)
                {
                    txt = data[i][1].ToString();
                    tombolpackingsize(160, 60, 24, xPos, yPos, txt, Color.WhiteSmoke);
                    xPos = xPos + 164;
                    //tombolgrade(Int32 width, Int32 height, Int32 fontsize, Int32 xPos, Int32 yPos, String txt, Color btncolor);
                }
            }



//Existing packing


            List <object[]> dtlot = new List <object[]>();
            MainMenu        flot  = new MainMenu();

            dtlot = flot.get_data_listpacking_daysearlier(7);
            String previntlotcode = "";

            if (dtlot.Count > 0)
            {
                for (int i = 0; i < dtlot.Count; i++)
                {
                    if (!previntlotcode.Equals(dtlot[i][2].ToString()))
                    {
                        cbexistingpacking.Items.Add(dtlot[i][2]);
                    }
                    previntlotcode = dtlot[i][2].ToString();
                }
            }
        }
Пример #2
0
        void retouchingentry(object sender, EventArgs e, String intlot)
        {
            String intlotcode = "";
            String rtcdate    = "";
            String supplier   = "";
            String tipe       = "";
            String species    = "";

            //var current = sender as Button;
            //this.Hide();
            //var frmCutting = new frmCutting();
            //frmCutting.Closed += (s, args) => this.Close();

            //rcv date
            DateTime dt = DateTime.Now;

            rtcdate = dt.ToString("yyyy-MM-dd hh:mm:ss");

            // supplier
            intlotcode = intlot;


            List <object[]> data = new List <object[]>();
            MainMenu        frm  = new MainMenu();

            data = frm.get_data_table_string("tbreceiving", "intlotcode", intlotcode);
            if (data.Count > 0)
            {
                tipe     = data[0][3].ToString();
                species  = data[0][2].ToString();
                supplier = data[0][5].ToString();
            }

            //get productname
            String          productname = "";
            List <object[]> data1       = new List <object[]>();

            data1 = frm.get_data_table_string("tbretouching", "intlotcode", intlotcode);
            if (data1.Count > 0)
            {
                if (data1[0][2].ToString().Length > 0)
                {
                    productname = data1[0][2].ToString();
                }
                else
                {
                    productname = "";
                }
            }

            this.Hide();

            frmRetouching fc = new frmRetouching();

            fc.Closed += (s, args) => this.Close();

            if (data.Count > 0)
            {
                fc.setInitialValue(tipe, species, intlotcode, supplier, productname);
                fc.loaddatartcdet_partial(10);
                fc.loaddatasummary();
                fc.ShowDialog();
            }
        }