private void addToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Frm_Customer_Detail a = new Frm_Customer_Detail();
     a.type = "0";
     a.ShowDialog();
     LoadData();
 }
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Edit
            if (dataGridView1.Rows.Count == 0)
            {
                MessageBox.Show("Please choose 1 row for editing");
                return;
            }
            string sql = "";

            string err = "";
            sql = "select locked,user_locked from "+Businessbp.executedb.owner+"nab_customer_flexcube t where cust_ac_no='" + dataGridView1[3, dataGridView1.CurrentCell.RowIndex].Value.ToString() + "'";
            //if (!Businessbp.executedb.getTable(sql, ref err).Rows.Count== 0)
            DataTable dt1 = Businessbp.executedb.getTable(sql, ref err);
            if (err != "")
            {
                MessageBox.Show(err);
                return;
            }
            if (dt1.Rows.Count > 0)
            {
                int x = Int32.Parse(dt1.Rows[0][0].ToString());
                if (x == 1)
                {
                    if (dt1.Rows[0][1].ToString() != Businessbp.executedb.Usrid)
                    {
                        MessageBox.Show("Customer has been locked!");
                        return;
                    }
                    else
                    {
                        Frm_Customer_Detail a = new Frm_Customer_Detail();
                        a.type = "1";
                        a.ref_no = dataGridView1[3, dataGridView1.CurrentCell.RowIndex].Value.ToString();
                        a.ShowDialog();
                        LoadData();
                    }

                }
                else
                {
                    Frm_Customer_Detail a = new Frm_Customer_Detail();
                    a.type = "1";
                    a.ref_no = dataGridView1[3, dataGridView1.CurrentCell.RowIndex].Value.ToString();
                    a.ShowDialog();
                    LoadData();

                }

            }
        }