Exemple #1
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            Room roomUp = ROOM.LayThongTinPhong(_idRoom);

            roomUp.Note = txtGhiChu.Text;
            var checkRoom = ROOM.CapNhatTinhTrangPhong(_idRoom, roomUp);

            BookRoom bRoomUp = BOOKR.GetThongTinBookRoom(_idRoom);

            bRoomUp.dateBooking   = dTimeNgayDat.Value;
            bRoomUp.Checkin_Date  = dTimeNgayNhan.Value;
            bRoomUp.Checkout_Date = dTimeNgayTra.Value;
            var checkBRoom = BOOKR.SuaThongTinBookRoomCuaKH(bRoomUp, _idCustomer);


            var    sl        = Convert.ToInt32(numUpDown.Value);
            string idService = listDSDichVu.SelectedValue.ToString();
            bool   checkBS   = false;

            if (BILLS.checkIfExist(idService, _idBRoom) == null)
            {
                Bill_Service bs = new Bill_Service();
                bs.id_BookRoom   = _idBRoom;
                bs.id_Service    = idService;
                bs.Service_Count = (int)numUpDown.Value;
                BILLS.insertBillService(bs);
                checkBS = true;
            }
            else
            {
                checkBS = BILLS.CapNhatSoLuong(_idBRoom, idService, sl);
                checkBS = true;
            }
            if (checkBRoom && checkRoom && checkBS)
            {
                MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Cập nhật không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
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);
        }