コード例 #1
0
        private void AddCustomer_Click(object sender, EventArgs e)
        {
            var frmAddCustomer = new frmAddOrEditCustomer();

            if (frmAddCustomer.ShowDialog() == DialogResult.OK)
            {
                BindGrid();
            }
            ;
        }
コード例 #2
0
 private void EditCustomer_Click(object sender, EventArgs e)
 {
     if (dgvCustomer.CurrentRow != null)
     {
         var customerID           = int.Parse(dgvCustomer.CurrentRow.Cells[0].Value.ToString());
         var frmaddOrEditCustomer = new frmAddOrEditCustomer();
         frmaddOrEditCustomer.customerID = customerID;
         if (frmaddOrEditCustomer.ShowDialog() == DialogResult.OK)
         {
             BindGrid();
         }
     }
     else
     {
         MessageBox.Show("لطفا شخصی را انتخاب نمایید", "توجه", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     };
 }