private void btn_addCustomer_Click(object sender, EventArgs e) { using (CustomerED customerED = new CustomerED()) { if (customerED.ShowDialog() != DialogResult.Cancel) { txt_search.Clear(); txt_search.Focus(); btn_clear.Hide(); this.loadCustomer(); } } }
private void dgv_customer_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { string customer_id = dgv_customer.Rows[e.RowIndex].Cells["id"].Value.ToString(); using (CustomerED customerED = new CustomerED(customer_id)) { if (customerED.ShowDialog() != DialogResult.Cancel) { txt_search.Clear(); txt_search.Focus(); btn_clear.Hide(); this.loadCustomer(); } } } }