private void btnDelete_Click(object sender, EventArgs e) { // Delete customer record // Create the record object to be deleted CustomerDal dal = new CustomerDal(); DataSet records = dal.Read(); // Load selected row (unique key) int recordDel = Convert.ToInt16(txtCustomerId.Text);// Fetches unique key object id and assigns it to rowSelected string record = recordDel.ToString(); string mode = "delete"; // Ask user if to proceed with deletion of this record if (doubleCheck(record, mode)) { // Deletes selected record from the server dal.Delete(Convert.ToInt16(record)); } LoadGrid(); ClearUI(); }
//Customer Deleted Database// private void BtnDeleted_Click(object sender, EventArgs e) { try { DialogResult r = MessageBox.Show("Əminsinizmi.?", "Silməyə", MessageBoxButtons.YesNo); if (r == DialogResult.Yes) { _customerDal.Delete(_customer); Reset(); } } catch { MessageBox.Show("Bazada Bele Bir Data Movcuddur"); } }
static void Main(string[] args) { ICustomerDal[] customerDals = new ICustomerDal[3] { new SqlServerCustomerDal(), new OracleServerCustomerDal(), new MySqlServerCustomerDal() }; foreach (var CustomerDal in customerDals) { CustomerDal.Delete(); } Console.ReadLine(); IPerson person = new Customer(); CustomerManager customerManager = new CustomerManager(); customerManager.Add(new OracleServerCustomerDal()); PersonManager personManager = new PersonManager(); Customer customer = new Customer { ID = 2, CustomerNo = 11, FirstName = "Engin", LastName = "Demiroğ" }; personManager.Add(customer); personManager.Add(new Customer { ID = 1, FirstName = "Metehan", LastName = "Yapan", CustomerNo = 12 }); Console.WriteLine("------------------------------------"); Student student = new Student { ID = 2, FirstName = "Fatma", LastName = "Bulut", StudentNumber = 1173 }; personManager.Add(student); }
private void BtnDelete_Click(object sender, EventArgs e) { bl.id = Convert.ToInt32(CustpmerID.Text); bool success = dl.Delete(bl); if (success == true) { MessageBox.Show("Customer Deleted Successfully"); } else { MessageBox.Show("Failed to Delete Customer"); } DataTable dt = dl.select(); dataGridView1.DataSource = dt; }
public bool Delete(Customer customer) { bool deleted = _customer.Delete(customer); return(deleted); }
public void Delete(int id) { CustomerDal CusDAL = new CustomerDal(); CusDAL.Delete(id); }
internal bool Delete(int id) { _status = _customerDal.Delete(id); return(_status); }