예제 #1
0
        private void btnDeleteCustomer_Click(object sender, System.EventArgs e)
        {
            DataGridViewRow r = dgvCustomers.SelectedRows[0];

            if (r != null)
            {
                if (MetroFramework.MetroMessageBox.Show(this, "Are you sure?", "Delete", MessageBoxButtons.OKCancel,
                                                        MessageBoxIcon.Exclamation) == DialogResult.OK)
                {
                    customerManagement.DeleteCustomer(r.Cells[0].Value.ToString());
                    dgvCustomers.Rows.Remove(r);
                }
            }
        }
예제 #2
0
 //Delete Button
 private void deleteButton_Click(object sender, EventArgs e)
 {
     //Set Id as Mandatory
     if (String.IsNullOrEmpty(idtextBox.Text))
     {
         MessageBox.Show("Id Can not be Empty!!!");
         return;
     }
     //Delete
     if (_customerManagement.DeleteCustomer(Convert.ToInt32(idtextBox.Text)))
     {
         MessageBox.Show("Deleted");
     }
     else
     {
         MessageBox.Show("Not Deleted");
     }
     //show
     showDataGridView.DataSource = _customerManagement.ShowCustomerInfo();
 }
예제 #3
0
        // DELETE api/values/5
        public void Delete(int customerId)
        {
            CustomerManagement custMgmt = new CustomerManagement();

            custMgmt.DeleteCustomer(customerId);
        }