private void btn_xoa_Click(object sender, EventArgs e) { if (txt_mapdk.Text == "") { MessageBox.Show("Dữ liệu chưa chọn!"); return; } phieudangki p = new phieudangki(); p.maphieu = txt_mapdk.Text; p.makhachhang = cmb_makh.Text; p.manhanvien = cmb_manv.Text; p.songuoio = int.Parse(txt_songuoi.Text.ToString()); p.ngaydatphong = date_ngaydk.Value; p.ngaytraphong = date_ngaytra.Value; p.ngaydukientraphong = date_ngaydukien.Value; p.maphong = txt_maphong.Text; if (MessageBox.Show(string.Format("Bạn có muốn xóa phiếu thuê phòng?"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.DeleteProfile(p) > 0) { MessageBox.Show("Xóa thành công."); Phieudangki_Load_1(sender, e); } else { MessageBox.Show("Error"); } } }
public static int DeleteProfile(phieudangki p) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", p.maphieu), new SqlParameter("@maphong", p.maphong) }; return(DataProvider.ExecuteNonQuery("xoaphieu", para)); }
public static int UpdateProfile(phieudangki p) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", p.maphieu), new SqlParameter("@ngaytra", p.ngaytraphong) }; return(DataProvider.ExecuteNonQuery("suaphieu", para)); }
public static int Tinhsongay(hoadon h, phieudangki p) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", h.maphieu), new SqlParameter("@mahoadon", h.mahoadon), new SqlParameter("@maphieu", p.maphieu) }; return(DataProvider.ExecuteNonQuery("tinhsongay", para)); }
//PHIẾU ĐĂNG KÍ #region public static int InsertProfile(phieudangki p) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@maphieu", p.maphieu), new SqlParameter("@manhanvien", p.manhanvien), new SqlParameter("@makhachhang", p.makhachhang), new SqlParameter("@songuoio", p.songuoio), new SqlParameter("@ngaydat", p.ngaydatphong), new SqlParameter("@ngaytra", p.ngaytraphong), new SqlParameter("@ngaydukien", p.ngaydukientraphong), new SqlParameter("@maphong", p.maphong) }; return(DataProvider.ExecuteNonQuery("themphieu", para)); }
public static int DeleteProfile(phieudangki p) { return(Dao.DeleteProfile(p)); }
public static int UpdateProfile(phieudangki p) { return(Dao.UpdateProfile(p)); }
//PHIẾU THUÊ PHÒNG #region public static int InsertProfile(phieudangki p) { return(Dao.InsertProfile(p)); }
public static int Tinhsongay(hoadon h, phieudangki p) { return(Dao.Tinhsongay(h, p)); }