private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var    dialog = new MasterFile.addcustomer();
            string code   = dataGridView1.Rows[e.RowIndex].Cells[colCustCode.Name].Value.ToString();
            var    dt     = DataSupport.RunDataSet("Select * from base_customer where custCode = '" + code + "'").Tables[0];

            foreach (DataRow row in dt.Rows)
            {
                dialog.txtcustCode.Text = row["custCode"].ToString();
                dialog.txtcustName.Text = row["customer"].ToString();
                dialog.txtaddress.Text  = row["address"].ToString();
                dialog.txtbusiness.Text = row["businessStyle"].ToString();
                dialog.txtcontact.Text  = row["contactNo"].ToString();
                dialog.txtpostCode.Text = row["postalCode"].ToString();
                dialog.txttin.Text      = row["tinNo"].ToString();
                dialog.txtterms.Text    = row["terms"].ToString();
                dialog.txtdisc1.Text    = row["discount1"].ToString();
                dialog.txtdisc2.Text    = row["discount2"].ToString();
                dialog.txtdisc3.Text    = row["discount3"].ToString();
                dialog.txtdisc4.Text    = row["discount4"].ToString();
                dialog.txtdisc5.Text    = row["discount5"].ToString();
                dialog.txtzone.Text     = row["zone"].ToString();
            }
            dialog.txtcustCode.ReadOnly = true;
            addcustomer.mode            = "update";
            dialog.ShowDialog();
            display();
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var dialog = new MasterFile.addcustomer();

            addcustomer.mode = "";
            dialog.ShowDialog();
            display();
        }