示例#1
0
        private void LoadThongTinKHTuMAKH()
        {
            List <DTO_KhachHang> lsobj_kh   = new List <DTO_KhachHang>();
            List <DTO_CTHD>      lsobj_cthd = new List <DTO_CTHD>();
            List <DTO_LoaiPhong> lsobj_lp   = new List <DTO_LoaiPhong>();
            List <DTO_Phong>     lsobj_p    = new List <DTO_Phong>();

            string result  = bus_kh.SelectAll(lsobj_kh);
            string result1 = bus_cthd.selectAll(lsobj_cthd);
            string result2 = bus_lp.SelectAll(lsobj_lp);
            string result3 = bus_p.SelectAll(lsobj_p);
            var    query   = (from kh in lsobj_kh
                              join cthd in lsobj_cthd on kh.Makh equals cthd.Makh
                              join p in lsobj_p on cthd.Sophong equals p.Sophong
                              join lp in lsobj_lp on p.Malp equals lp.Malp
                              where kh.Makh == txb_MaKH.Text
                              select new
            {
                TenKH = kh.Tenkh,
                CMND = kh.Cmnd,
                GioiTinh = kh.Gioitinh,
                NgaySinh = kh.Ngaysinh,
                SDT = kh.Sdt,
                QuocTich = kh.Quoctich,
                DiaChi = kh.Diachi,
                NgayNhanPhong = cthd.Ngaynhanphong,
                NgayDi = cthd.Ngaydi,
                LoaiPhong = lp.Tenlp,
                SoPhong = p.Sophong,
                MACTHD = cthd.Macthd,
                SoNguoi = "1"
            }
                              );

            foreach (var item in query)
            {
                txb_TenKH.Text         = item.TenKH;
                txb_CMND.Text          = item.CMND;
                txb_GioiTinh.Text      = item.GioiTinh;
                txb_NgaySinh.Text      = item.NgaySinh;
                txb_SDT.Text           = item.SDT;
                txb_QuocTich.Text      = item.QuocTich;
                txb_DiaChi.Text        = item.DiaChi;
                txb_NgayNhanPhong.Text = item.NgayNhanPhong;
                txb_NgayDi.Text        = item.NgayDi;
                txb_LoaiPhong.Text     = item.LoaiPhong;
                txb_SoPhong.Text       = item.SoPhong;
                txb_SoNguoi.Text       = item.SoNguoi;
                get_MACTHD             = item.MACTHD;
            }
        }
示例#2
0
        private void LoadDonDatPhong()
        {
            panel_HoaDon.Controls.Clear();

            List <DTO_KhachHang> lsobj_kh   = new List <DTO_KhachHang>();
            List <DTO_CTHD>      lsobj_cthd = new List <DTO_CTHD>();
            List <DTO_LoaiPhong> lsobj_lp   = new List <DTO_LoaiPhong>();
            List <DTO_Phong>     lsobj_p    = new List <DTO_Phong>();
            List <DTO_HoaDon>    lsobj_hd   = new List <DTO_HoaDon>();
            List <DTO_NhanVien>  lsobj_nv   = new List <DTO_NhanVien>();

            string result  = bus_kh.SelectAll(lsobj_kh);
            string result1 = bus_cthd.selectAll(lsobj_cthd);
            string result2 = bus_lp.SelectAll(lsobj_lp);
            string result3 = bus_p.SelectAll(lsobj_p);
            string result4 = bus_hd.SelectAll(lsobj_hd);
            string result5 = bus_nv.SelectAll(lsobj_nv);


            var query = (from kh in lsobj_kh
                         join cthd in lsobj_cthd on kh.Makh equals cthd.Makh
                         join p in lsobj_p on cthd.Sophong equals p.Sophong
                         join hd in lsobj_hd on cthd.Macthd equals hd.MaCTHD
                         where cthd.Manv == Message

                         select new
            {
                MaKH = kh.Makh,
                TenKH = kh.Tenkh,
                SoPhong = p.Sophong,
                NgayTT = hd.Ngaythanhtoan,
                TraTruoc = hd.Tratruoc
            }
                         );

            foreach (var item in query)
            {
                GUI_DanhSach.x1HoaDon x1_HD = new GUI_DanhSach.x1HoaDon();
                x1_HD.lb_MaKH.Text          = item.MaKH;
                x1_HD.lb_TenKH.Text         = item.TenKH;
                x1_HD.lb_SoPhong.Text       = item.SoPhong;
                x1_HD.lb_NgayThanhToan.Text = item.NgayTT;
                x1_HD.lb_TraTruoc.Text      = item.TraTruoc;
                this.panel_HoaDon.Controls.Add(x1_HD);
                x1_HD.Dock = DockStyle.Top;
            }
        }
示例#3
0
        private void LoadDonDatPhong()
        {
            panel_DonDatPhong.Controls.Clear();

            List <DTO_KhachHang> lsobj_kh   = new List <DTO_KhachHang>();
            List <DTO_CTHD>      lsobj_cthd = new List <DTO_CTHD>();
            List <DTO_LoaiPhong> lsobj_lp   = new List <DTO_LoaiPhong>();
            List <DTO_Phong>     lsobj_p    = new List <DTO_Phong>();

            string result  = bus_kh.SelectAll(lsobj_kh);
            string result1 = bus_cthd.selectAll(lsobj_cthd);
            string result2 = bus_lp.SelectAll(lsobj_lp);
            string result3 = bus_p.SelectAll(lsobj_p);
            var    query   = (from kh in lsobj_kh
                              join cthd in lsobj_cthd on kh.Makh equals cthd.Makh
                              join p in lsobj_p on cthd.Sophong equals p.Sophong
                              join lp in lsobj_lp on p.Malp equals lp.Malp
                              select new
            {
                MaKH = kh.Makh,
                TenKH = kh.Tenkh,
                CMND = kh.Cmnd,
                GioiTinh = kh.Gioitinh,
                SDT = kh.Sdt,
                QuocTich = kh.Quoctich,
                DiaChi = kh.Diachi,
                NgayNhanPhong = cthd.Ngaynhanphong,
                NgayDi = cthd.Ngaydi,
                LoaiPhong = lp.Tenlp,
                SoPhong = p.Sophong,
                SoNguoi = "1",
                MACTHD = cthd.Macthd
            }
                              );

            foreach (var item in query)
            {
                GUI_DanhSach.x1DonDatPhong x1_DDP = new GUI_DanhSach.x1DonDatPhong();
                x1_DDP.lb_MaKH.Text    = item.MaKH;
                x1_DDP.lb_TenKH.Text   = item.TenKH;
                x1_DDP.lb_NgayDen.Text = item.NgayNhanPhong;
                x1_DDP.lb_NgayDi.Text  = item.NgayDi;
                x1_DDP.lb_SoPhong.Text = item.SoPhong;
                this.panel_DonDatPhong.Controls.Add(x1_DDP);
                x1_DDP.Dock = DockStyle.Top;
            }
        }