private void btnInsertCustomer_Click(object sender, EventArgs e) { AddOREditeCustomers frmAddCustomers = new AddOREditeCustomers(); if (frmAddCustomers.ShowDialog() == DialogResult.OK) { UsersBind(); } }
private void btnEditeCustomer_Click(object sender, EventArgs e) { if (dgvCustomers.CurrentRow != null) { int userid = int.Parse(dgvCustomers.CurrentRow.Cells[0].Value.ToString()); AddOREditeCustomers editCustomers = new AddOREditeCustomers(); editCustomers.userId = userid; if (editCustomers.ShowDialog() == DialogResult.OK) { UsersBind(); } } else { MessageBox.Show("لطفا یک نغر را انتخاب کنید", "خطا", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }