示例#1
0
        private void ShowThongTinDatPhong(string cmnd, string idRoom)
        {
            clsCustomer clsCus = new clsCustomer();
            Customer    res    = clsCus.checkIfExist(cmnd);


            if (res != null)
            {
                DuaDataKhachHangVaoTextBox(res);
                clsBookRoom clsBRoom = new clsBookRoom();
                var         ttbRoom  = clsBRoom.GetThongTinBookRoomCuaKhach(res.id_Customer);
                DuaDataBookRoomVaoTextBox(ttbRoom);

                clsRoom Room   = new clsRoom();
                var     ttRoom = Room.LayThongTinPhong(idRoom);
                DuaDataRoomVaoTextBox(ttRoom);
                _idRoom     = ttRoom.id_Room;
                _idBRoom    = ttbRoom.id_BookRoom;
                _idCustomer = res.id_Customer;
            }
            else
            {
                MessageBox.Show("Số CMND chưa đặt phòng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void frmRoomManagement_Load(object sender, EventArgs e)
        {
            cboThongTinPhongTang.Items.Add("1");
            cboThongTinPhongTang.Items.Add("2");
            cboThongTinPhongTang.Items.Add("3");
            cboThongTinPhongTang.Items.Add("4");
            cboThongTinPhongTang.Items.Add("5");
            cboThongTinPhongTang.Items.Add("6");
            cboThongTinPhongTang.Items.Add("7");
            cboThongTinPhongTang.Items.Add("8");
            cboThongTinPhongTang.Items.Add("9");
            cboThongTinPhongTang.Items.Add("10");
            cboThongTinPhongTang.Items.Add("11");
            cboThongTinPhongTang.Items.Add("12");


            //load lvw Danh Sách Phòng
            createColumnsListRoom(lvwDanhSachPhong);
            room = new clsRoom();
            IEnumerable <Room> lstRoom = room.getALLRoom();

            LoadRoomLenLvw(lvwDanhSachPhong, lstRoom);

            //load lvw Danh Sách Loại Phòng
            createColumnsRoomStyle(lvwDanhSachLoaiPhong);
            roomstyle = new clsStyleRoom();
            IEnumerable <RoomStyle> lstRoomStyle = roomstyle.getALLRoomStyle();

            LoadRoomStyleLenLvw(lvwDanhSachLoaiPhong, lstRoomStyle);

            //autocomlet
            // txtTimKiemThongTinPhong.AutoCompleteMode = AutoCompleteMode.Suggest;
            //txtTimKiemThongTinPhong.AutoCompleteSource = AutoCompleteSource.CustomSource;
        }
        private void frmBookRoom_Load(object sender, EventArgs e)
        {
            b = new clsBookRoom();
            IEnumerable <BookRoom> br = b.getListBookRoom();

            c       = new clsCustomer();
            r       = new clsRoom();
            jBR     = new clsJoinBRandRom();
            honLoan = new clsHonLoan();
            createTitle(lvwDSDatPhong);
            loadRoomListView(lvwDSDatPhong, br);

            TaoDayGhe(n);
        }
        void LoadThongTin()
        {
            clsCustomer CUS = new clsCustomer();
            Customer    cus = CUS.checkIfExist(_idCustomer);

            lblTen.Text    = cus.name;
            lblCMND.Text   = cus.id_Customer;
            lblSoDT.Text   = cus.phone;
            lblDiaChi.Text = cus.address;

            clsRoom ROOM = new clsRoom();
            var     room = ROOM.LayThongTinPhong(_idRoom);

            lblTenPhong.Text = room.RoomNumber;

            clsStyleRoom SROOM = new clsStyleRoom();
            var          SRoom = SROOM.GetRoomStyle(room.id_RoomStyle);

            lblLoaiPhong.Text = SRoom.NameStyle;
            double giaPhong = (double)SRoom.Price;

            lblDonGia.Text = giaPhong.ToString();

            // So dem
            clsBookRoom BROOM = new clsBookRoom();
            var         BRoom = BROOM.GetThongTinBookRoom(_idRoom);

            lblNgayDen.Text = BRoom.Checkin_Date.ToString();
            var soDem = (BRoom.Checkout_Date - BRoom.Checkin_Date).TotalDays;

            lblSoDem.Text = soDem.ToString();

            double tienPhong = soDem * giaPhong;

            lblTienPhong.Text = string.Format("{0:0,0 vnđ}", tienPhong);

            double tienDV = TinhTienDichVu();

            lblDichVu.Text = string.Format("{0:0,0 vnđ}", tienDV);

            double tongTien = tienDV + tienPhong;

            lblTongTien.Text = string.Format("{0:0,0 vnđ}", tongTien);
        }
示例#5
0
        private void btnNhanPhong_Click(object sender, EventArgs e)
        {
            clsRoom Room   = new clsRoom();
            Room    roomUp = Room.LayThongTinPhong(_idRoom);

            roomUp.Note = txtGhiChu.Text;
            Room.CapNhatTinhTrangPhong(_idRoom, roomUp);
            DuaDataRoomVaoTextBox(Room.LayThongTinPhong(_idRoom));

            clsBookRoom BookRoom = new clsBookRoom();
            BookRoom    bRoomUp  = BookRoom.GetThongTinBookRoom(_idRoom);

            bRoomUp.dateBooking  = dTimeNgayDat.Value;
            bRoomUp.Checkin_Date = dTimeNgayNhan.Value;
            BookRoom.SuaThongTinBookRoomCuaKH(bRoomUp, _idCustomer);

            clsHonLoan honLoan = new clsHonLoan();
            var        dsNP    = honLoan.GetDSNhanPhong();

            DuaDataVaoLvwDSNhanPhong(lvwDSNhanPhong, dsNP);
        }