private void dgv_kitchen_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex > -1) { string kitchen_id = dgv_kitchen.CurrentRow.Cells["id"].Value.ToString(); using (KitchenED item = new KitchenED(kitchen_id)) { if (item.ShowDialog() != DialogResult.Cancel) { txt_search.Clear(); btn_clear.Hide(); this.loadKitchen(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.DialogResult = DialogResult.OK; } }
private void btn_addKitchen_Click(object sender, EventArgs e) { using (KitchenED item = new KitchenED()) { if (item.ShowDialog() != DialogResult.Cancel) { txt_search.Clear(); btn_clear.Hide(); this.loadKitchen(); } } }