コード例 #1
0
        private void btnAddNewCustomer_Click(object sender, EventArgs e)
        {
            frmAddOrEditCustomers frmAdd = new frmAddOrEditCustomers();

            frmAdd.ShowDialog();
            if (frmAdd.DialogResult == DialogResult.OK)
            {
                BindGrid();
            }
        }
コード例 #2
0
 private void btnEditCustomer_Click(object sender, EventArgs e)
 {
     if (dgvCustomers.CurrentRow != null)
     {
         int customerId = int.Parse(dgvCustomers.CurrentRow.Cells[0].Value.ToString());
         frmAddOrEditCustomers frmAddOrEdit = new frmAddOrEditCustomers();
         frmAddOrEdit.customerId = customerId;
         if (frmAddOrEdit.ShowDialog() == DialogResult.OK)
         {
             BindGrid();
         }
     }
 }