Пример #1
0
        public void ThemPhieu(string MaHD, string NgayTao, string MaNV, string MaP)
        {
            QLKhachSanEntities nh = new QLKhachSanEntities();
            HOADON             p  = new HOADON();

            p.MAHD      = MaHD;
            p.NGAYTAO   = DateTime.Parse(NgayTao);
            p.MANV      = MaNV;
            p.MAPHONG   = MaP;
            p.THANHTIEN = 0;
            nh.HOADON.Add(p);
            nh.SaveChanges();
        }
Пример #2
0
 public bool themHoaDon(HOADON hd)
 {
     try
     {
         qlhd.HOADONs.InsertOnSubmit(hd);
         qlhd.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #3
0
        public bool Insert(HOADON hd)
        {
            getConnect();
            string     sql = string.Format("INSERT INTO HoaDon(MaNV,TongTien,TrangThai) VALUES({0},{1},N'{2}')", hd.MaNV, hd.TongTien, hd.TrangThai);
            SqlCommand cmd = new SqlCommand(sql, conn);
            int        row = cmd.ExecuteNonQuery();

            getDisconnect();
            if (row > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #4
0
 public bool thanhToanCongNoKhachHang(string mahd)
 {
     try
     {
         HOADON hd = qlcn.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault();
         hd.TienNo = 0;
         qlcn.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #5
0
        public bool themHoaDon(HOADON hoaDon)
        {
            try
            {
                ketNoi.HOADONs.InsertOnSubmit(hoaDon);
                ketNoi.SubmitChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
        }
Пример #6
0
 public bool suaHoaDonKhachMuaLe(string mahd, float tonggt, float tienno)
 {
     try
     {
         HOADON hd = qlhd.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault();
         hd.TongGiaTri = tonggt;
         hd.TienNo     = tienno;
         qlhd.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #7
0
 public bool suaHoaDonBan(string mahd, float chuyenban, float tongdichvu, float thuevat, float tonggt, float thanhtien, float tienno)
 {
     try
     {
         HOADON hd = qlhd.HOADONs.Where(t => t.MaHD == mahd).FirstOrDefault();
         hd.TienChuyenBan  = chuyenban;
         hd.TongTienDichVu = tongdichvu;
         hd.ThueVAT        = thuevat;
         hd.TongGiaTri     = tonggt;
         hd.ThanhTien      = thanhtien;
         hd.TienNo         = tienno;
         qlhd.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #8
0
 public bool capNhatHoaDon(HOADON hoaDon)
 {
     try
     {
         var ketQua = from hoaDonTam in ketNoi.HOADONs
                      where hoaDonTam.MAHOADON == hoaDon.MAHOADON
                      select hoaDonTam;
         foreach (var tam in ketQua)
         {
             tam.TONGTIEN = hoaDon.TONGTIEN;
             tam.NGAYLAP  = hoaDon.NGAYLAP;
         }
         ketNoi.SubmitChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 partial void DeleteHOADON(HOADON instance);
Пример #10
0
 partial void UpdateHOADON(HOADON instance);
Пример #11
0
 partial void InsertHOADON(HOADON instance);