Esempio n. 1
0
        public ReservationAdd(Room room)
        {
            InitializeComponent();
            roomToReserve = room;
            PollCustomers();

        }
Esempio n. 2
0
        private void populateMaintenance(Room room)
        {
            clearMaintenance();
            foreach (var item in maintenanceObjects)
            {
                if (item.mtr_room == room.room_ID)
                {

                    StackPanel maintenance = new StackPanel();
                    maintenance.Orientation = Orientation.Vertical;
                    maintenance.HorizontalAlignment = HorizontalAlignment.Stretch;
                    maintenance.VerticalAlignment = VerticalAlignment.Stretch;

                    //Label lbl = new Label();
                    //lbl.Content = "ID: " + item.mtr_ID + " ";

                    TextBlock txtBlock = new TextBlock();
                    txtBlock.TextWrapping = TextWrapping.Wrap;
                    txtBlock.Text = item.mtr_Note + "\n" + "Status: " + item.mtr_status + '\n';
                    

                    //maintenance.Children.Add(lbl);
                    maintenance.Children.Add(txtBlock);

                    maintenanceStack.Children.Add(maintenance);

                }

            }
        }
Esempio n. 3
0
        private void populateSelectionData(Room room)
        {
            selRoom = room;

            if (selRoom != null)
            {

                currentCustomer = null;
                currentResv = null;
                clearServices();
                clearMaintenance();

                foreach (var item in reservationObjects)
                {
                    if (item.rsvr_rID == selRoom.room_ID) { currentResv = item; }
                }

                if (currentResv != null)
                {

                    foreach (var item in customerObjects)
                    {
                        if (item.cstmr_ID == currentResv.cstmr_ID) { currentCustomer = item; }
                    }

                    reservedLbl.Content = "True";
                    reservedLbl.Foreground = new SolidColorBrush(Colors.Green);

                    isReserved.Header = "True";
                    isReserved.Foreground = new SolidColorBrush(Colors.Green);

                    resvDetailName.Content = "Name";
                    resvDetailFrom.Content = currentResv.startDate.Substring(0, 10);
                    resvDetailTo.Content = currentResv.endDate.Substring(0, 10);
                    resvStatus.Header = currentResv.status;
                    resvStatus.Foreground = new SolidColorBrush(Colors.Black);
                    resvDetailName.Content = currentCustomer.name;

                    populateServices(selRoom);
                    populateMaintenance(selRoom);

                }
                else
                {
                    reservedLbl.Content = "False";
                    reservedLbl.Foreground = new SolidColorBrush(Colors.Red);

                    isReserved.Header = "False";
                    isReserved.Foreground = new SolidColorBrush(Colors.Red);

                    resvDetailName.Content = "";
                    resvDetailFrom.Content = "";
                    resvDetailTo.Content = "";
                    resvStatus.Header = "";
                    populateMaintenance(selRoom);
                }
            }
        }
Esempio n. 4
0
        ////////////
        //HELPER FUNCTIONS
        ////////////
        private void populateServices(Room room)
        {
            clearServices();
            foreach (var item in serviceObjects)
            {
                if (item.room_ID == room.room_ID)
                {

                    StackPanel service = new StackPanel();
                    service.Orientation = Orientation.Vertical;
                    service.HorizontalAlignment = HorizontalAlignment.Stretch;
                    service.VerticalAlignment = VerticalAlignment.Stretch;

                    Label lbl = new Label();
                    lbl.Content = "ID: " + item.srv_ID + " ";

                    TextBlock txtBlock = new TextBlock();
                    txtBlock.Text = item.note;
                    txtBlock.TextWrapping = TextWrapping.Wrap;

                    service.Children.Add(lbl);
                    service.Children.Add(txtBlock);

                    serviceStack.Children.Add(service);

                }

            }

        }