Ejemplo n.º 1
0
        private void save_retouching_productname()
        {
            String intlotcode  = cbexistinglot.Text.Trim();
            String productname = cbproductname.Text.Trim();

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

            data = frm.get_data_table_string_2param("tbretouching", "intlotcode", intlotcode, "productname", productname);
            if (data.Count > 0)
            {
                ada = true;
            }

            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();

            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();

                if (!ada)
                {
                    mySql3.CommandText = "Insert into tbretouching(intlotcode,productname,moddatetime) values(@intlotcode,@productname,@moddatetime)";
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@productname", productname);
                    DateTime dt       = DateTime.Now;
                    String   cdate    = dt.ToString("yyyy-MM-dd HH:mm tt");
                    DateTime currdate = DateTime.Parse(cdate);
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
                else if (ada)
                {
                    mySql3.CommandText = "Update tbretouching set productname=@productname, moddatetime=@moddatetime  where intlotcode=@intlotcode";
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@productname", productname);
                    DateTime dt       = DateTime.Now;
                    String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                    DateTime currdate = DateTime.Parse(cdate);
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();
        }
Ejemplo n.º 2
0
        private void save_cutting_edit()
        {
            MainMenu        frm        = new MainMenu();
            String          intlotcode = lblInternalcode.Text.Trim();
            DateTime        dt         = DateTime.Now;
            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();

            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText = "update tbcuttingdetails  set grade=@grade, cweight=@cweight, moddatetime=@moddatetime where id=@id";
                mySql3.Parameters.AddWithValue("@grade", txtgrade.Text.Trim());
                mySql3.Parameters.AddWithValue("@cweight", Double.Parse(txtweightedit.Text.Trim()));
                mySql3.Parameters.AddWithValue("@id", Int32.Parse(lblid.Text.Trim()));
                dt = DateTime.Now;
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
                MessageBox.Show("Data changes has been stored");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            finally
            {
                conn5.Close();
                panel1.Visible     = false;
                txtgrade.Text      = "";
                txtweightedit.Text = "";
            }
        }
Ejemplo n.º 3
0
        private void updateweightwrap()
        {
            MainMenu frm = new MainMenu();

            if (!txtweightwrap.Text.Equals("") && double.Parse(txtweightwrap.Text) > 0)
            {
                String          intlotcode = lblInternalcode.Text.Trim();
                DateTime        dt         = DateTime.Now;
                String          connString = Konek();
                MySqlConnection conn5      = new MySqlConnection(connString);
                conn5.Open();

                try
                {
                    MySqlCommand mySql3 = conn5.CreateCommand();
                    mySql3.CommandText =
                        "Update tbreceiving set weightwrap=@weightwrap, moddatetime=@moddatetime where intlotcode=@intlotcode";
                    mySql3.Parameters.AddWithValue("@weightwrap", double.Parse(txtweightwrap.Text));
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    MessageBox.Show("Error message " + e.Message);
                }
                conn5.Close();
            }
        }
Ejemplo n.º 4
0
        private void save_retouchingdet()
        {
            MainMenu frm        = new MainMenu();
            String   intlotcode = get_intlotcode();
            String   suppcode   = txtsuppcode.Text.Trim();

            String loinnumber = "";

            if (radioButton1.Checked)
            {
                loinnumber = loingeneration();
            }
            else if (radioButton2.Checked)
            {
                loinnumber = txtloin.Text.Trim();
            }

            String lotnumber = "L-" + loinnumber;

            DateTime        dtcutting    = dateTimePicker1.Value;
            DateTime        dtretouching = dateTimePicker2.Value;
            String          connString   = Konek();
            MySqlConnection conn5        = new MySqlConnection(connString);

            conn5.Open();

            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText =
                    "Insert into tbretouchingdetails(intlotcode,rtcdate, tipe, grade, rweight, remark, username, moddatetime, lotnumber, loin_number,suppcode)" +
                    " values(@intlotcode,@rtcdate, @tipe, @grade, @rweight, @remark, @username, @moddatetime, @lotnumber, @loin_number,@suppcode)";
                mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                mySql3.Parameters.AddWithValue("@rtcdate", DateTime.Parse(dtretouching.ToString("yyyy-MM-dd HH:mm:ss")));
                mySql3.Parameters.AddWithValue("@tipe", cbfishtype.Text.Trim());
                mySql3.Parameters.AddWithValue("@grade", cbgrade.Text.Trim());
                double cweight = 0;
                cweight = double.Parse(txtweight.Text);
                mySql3.Parameters.AddWithValue("@rweight", cweight);
                mySql3.Parameters.AddWithValue("@remark", txtremark.Text.Trim());

                String username;
                username = Properties.Settings.Default.username;
                mySql3.Parameters.AddWithValue("@username", username);
                mySql3.Parameters.AddWithValue("@lotnumber", lotnumber);
                mySql3.Parameters.AddWithValue("@loin_number", loinnumber);
                mySql3.Parameters.AddWithValue("@suppcode", suppcode);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
                Properties.Settings.Default.rweight = cweight;
                Properties.Settings.Default.remark  = txtremark.Text.Trim();
                loin_code_global = loinnumber;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();
        }
Ejemplo n.º 5
0
        private void update_pl(String plno)
        {
            //save in plnoglobal
            String cust = txtcustomer.Text.Trim();

            String   po        = cbpo.Text.Trim();
            String   shipterm  = cbshipterms.Text.Trim();
            String   blno      = txtblno.Text.Trim();
            DateTime shipdate  = dateTimePicker1.Value.Date;
            DateTime etd       = dateTimePicker2.Value.Date;
            String   origin    = txtorigin.Text.Trim();
            String   vessel    = txtvessel.Text.Trim();
            String   voyage    = txtvoyage.Text.Trim();
            String   container = txtcontainer.Text.Trim();
            String   signer    = txtsigner.Text.Trim();
            String   sealno    = txtseal.Text.Trim();
            String   shipment  = txtshipment.Text.Trim();
            String   username  = Properties.Settings.Default.username;

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

            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText =
                    "update shipping_unit set po_number=@po,customerid=@cust, bill_of_lading=@blno,vessel_name=@vessel ,container_number=@container, seal_number=@sealno, country_origin=@origin, shipdate=@shipdate, moddatetime=@moddatetime,incoterms=@shipterm,voyage=@voyage,signer=@signer, etd=@etd,shipment=@shipment where packingslipno=@plno";
                mySql3.Parameters.AddWithValue("@plno", plno);
                mySql3.Parameters.AddWithValue("@po", po);
                mySql3.Parameters.AddWithValue("@cust", cust);
                mySql3.Parameters.AddWithValue("@blno", blno);
                mySql3.Parameters.AddWithValue("@vessel", vessel);
                mySql3.Parameters.AddWithValue("@container", container);
                mySql3.Parameters.AddWithValue("@sealno", sealno);
                mySql3.Parameters.AddWithValue("@origin", origin);
                mySql3.Parameters.AddWithValue("@shipdate", shipdate);
                mySql3.Parameters.AddWithValue("@etd", etd);
                DateTime dt = DateTime.Now;
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.Parameters.AddWithValue("@shipterm", shipterm);
                mySql3.Parameters.AddWithValue("@shipment", shipment);
                mySql3.Parameters.AddWithValue("@voyage", voyage);
                mySql3.Parameters.AddWithValue("@signer", signer);
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();
        }
Ejemplo n.º 6
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            MainMenu frm = new MainMenu();

            if (dataGridView1.Rows[e.RowIndex].Cells[0].Value == null)
            {
                return;
            }


            if (btnpost.Enabled == false)
            {
                MessageBox.Show("This Packing List has been closed, prohibited to delete record");
                return;
            }


            if (e.ColumnIndex == 8 && e.RowIndex >= 0 && dataGridView1.Rows.Count > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure to delete Value " + this.dataGridView1.Rows[e.RowIndex].Cells[1].Value + "?", "Delete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Int32           n          = e.RowIndex;
                    String          caseno     = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                    String          boxkosong  = "";
                    String          connString = Konek();
                    MySqlConnection conn5      = new MySqlConnection(connString);
                    conn5.Open();
                    try
                    {
                        MySqlCommand mySql3 = conn5.CreateCommand();
                        mySql3.CommandText =
                            "update tbpacking set shipping_unit_number=@shipping_unit_number, moddatetime=@moddatetime where case_number=@case_number and shipping_unit_number=@shipping_unit_number1";
                        mySql3.Parameters.AddWithValue("@shipping_unit_number", boxkosong);
                        mySql3.Parameters.AddWithValue("@shipping_unit_number1", lblpackinglist.Text.Trim());
                        mySql3.Parameters.AddWithValue("@case_number", caseno);
                        DateTime dt       = DateTime.Now;
                        String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                        DateTime currdate = DateTime.Parse(cdate);
                        mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                        mySql3.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error message " + ex.Message);
                    }
                    conn5.Close();

                    this.loadpackingdetails(lblpackinglist.Text.Trim());
                    txtscan.Focus();
                }
            }
        }
Ejemplo n.º 7
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.Rows[e.RowIndex].Cells[1].Value == null)
            {
                return;
            }


            if (e.ColumnIndex == 3 && e.RowIndex >= 0 && dataGridView1.Rows.Count > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure to delete Value " + this.dataGridView1.Rows[e.RowIndex].Cells[1].Value + "?", "Delete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Int32           n          = e.RowIndex;
                    Int32           id         = 0;
                    String          intlotcode = lblInternalcode.Text.Trim();
                    MainMenu        frm        = new MainMenu();
                    List <object[]> data       = new List <object[]>();
                    data = frm.get_data_table_transaction("tbreceivingdetails", intlotcode, "id", "");

                    for (int i = 0; i <= n; i++)
                    {
                        if (i == n)
                        {
                            id = Int32.Parse(data[i][0].ToString());
                        }
                    }


                    String          connString = Konek();
                    MySqlConnection conn5      = new MySqlConnection(connString);
                    conn5.Open();
                    try
                    {
                        MySqlCommand mySql3 = conn5.CreateCommand();
                        mySql3.CommandText = "update tbreceivingdetails  set tipe=@tipe,grade=@grade,fweight=0,intlotcode=@intlotcode, moddatetime=@moddatetime where id=@id";
                        mySql3.Parameters.AddWithValue("@tipe", "");
                        mySql3.Parameters.AddWithValue("@grade", "");
                        mySql3.Parameters.AddWithValue("@intlotcode", "4del");
                        mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                        mySql3.Parameters.AddWithValue("@id", id.ToString());
                        mySql3.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    loaddatarcvdet();
                }
            }
        }
Ejemplo n.º 8
0
        private void save_cuttingdet()
        {
            MainMenu frm = new MainMenu();

            if (Properties.Settings.Default.grade == null || Properties.Settings.Default.grade.Equals(""))
            {
                MessageBox.Show(" Please entry Grade");
                return; //to stop process
            }
            else if (!txtweight.Text.Equals("") && double.Parse(txtweight.Text) > 0)
            {
                String          intlotcode = lblInternalcode.Text.Trim();
                DateTime        dt         = DateTime.Now;
                String          connString = Konek();
                MySqlConnection conn5      = new MySqlConnection(connString);
                conn5.Open();

                try
                {
                    MySqlCommand mySql3 = conn5.CreateCommand();
                    mySql3.CommandText =
                        "Insert into tbcuttingdetails(intlotcode,cutdate, tipe, grade, cweight, username, moddatetime)" +
                        " values(@intlotcode,@cutdate,  @tipe, @grade, @cweight, @username, @moddatetime)";
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@cutdate", DateTime.Parse(dt.ToString("yyyy-MM-dd HH:mm:ss")));
                    mySql3.Parameters.AddWithValue("@tipe", lblType.Text.Trim());
                    mySql3.Parameters.AddWithValue("@grade", Properties.Settings.Default.grade);
                    double cweight = 0;
                    cweight = double.Parse(txtweight.Text);
                    mySql3.Parameters.AddWithValue("@cweight", cweight);
                    String username;
                    username = Properties.Settings.Default.username;
                    mySql3.Parameters.AddWithValue("@username", username);
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error message " + ex.Message);
                }

                conn5.Close();
            }

            txtweight.Text = "0.00";
            txtweight.Focus();
        }
Ejemplo n.º 9
0
        private void post_unpost_stuffing(String plno, String status)
        {
            MainMenu        frm         = new MainMenu();
            Int32           valuestatus = 0;
            String          connString  = Konek();
            MySqlConnection conn5       = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText =
                    "update shipping_unit set closed=@closed, moddatetime=@moddatetime where packingslipno=@plno";
                mySql3.Parameters.AddWithValue("@plno", plno);
                if (status.Equals("post"))
                {
                    valuestatus = 1;
                }
                else
                {
                    valuestatus = 0;
                }
                mySql3.Parameters.AddWithValue("@closed", valuestatus);

                DateTime dt       = DateTime.Now;
                String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                DateTime currdate = DateTime.Parse(cdate);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();

            if (valuestatus == 1)
            {
                set_po_status(lblpo.Text.Trim(), "closed");
            }
            else if (valuestatus == 0)
            {
                set_po_status(lblpo.Text.Trim(), "open");
            }
        }
Ejemplo n.º 10
0
        private void set_po_status(String po, String status)
        {
            MainMenu        frm        = new MainMenu();
            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText =
                    "update tbpo set status=@status, moddatetime=@moddatetime where pono=@po";
                mySql3.Parameters.AddWithValue("@po", po);
                mySql3.Parameters.AddWithValue("@status", status);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();
        }
Ejemplo n.º 11
0
        private void save_receivingdet()
        {
            MainMenu frm = new MainMenu();

            if (!txtweight.Text.Equals("") && double.Parse(txtweight.Text) > 0)
            {
                double weight = 0;
                weight = double.Parse(txtweight.Text);

                String          intlotcode = lblInternalcode.Text.Trim();
                DateTime        dt         = DateTime.Now;
                String          connString = Konek();
                MySqlConnection conn5      = new MySqlConnection(connString);
                conn5.Open();

                try
                {
                    MySqlCommand mySql3 = conn5.CreateCommand();
                    mySql3.CommandText =
                        "Insert into tbreceivingdetails(idreceiving,intlotcode,fweight,tipe, grade, fishno,moddatetime)" +
                        " values(@idreceiving,@intlotcode,@fweight,@tipe, @grade, @fishno, @moddatetime)";
                    mySql3.Parameters.AddWithValue("@idreceiving", idreceiving);
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@fweight", weight);
                    mySql3.Parameters.AddWithValue("@tipe", lblType.Text.Trim());
                    mySql3.Parameters.AddWithValue("@grade", Properties.Settings.Default.grade);
                    mySql3.Parameters.AddWithValue("@fishno", Int32.Parse(txtloinno.Text));
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    MessageBox.Show("Error message " + e.Message);
                }
                conn5.Close();
            }
        }
Ejemplo n.º 12
0
        private void set_packinglist_summary(String plno)
        {
            MainMenu        frm        = new MainMenu();
            List <object[]> data       = new List <object[]>();
            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();

            MySqlCommand mySql3 = conn5.CreateCommand();

            mySql3.CommandText =
                "delete from tbpackinglist_summary where plno=@plno1";
            mySql3.Parameters.AddWithValue("@plno1", plno);
            mySql3.ExecuteNonQuery();
            conn5.Close();

            conn5.Open();
            try
            {
                mySql3 = conn5.CreateCommand();

                mySql3.CommandText =
                    "insert into tbpackinglist_summary(plno,customerid,itemcode, product, grade,size, certificate, qty,total_weight_ctn, unitprice,batchcode) ";
                mySql3.CommandText += " SELECT distinct a.shipping_unit_number as plno, c.customerid, b.itemcodesap, a.productname, a.grade, a.packingsize, concat(e.certificate, ' ' , f.certificatecode) as certificate   , count(a.case_number) as totalpacking, round(sum(a.boxweight),2) as total_weight_ctn, b.unitprice, a.batchcode  FROM `tbpacking` a join tbreceiving e on a.intlotcode=e.intlotcode left outer join tbproductsetup_sapcode b on a.productname=b.product ";
                mySql3.CommandText += " and e.certificate = b.certificate AND a.grade=b.grade and a.packingsize=b.size left outer join shipping_unit c on a.shipping_unit_number = c.shipping_unit_number left outer join tbproductsetup d on a.productname = d.productname and a.productpacking = d.tradeunit  left outer join tbsupplier f on substr(e.supplier,5,3) = f.suppcode and e.certificate<>'' where a.shipping_unit_number=@plno3    group by a.shipping_unit_number, c.customerid, b.itemcodesap, a.productname, a.grade, a.packingsize, concat(e.certificate, ' ' , f.certificatecode), a.batchcode ";
                mySql3.Parameters.AddWithValue("@plno3", plno);
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();

            String          companyid = "";
            List <object[]> dr        = new List <object[]>();
            MainMenu        fr        = new MainMenu();

            dr = fr.get_data_table_string("tbcompany", "", "");
            if (dr.Count > 0)
            {
                companyid = dr[0][1].ToString();
            }

            String user = Properties.Settings.Default.username;

            conn5.Open();
            try
            {
                mySql3             = conn5.CreateCommand();
                mySql3.CommandText =
                    "update tbpackinglist_summary set companyid=@companyid, user=@user, moddatetime=@moddatetime where plno=@plno";
                mySql3.Parameters.AddWithValue("@companyid", companyid);
                mySql3.Parameters.AddWithValue("@user", user);
                mySql3.Parameters.AddWithValue("@plno", plno);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();

            //Excluded FT, request from Bas 10 Aug 2018
            set_excludeft();
        }
Ejemplo n.º 13
0
        private void save_pl()
        {
            if (cbpo.Text.Equals(""))
            {
                MessageBox.Show("Please fill PO");
                return;
            }

            if (txtcustomer.Text.Equals(""))
            {
                MessageBox.Show("Please fill Customer");
                txtcustomer.Focus();
                return;
            }
            if (cbshipterms.Text.Equals(""))
            {
                MessageBox.Show("Please fill Ship Terms");
                return;
            }

            if (txtorigin.Text.Equals(""))
            {
                MessageBox.Show("Please fill Origin");
                txtorigin.Focus();
                return;
            }

            if (checkBox1.Checked)
            {
                if (txtlocalpl.Text.Equals(""))
                {
                    MessageBox.Show("Please fill PL Number");
                    txtlocalpl.Focus();
                    return;
                }
                else
                {
                    MainMenu        frm1  = new MainMenu();
                    List <object[]> data1 = new List <object[]>();
                    data1 = frm1.get_data_table_string("shipping_unit", "packingslipno", txtlocalpl.Text.Trim());
                    if (data1.Count > 0)
                    {
                        MessageBox.Show("PL Number " + txtlocalpl.Text.Trim() + " sudah ada, silahkan input PL# yang lain");
                        txtlocalpl.Focus();
                        return;
                    }
                }
            }

            String plno = "";

            if (checkBox1.Checked == false)
            {
                plno = generatePL();
            }
            else
            {
                plno = txtlocalpl.Text.Trim();
            }

            //save in plnoglobal
            plnoglobal = plno;

            String cust = txtcustomer.Text.Trim();

            custglobal = cust;

            String po = cbpo.Text.Trim();

            poglobal = po;

            String   shipterm  = cbshipterms.Text.Trim();
            String   blno      = txtblno.Text.Trim();
            DateTime shipdate  = dateTimePicker1.Value.Date;
            String   origin    = txtorigin.Text.Trim();
            String   vessel    = txtvessel.Text.Trim();
            String   voyage    = txtvoyage.Text.Trim();
            String   container = txtcontainer.Text.Trim();
            String   signer    = txtsigner.Text.Trim();
            String   sealno    = txtseal.Text.Trim();
            DateTime etd       = dateTimePicker2.Value.Date;
            String   shipment  = txtshipment.Text.Trim();
            String   username  = Properties.Settings.Default.username;

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

            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText =
                    "Insert into shipping_unit(packingslipno,	po_number,customerid,bill_of_lading,vessel_name,container_number,shipping_unit_number,seal_number,country_origin,shipdate,username,	moddatetime,incoterms,voyage,signer,etd,shipment)"+
                    " values(@packingslipno,@po_number,@customerid,@bill_of_lading,@vessel_name,@container_number,@shipping_unit_number,@seal_number,@country_origin,@shipdate,@username,	@moddatetime,@incoterms,@voyage,@signer,@etd,@shipment)";
                mySql3.Parameters.AddWithValue("@packingslipno", plno);
                mySql3.Parameters.AddWithValue("@po_number", po);
                mySql3.Parameters.AddWithValue("@customerid", cust);
                mySql3.Parameters.AddWithValue("@bill_of_lading", blno);
                mySql3.Parameters.AddWithValue("@vessel_name", vessel);
                mySql3.Parameters.AddWithValue("@container_number", container);
                mySql3.Parameters.AddWithValue("@shipping_unit_number", plno);
                mySql3.Parameters.AddWithValue("@seal_number", sealno);
                mySql3.Parameters.AddWithValue("@country_origin", origin);
                mySql3.Parameters.AddWithValue("@shipdate", shipdate);
                mySql3.Parameters.AddWithValue("@etd", etd);
                mySql3.Parameters.AddWithValue("@username", username);
                DateTime dt = DateTime.Now;
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.Parameters.AddWithValue("@incoterms", shipterm);
                mySql3.Parameters.AddWithValue("@voyage", voyage);
                mySql3.Parameters.AddWithValue("@signer", signer);
                mySql3.Parameters.AddWithValue("@shipment", shipment);
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();

            frmStuffing fc = new frmStuffing();

            fc.setInitial(plnoglobal, custglobal, poglobal);
            fc.ShowDialog();
        }
Ejemplo n.º 14
0
        private void save_receiving(String tipe, String species, String intlotcode, String supplier, String opt)
        {
            String   userlog = "";
            MainMenu frm     = new MainMenu();
            //get data from table
            List <object[]> data = new List <object[]>();

            data = frm.get_data_table_string("tbreceiving", "intlotcode", intlotcode);

            //get certificate code
            String          suppcode     = supplier.Substring(4, 3);
            List <object[]> datasupplier = new List <object[]>();

            datasupplier = frm.get_data_table_string("tbsupplier", "suppcode", suppcode);
            String certificatecode = "";

            if (datasupplier.Count > 0)
            {
                certificatecode = datasupplier[0][13].ToString();
            }


            String   status = "Not Ada";
            DateTime dt     = DateTime.Now;

            if (data.Count > 0)
            { //bila sdh ada record
                status = "Ada";
            }
            else
            { // bila tidak ada record
                if (species.Trim().Equals(""))
                {
                    species = "YFT";
                }

                String          connString = Konek();
                MySqlConnection conn5      = new MySqlConnection(connString);
                conn5.Open();

                try
                {
                    MySqlCommand mySql3 = conn5.CreateCommand();
                    if (status.Equals("Not Ada"))
                    {
                        userlog            = dt.ToString("yyyy-MM-dd hh:mm:ss") + "," + opt + ", rcv creation";
                        mySql3.CommandText =
                            "Insert into tbreceiving(intlotcode,species,tipe,rcvdate,supplier,certificate,delivery_no,username,userlog, certificatecode,moddatetime)" +
                            " values(@intlotcode,@species,@tipe,@rcvdate,@supplier,@certificate,@delivery_no,@username,@userlog,@certificatecode,@moddatetime)";
                    }
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode.Trim());
                    mySql3.Parameters.AddWithValue("@species", species.Trim());
                    mySql3.Parameters.AddWithValue("@tipe", tipe.Trim());
                    mySql3.Parameters.AddWithValue("@rcvdate", DateTime.Parse(dt.ToString("yyyy-MM-dd HH:mm:ss")));
                    mySql3.Parameters.AddWithValue("@supplier", supplier.Trim());
                    mySql3.Parameters.AddWithValue("@certificate", Properties.Settings.Default.certificate.ToString());
                    mySql3.Parameters.AddWithValue("@delivery_no", txtdono.Text.Trim());
                    mySql3.Parameters.AddWithValue("@username", opt.Trim());
                    mySql3.Parameters.AddWithValue("@userlog", userlog);
                    mySql3.Parameters.AddWithValue("@certificatecode", certificatecode);
                    mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }catch (Exception e)
                {
                    MessageBox.Show("Error message " + e.Message);
                }
                conn5.Close();
            }
        }
Ejemplo n.º 15
0
        private void createpacking()
        {
            String   opt         = Properties.Settings.Default.username;
            String   grade       = cbgrade.Text.Trim();
            String   intlotcode  = get_intlotcode();
            String   packingsize = cbpackingsize.Text.Trim();
            DateTime dt          = DateTime.Now;
            int      julian      = dt.DayOfYear;
            String   juliancode  = julian.ToString();

            if (juliancode.Length == 1)
            {
                juliancode = "00" + juliancode;
            }
            else if (juliancode.Length == 2)
            {
                juliancode = "0" + juliancode;
            }

            String curryear = DateTime.Now.ToString("yy");

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

            //get sequence box, boxno, caseno, lot_number
            frm = new MainMenu();
            String boxno = frm.get_data_sequence_boxno();

            gboxno = boxno;
            String caseno = frm.get_data_sequence_caseno();

            gcaseno = caseno;
            String lot_number = "L" + caseno;

            glotnumber = lot_number;

            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3  = conn5.CreateCommand();
                String       userlog = dt.ToString("yyyy-MM-dd hh:mm:ss") + "," + opt + ", rcv creation";
                mySql3.CommandText =
                    "Insert into tbpacking(box_number,case_number,grade,packingsize,username,moddatetime,lot_number,productname, productpacking, batchcode, suppcode, best_before_date, pieces, boxweight,proddate,certificate, intlotcode)" +
                    " values(@box_number,@case_number,@grade,@packingsize,@username,@moddatetime,@lot_number, @productname, @productpacking,@batchcode, @suppcode,@best_before_date,@pieces,@boxweight,@proddate,@certificate,@intlotcode)";
                mySql3.Parameters.AddWithValue("@box_number", boxno);
                mySql3.Parameters.AddWithValue("@case_number", caseno);
                mySql3.Parameters.AddWithValue("@grade", grade);
                mySql3.Parameters.AddWithValue("@packingsize", packingsize);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.Parameters.AddWithValue("@username", opt);
                mySql3.Parameters.AddWithValue("@lot_number", lot_number);
                mySql3.Parameters.AddWithValue("@productname", cbproductname.Text.Trim());
                mySql3.Parameters.AddWithValue("@productpacking", cbproductpacking.Text.Trim());
                mySql3.Parameters.AddWithValue("@batchcode", txtbatch.Text);
                mySql3.Parameters.AddWithValue("@suppcode", txtsuppcode.Text);

                DateTime processdate      = dateTimePicker1.Value;
                DateTime best_before_date = processdate.AddDays(730);
                gbest_before_date = best_before_date;
                mySql3.Parameters.AddWithValue("@best_before_date", best_before_date);
                mySql3.Parameters.AddWithValue("@pieces", Int32.Parse(txtpieces.Text.Trim()));
                mySql3.Parameters.AddWithValue("@boxweight", Double.Parse(txtboxweight.Text.Trim()));
                mySql3.Parameters.AddWithValue("@proddate", processdate);
                mySql3.Parameters.AddWithValue("@certificate", cbcertificate.Text.Trim());
                mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();
        }
Ejemplo n.º 16
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.Rows[e.RowIndex].Cells[1].Value == null)
            {
                return;
            }


            if (e.ColumnIndex == dataGridView1.Columns["Delete"].Index && e.RowIndex >= 0 && dataGridView1.Rows.Count > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure to delete " + this.dataGridView1.Rows[e.RowIndex].Cells[1].Value + " , " + this.dataGridView1.Rows[e.RowIndex].Cells[2].Value + "Kg ?", "Delete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Int32  n          = e.RowIndex;
                    Int32  id         = 0;
                    String intlotcode = lblInternalcode.Text.Trim();

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

                    if (textBox1.Text.Equals(""))
                    {
                        data = frm.get_data_table_string_byid_desc("tbcuttingdetails", "intlotcode", intlotcode);
                    }
                    else
                    {
                        data = frm.get_data_table_search("tbcuttingdetails", lblInternalcode.Text.Trim(), textBox1.Text.Trim());
                    }

                    //get_data_table_search(String tablename, String intlotcode, String value)

                    //data = frm.get_data_table_transaction("tbcuttingdetails", intlotcode, "seq1", "seq2");
                    for (int i = 0; i <= n; i++)
                    {
                        if (i == n)
                        {
                            id = Int32.Parse(data[i][0].ToString());
                        }
                    }

                    //frm.delete_table("tbcuttingdetails", "id", id.ToString());
                    String          connString = Konek();
                    MySqlConnection conn5      = new MySqlConnection(connString);
                    conn5.Open();
                    try
                    {
                        MySqlCommand mySql3 = conn5.CreateCommand();
                        mySql3.CommandText = "update tbcuttingdetails  set tipe=@tipe,grade=@grade,cweight=0,intlotcode=@intlotcode, moddatetime=@moddatetime where id=@id";
                        mySql3.Parameters.AddWithValue("@tipe", "");
                        mySql3.Parameters.AddWithValue("@grade", "");
                        mySql3.Parameters.AddWithValue("@intlotcode", "4del");
                        mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                        mySql3.Parameters.AddWithValue("@id", id.ToString());
                        mySql3.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    if (textBox1.Text.Equals(""))
                    {
                        loaddatacutdet();
                    }
                    else
                    {
                        loaddatasearch(textBox1.Text.Trim());
                    }
                }
            }


            if (e.ColumnIndex == dataGridView1.Columns["Edit"].Index && e.RowIndex >= 0 && dataGridView1.Rows.Count > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure to Edit " + this.dataGridView1.Rows[e.RowIndex].Cells[1].Value + " , " + this.dataGridView1.Rows[e.RowIndex].Cells[2].Value + "Kg ?", "Edit", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Int32    n          = e.RowIndex;
                    Int32    id         = 0;
                    String   intlotcode = lblInternalcode.Text.Trim();
                    MainMenu frm        = new MainMenu();

                    List <object[]> data = new List <object[]>();
                    if (textBox1.Text.Equals(""))
                    {
                        data = frm.get_data_table_string_byid_desc("tbcuttingdetails", "intlotcode", intlotcode);
                    }
                    else
                    {
                        data = frm.get_data_table_search("tbcuttingdetails", lblInternalcode.Text.Trim(), textBox1.Text.Trim());
                    }

                    for (int i = 0; i <= n; i++)
                    {
                        if (i == n)
                        {
                            id         = Int32.Parse(data[i][0].ToString());
                            lblid.Text = id.ToString();
                        }
                    }
                    panel1.Visible     = true;
                    txtgrade.Text      = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                    txtweightedit.Text = this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
                }
            }
        }
Ejemplo n.º 17
0
        private void save_retouching_edit()
        {
            String loinnumber = txtloin.Text.Trim();
            String intlotcode = this.intlotcode.Text;

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

            String   userlog = "";
            DateTime dt      = DateTime.Now;

            data = frm.get_data_table_string("tbretouchingdetails", "loin_number", loinnumber.Trim());
            String sqty = "";

            if (data.Count > 0)
            {
                sqty = data[0][5].ToString();
            }

            if (!sqty.Equals(txtweight.Text.Trim()))
            {
                data1 = frm.get_data_table_string("tbreceiving", "intlotcode", intlotcode);
                if (data1.Count > 0)
                {
                    userlog = data1[0][11].ToString();
                }
                String username   = Properties.Settings.Default.username;
                String newuserlog = DateTime.Now.ToString() + "," + username + ", " + loinnumber.Trim() + " change weight " + sqty + " to " + txtweight.Text.Trim() + " due to defrost.";
                userlog = userlog + "\r\n" + newuserlog;
            }

            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();
            try
            {
                MySqlCommand mySql3 = conn5.CreateCommand();
                mySql3.CommandText = "update tbretouchingdetails  set grade=@grade, rweight=@rweight, moddatetime=@moddatetime where loin_number=@loin";
                mySql3.Parameters.AddWithValue("@grade", txtgrade.Text.Trim());
                mySql3.Parameters.AddWithValue("@rweight", Double.Parse(txtweight.Text.Trim()));
                mySql3.Parameters.AddWithValue("@loin", txtloin.Text.Trim());
                dt = DateTime.Now;
                String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                DateTime currdate = DateTime.Parse(cdate);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();

                if (!userlog.Equals(""))
                {
                    mySql3.CommandText = "update tbreceiving set moddatetime=@moddatetime1, userlog=@userlog where intlotcode=@intlotcode";
                    mySql3.Parameters.AddWithValue("@userlog", userlog);
                    mySql3.Parameters.AddWithValue("@intlotcode", intlotcode);
                    mySql3.Parameters.AddWithValue("@moddatetime1", frm.get_server_time());
                    mySql3.ExecuteNonQuery();
                }
                conn5.Close();
                txtgrade.Text  = "";
                txtweight.Text = "";
                txtloin.Text   = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
        }
Ejemplo n.º 18
0
        private void scanpacking(String packing)
        {
            lblMessage.Text = "";
            lblMessage.Text = packing;

            packing = packing.Replace("\n", String.Empty).Replace("\t", String.Empty).Replace("\r", String.Empty);
            //lblMessage.Text = packing;



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

            //Get Box No
            String boxno = "";

            data = frm.get_data_table_string_fieldname("tbpacking", "box_number", "case_number", packing);
            if (data.Count > 0)
            {
                boxno = data[0][0].ToString();
            }

            //Check Shipping Number
            data = frm.get_data_table_string_fieldname("tbpacking", "shipping_unit_number", "case_number", packing);
            if (data.Count > 0)
            {
                String shipno = data[0][0].ToString();
                if (!shipno.Equals(""))
                {
                    lblMessage.Text = "Case No " + packing + " has been loaded to " + shipno + ". Please scan another case_number";
                    return;
                }
                else
                {
                    String batchno = frm.get_batch_number(boxno);

                    String          connString = Konek();
                    MySqlConnection conn5      = new MySqlConnection(connString);
                    conn5.Open();
                    try
                    {
                        MySqlCommand mySql3 = conn5.CreateCommand();
                        mySql3.CommandText =
                            "update tbpacking set shipping_unit_number=@shipping_unit_number, remark=@remark, batchcode=@batchcode,moddatetime=@moddatetime where case_number=@case_number";
                        mySql3.Parameters.AddWithValue("@shipping_unit_number", lblpackinglist.Text.Trim());
                        mySql3.Parameters.AddWithValue("@case_number", packing);
                        mySql3.Parameters.AddWithValue("@batchcode", batchno);
                        mySql3.Parameters.AddWithValue("@remark", txtremark.Text.Trim());
                        DateTime dt       = DateTime.Now;
                        String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                        DateTime currdate = DateTime.Parse(cdate);
                        mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                        mySql3.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error message " + ex.Message);
                    }
                    conn5.Close();
                }
            }
            else
            {
                lblMessage.Text = "Case No " + packing + " is not available. Please scan another case_number";
                return;
            }
        }
Ejemplo n.º 19
0
        private void set_packinglist(String plno)
        {
            List <object[]> data       = new List <object[]>();
            String          connString = Konek();
            MySqlConnection conn5      = new MySqlConnection(connString);

            conn5.Open();

            MySqlCommand mySql3 = conn5.CreateCommand();

            /*
             * mySql3.CommandText =
             * "delete from tbpackinglistdetails where plno=@plno";
             * mySql3.Parameters.AddWithValue("@plno", plno);
             * mySql3.ExecuteNonQuery();
             * conn5.Close();
             */

            mySql3.CommandText =
                "delete from tbpackinglist where plno=@plno1";
            mySql3.Parameters.AddWithValue("@plno1", plno);
            mySql3.ExecuteNonQuery();
            conn5.Close();


            /*
             * conn5.Open();
             * try
             * {
             *  mySql3 = conn5.CreateCommand();
             *  mySql3.CommandText =
             *  "insert into tbpackinglistdetails(plno,customerid,itemcode,productname,grade,size,case_number,loin_number,weight,intlotcode,certificate,certificateid,box_number) ";
             *  mySql3.CommandText += "select e.shipping_unit_number, f.customerid, g.itemcodesap, e.productname,e.grade, e.packingsize, e.case_number, a.loin_number, a.rweight, a.intlotcode, c.certificate, d.certificateid, a.box_number from tbretouchingdetails a ";
             *  mySql3.CommandText += "  left outer join tbpacking b on a.box_number = b.box_number left outer join tbreceiving c on a.intlotcode = c.intlotcode left outer join tbcertificate d on c.certificatecode = d.certificatecode ";
             *  mySql3.CommandText += "  left outer join tbpacking e on e.box_number = a.box_number left outer join shipping_unit f on e.shipping_unit_number = f.shipping_unit_number   ";
             *  mySql3.CommandText += "  left outer join tbproductsetup_sapcode g on e.productname=g.product and e.grade=g.grade and e.packingsize=g.size and e.certificate = g.certificate   ";
             *  mySql3.CommandText += " where e.shipping_unit_number = @plno2";
             *  mySql3.Parameters.AddWithValue("@plno2", plno);
             *  mySql3.ExecuteNonQuery();
             * }
             * catch (Exception ex)
             * {
             *  MessageBox.Show("Error message " + ex.Message);
             * }
             * conn5.Close();
             */

            conn5.Open();
            try
            {
                mySql3 = conn5.CreateCommand();

                /*
                 * mySql3.CommandText =
                 * "insert into tbpackinglist(plno,customerid,batchcode, itemcode, product, grade,size, certificate, qty,total_weight_ctn, unitprice) ";
                 * mySql3.CommandText += " SELECT a.shipping_unit_number as plno, c.customerid, substr(a.intlotcode,1,3) as batchcode, b.itemcodesap, a.productname, a.grade, a.packingsize, a.certificate, count(a.case_number) as totalpacking, sum(a.boxweight) as total_weight_ctn, b.unitprice  FROM `tbpacking` a left outer join tbproductsetup_sapcode b on a.productname=b.product ";
                 * mySql3.CommandText += " and a.certificate = b.certificate AND a.grade=b.grade and a.packingsize=b.size left outer join shipping_unit c on a.shipping_unit_number = c.shipping_unit_number left outer join tbproductsetup d on a.productname = d.productname and a.productpacking = d.tradeunit  where a.shipping_unit_number=@plno3  group by a.shipping_unit_number, c.customerid, substr(a.intlotcode,1,3), b.itemcodesap, a.productname, a.grade, a.packingsize, a.certificate ";
                 */

                mySql3.CommandText =
                    "insert into tbpackinglist(plno,customerid,itemcode, product, grade,size, certificate, qty,total_weight_ctn, unitprice) ";
                mySql3.CommandText += " SELECT distinct a.shipping_unit_number as plno, c.customerid, b.itemcodesap, a.productname, a.grade, a.packingsize, concat(e.certificate , ' ' , f.certificatecode), count(a.case_number) as totalpacking, round(sum(a.boxweight),2) as total_weight_ctn, b.unitprice  FROM `tbpacking` a join tbreceiving e on a.intlotcode=e.intlotcode left outer join tbproductsetup_sapcode b on a.productname=b.product ";
                mySql3.CommandText += " and e.certificate = b.certificate AND a.grade=b.grade and a.packingsize=b.size left outer join shipping_unit c on a.shipping_unit_number = c.shipping_unit_number left outer join tbproductsetup d on a.productname = d.productname and a.productpacking = d.tradeunit  left outer join tbsupplier f on substr(e.supplier,5,3) = f.suppcode and e.certificate<>'' where a.shipping_unit_number=@plno3  ";
                mySql3.CommandText += " group by a.shipping_unit_number, c.customerid, b.itemcodesap, a.productname, a.grade, a.packingsize, concat(e.certificate , ' ' , f.certificatecode) ";
                mySql3.Parameters.AddWithValue("@plno3", plno);
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();


            /*
             * conn5.Open();
             * try
             * {
             *  mySql3 = conn5.CreateCommand();
             *  mySql3.CommandText =
             *  "UPDATE tbpackinglist a INNER JOIN vw_packinglist_totalcarton b ";
             *  mySql3.CommandText += " ON a.plno = b.plno and a.grade=b.grade and a.size = b.size and a.certificate = b.certificate and a.certificateid = b.certificateid  ";
             *  mySql3.CommandText += " SET a.qty = b.totcarton where a.plno=@plno4 ";
             *  mySql3.Parameters.AddWithValue("@plno4", plno);
             *  mySql3.ExecuteNonQuery();
             * }
             * catch (Exception ex)
             * {
             *  MessageBox.Show("Error message " + ex.Message);
             * }
             * conn5.Close();
             *
             */
            MainMenu frm = new MainMenu();

            String          companyid = "";
            List <object[]> dr        = new List <object[]>();
            MainMenu        fr        = new MainMenu();

            dr = fr.get_data_table_string("tbcompany", "", "");
            if (dr.Count > 0)
            {
                companyid = dr[0][1].ToString();
            }

            String user = Properties.Settings.Default.username;

            conn5.Open();
            try
            {
                mySql3             = conn5.CreateCommand();
                mySql3.CommandText =
                    "update tbpackinglist set companyid=@companyid, user=@user, moddatetime=@moddatetime where plno=@plno";
                mySql3.Parameters.AddWithValue("@companyid", companyid);
                mySql3.Parameters.AddWithValue("@user", user);
                mySql3.Parameters.AddWithValue("@plno", plno);
                DateTime dt       = DateTime.Now;
                String   cdate    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                DateTime currdate = DateTime.Parse(cdate);
                mySql3.Parameters.AddWithValue("@moddatetime", frm.get_server_time());
                mySql3.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message " + ex.Message);
            }
            conn5.Close();

            //Excluded FT, request from Bas 10 Aug 2018
            set_excludeft();
        }