Beispiel #1
0
        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");
                }
            }
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
 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));
 }
Beispiel #4
0
 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));
 }
Beispiel #5
0
 //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));
 }
Beispiel #6
0
 public static int DeleteProfile(phieudangki p)
 {
     return(Dao.DeleteProfile(p));
 }
Beispiel #7
0
 public static int UpdateProfile(phieudangki p)
 {
     return(Dao.UpdateProfile(p));
 }
Beispiel #8
0
 //PHIẾU THUÊ PHÒNG
 #region
 public static int InsertProfile(phieudangki p)
 {
     return(Dao.InsertProfile(p));
 }
Beispiel #9
0
 public static int Tinhsongay(hoadon h, phieudangki p)
 {
     return(Dao.Tinhsongay(h, p));
 }