private void btn_XoaBan_Click(object sender, EventArgs e) { DialogResult ret = MessageBox.Show("Bạn có chắc muốn xóa bàn này không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (ret == DialogResult.Yes) { try { OrderDetails.DeleteOrderID(IDOrderDangChon); objOrder.Delete(IDOrderDangChon); objTable.Delete(IDBanDangChon); MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadDSBan(); this.listView_CacMonDaGoi.Items.Clear(); this.listView_Products.Items.Clear(); this.lblSoBan.Text = "0"; this.groupBox_HoaDon.Text = "Thông tin hóa đơn"; this.txt_ViTriBan.Text = ""; } catch (Exception ex) { MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public bool Delete(string name) { if (baseFunctions.Delete(name) > 0) { return(true); } return(false); }
private void btnXoa_Click(object sender, EventArgs e) { // xóa bệnh án của bệnh nhân ba.DeleteFrom(txtMabenhnhan.Text); //xóa bệnh nhân t.Delete(txtMabenhnhan.Text); gridcontrol1.DataSource = t.SelectAll(); }
private void btn_ThanhToan_Click(object sender, EventArgs e) { DialogResult ret1 = MessageBox.Show("Bạn muốn thanh toán bàn này ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (ret1 == DialogResult.Yes) { if (float.Parse(txt_TongTien.Text) == 0) { MessageBox.Show("Không có gì để thanh toán cả", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (this.listView_CacMonDaGoi.Items.Count == 0) { MessageBox.Show("Không có món nào để in", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } frm_InBill f = new frm_InBill(); f.LoadList(IDOrderDangChon); f.LoadThongTin(this.txt_NhanVienOrder.Text, this.lblSoBan.Text, this.txt_ThanhTien.Text, this.txt_ThueVAT.Text, this.txt_PhiDichVu.Text, this.txt_GiamGia.Text, this.txt_TongTien.Text, true); f.ShowDialog(); try { objTable.Delete(IDBanDangChon); LoadDSBan(); this.listView_CacMonDaGoi.Items.Clear(); this.listView_Products.Items.Clear(); this.lblSoBan.Text = "0"; this.groupBox_HoaDon.Text = "Thông tin hóa đơn"; this.txt_ViTriBan.Text = ""; } catch (Exception ex) { MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnXoa_Click(object sender, EventArgs e) { if (txtmaCTHD.Text != "") { ctdv.Delete(txtmaCTHD.Text); LoadChiTietDichVu(); } else { XtraMessageBox.Show("Chưa có thông tin mã chi tiết dịch vụ"); } }
private void buttonXoa_Click(object sender, EventArgs e) { if (nd.Delete(LayThongTinControl()) > 0 && this.textBoxTenTKND.Text.Length > 0) { MessageBox.Show("Xóa thành công!"); HienThiDuLieu(); } else { MessageBox.Show("Xóa thất bại!"); } }
private void buttonXoaHH_Click(object sender, EventArgs e) { if (maskedTextBoxMaHH.Text.Length > 0 && hh.Delete(int.Parse(maskedTextBoxMaHH.Text)) > 0) { MessageBox.Show("Delete sucessful"); LoadDataHangHoa(); } else { MessageBox.Show("Delete unsucessful "); } }
private void buttonXoaNV_Click(object sender, EventArgs e) { if (maskedTextBoxMaNV.Text.Length > 0 && nv.Delete(int.Parse(maskedTextBoxMaNV.Text)) > 0) { MessageBox.Show("Xóa thành công"); LoadDataNhanVien(); } else { MessageBox.Show("Xóa thất bại"); } }
private void buttonXoaHH_Click_1(object sender, EventArgs e) { if (maskedTextBoxMaHH.Text.Length > 0 && hh.Delete(int.Parse(maskedTextBoxMaHH.Text)) > 0) { MessageBox.Show("Xóa thành công"); LoadDataHangHoa(); } else { MessageBox.Show("Xóa thất bại"); } }
private void btnXoa_Click(object sender, EventArgs e) { if (txtMachitietthuoc.Text != "") { thdetail.Delete(txtMachitietthuoc.Text); LoadChiTietThuoc(); } else { XtraMessageBox.Show("Chưa có thông tin mã chi tiết thuốc"); } }
private void buttonXoaKH_Click(object sender, EventArgs e) { if (this.maskedTextBoxMaKH.Text.Length > 0 && kh.Delete(int.Parse(this.maskedTextBoxMaKH.Text)) > 0) { MessageBox.Show("Delete sucessful"); LoadDataKhachHang(); ResetKhachHang(); } else { MessageBox.Show("Delete unsucessful"); } }
private void btn_Xoa_Click(object sender, EventArgs e) { DialogResult ret = MessageBox.Show("Bạn chắc chắn muốn xóa chứ ? ", "Cảnh báo ", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (ret == DialogResult.Yes) { try { objPrice.Delete(int.Parse(this.txt_ID.Text)); MessageBox.Show("Xóa sửa thành công"); btn_LoadLai.PerformClick(); } catch (Exception ex) { MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void Them_Xoa_Sua(string ChucNang) { Categories cat = new Categories(); try { cat.CatID = int.Parse(this.txtID.Text); } catch (Exception) { cat.CatID = 1; } cat.Name = this.txtTenLM.Text; cat.Descreption = this.txtGhiChuLM.Text; try { switch (ChucNang) { case "Them": objCat.Add(cat); break; case "Xoa": objCat.Delete(cat.CatID); break; case "Sua": objCat.Update(cat); break; } MessageBox.Show("Thành công , dữ liệu đã thay đổi "); LoadDS(objCat.SelectAll()); EnableEditButton(false); this.btXoaTrang.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Lỗi"); } }
private void buttonXoaKH_Click(object sender, EventArgs e) { try { if (this.maskedTextBoxMaKH.Text.Length > 0 && kh.Delete(int.Parse(this.maskedTextBoxMaKH.Text)) > 0) { MessageBox.Show("Xóa thành công"); LoadDataKhachHang(); ResetKhachHang(); } else { MessageBox.Show("Xóa không thành công"); } } catch (Exception) { MessageBox.Show("Xóa không thành công"); } }
private void buttonXoabg_Click(object sender, EventArgs e) { try { if (this.maskedTextBoxSoBG.Text.Length > 0 && bg.Delete(int.Parse(this.maskedTextBoxSoBG.Text)) > 0) { MessageBox.Show("Xóa thành công"); LoadDataBangGia(); ResetBangGia(); } else { MessageBox.Show("Xóa không thành công"); } } catch (Exception) { MessageBox.Show("Xóa không thành công"); } }
private void btn_XoaMon_Click(object sender, EventArgs e) { if (listView_CacMonDaGoi.Items.Count != 0 && this.listView_CacMonDaGoi.SelectedItems.Count != 0) { ListViewItem selectedItem = this.listView_CacMonDaGoi.SelectedItems[0]; string TenMon = selectedItem.SubItems[1].Text; int ID = int.Parse(selectedItem.SubItems[6].Text); DialogResult ret = MessageBox.Show("Bạn có chắc chắn muốn xóa món " + TenMon + " ( " + ID + " )" + "không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (ret == DialogResult.Yes) { try { objOrderDetail.Delete(ID); MessageBox.Show("Xóa thành công, dữ liệu thay đổi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadListView_CacMonDaChon(); } catch (Exception ex) { MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void btnXoa_Click(object sender, EventArgs e) { t.Delete(txtMabenhnhan.Text); gridcontrol1.DataSource = t.SelectAll(); }
private void btnHuy_Click(object sender, EventArgs e) { a.Delete(txtMabenhan.Text); LoadGridView(); }
private void btnXoa_Click(object sender, EventArgs e) { gdv.Delete(int.Parse(txtMagiadichvu.Text)); LoadTable(); }
private void Them_Xoa_Sua(string ChucNang) { if (!KiemTraTinhHopLe()) { MessageBox.Show("Có vẻ như bạn chưa nhập đầy đủ thông tin , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Products pro = new Products(); try { pro.ProductID = int.Parse(this.txtID.Text); } catch (Exception) { pro.ProductID = 1; } pro.Name = this.txt_TenMon.Text; pro.Image = this.txt_HinhAnh.Text; pro.CatId = (int)this.cbb_LoaiMon.SelectedValue; pro.Description = this.txt_MoTa.Text; pro.Unit = this.txt_DonViTinh.Text; if (rd_Ban.Checked) { pro.Type = false; } else { pro.Type = true; } try { switch (ChucNang) { case "Them": objProducts.Add(pro); frm_QuanLyGia f = new frm_QuanLyGia(); f.LoadForm(pro.Name, pro.ProductID); f.ShowDialog(); break; case "Xoa": Prices.DeleteByProductID(pro.ProductID); objProducts.Delete(pro.ProductID); break; case "Sua": objProducts.Update(pro); break; } MessageBox.Show("Thành công , dữ liệu đã thay đổi "); LoadDS(objProducts.SelectAll()); EnableEditButton(false); this.btXoaTrang.PerformClick(); } catch (Exception ex) { MessageBox.Show("Lỗi đã sảy ra , vui lòng kiểm tra lại hoặc liên hệ kỹ thuật viên với mô tả lỗi dưới đây \n " + ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnXoa_Click(object sender, EventArgs e) { cd.Delete(int.Parse(txtMachucdanh.Text)); LoadChucDanh(); }
private void btnXoa_Click(object sender, EventArgs e) { nv.Delete(int.Parse(txtManhanvien.Text)); }