public QUANLYKHACHSAN.BusinessObject.PhieuThuePhongInFo LayPhieuThue(String id) { DataTable tbl = data.LayPhieuDangKy(id); PhieuThuePhongInFo ph = null; KhachHangControl khctrl = new KhachHangControl(); if (tbl.Rows.Count > 0) { ph = new PhieuThuePhongInFo(); ph.MaPhieuThue = Convert.ToString(tbl.Rows[0]["MaPhieuThue"]); ph.MaKhachHang = khctrl.LKH(Convert.ToString(tbl.Rows[0]["MaKhachHang"])); ChiTietPhieuThueControl ctrl = new ChiTietPhieuThueControl(); ph.ChiTiet = ctrl.ChiTietPhieuThue(ph.MaPhieuThue); } return(ph); }
public QUANLYKHACHSAN.BusinessObject.HoaDonInFo LayHoaDon(String id) { DataTable tbl = data.LayMaHoaDon(id); QUANLYKHACHSAN.BusinessObject.HoaDonInFo ph = null; KhachHangControl khctrl = new KhachHangControl(); PhieuNhanPhongControl ptctrl = new PhieuNhanPhongControl(); if (tbl.Rows.Count > 0) { ph = new QUANLYKHACHSAN.BusinessObject.HoaDonInFo(); ph.MaHoaDon = Convert.ToString(tbl.Rows[0]["MaHoaDon"]); ph.TenNhanVien = Convert.ToString(tbl.Rows[0]["NhanVienLap"]); ph.TenKhachHang = khctrl.LKH(Convert.ToString(tbl.Rows[0]["MaKhachHang"])); ph.MaNhanPhong = ptctrl.LayPhieuNhan(Convert.ToString(tbl.Rows[0]["MaNhanPhong"])); ph.TongTien = Convert.ToSingle(tbl.Rows[0]["TongTien"]); ph.NgayLap = Convert.ToDateTime(tbl.Rows[0]["NgayLap"]); ChiTietHoaDonControl cthd = new ChiTietHoaDonControl(); ph.ChiTiet = cthd.ChiTietHoaDon(ph.MaHoaDon); } return(ph); }