Пример #1
0
        public void notify()
        {
            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String   sessionId            = (String)App.Current.Properties[App.sessionPropertyName];
            DataGrid reerversionsDataGrid = (DataGrid)App.Current.Properties[App.reservarsionDataGridPropertyName];

            reerversionsDataGrid.ItemsSource = client.FindAll(sessionId);
        }
Пример #2
0
        private void buttonRefresh_Click(object sender, RoutedEventArgs e)
        {
            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];

            ReserverionsDataGrid.ItemsSource = client.FindAll(sessionId);

            int selectedRoom = (int)comboBoxRoom.SelectedValue;

            comboBoxRoom.ItemsSource   = client.FindAllRooms(sessionId).Select(room => new RoomsComboBoxWraper(room)).ToList();
            comboBoxRoom.SelectedValue = selectedRoom;

            int selectedCustomer = (int)comboBoxCustomer.SelectedValue;

            comboBoxCustomer.ItemsSource   = client.FindAllCustomers(sessionId).Select(customer => new CustomerComboBoxWraper(customer)).ToList();
            comboBoxCustomer.SelectedValue = selectedCustomer;
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            bindRoomsComboBox();
            bindCusstomerComboBox(); datePickerFrom.SelectedDate = DateTime.Today;
            datePickerTo.SelectedDate = DateTime.Today;

            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];

            ReserverionsDataGrid.ItemsSource = client.FindAll(sessionId);

            UsersServiceClient usersClient = new UsersServiceClient();
            String             login       = (String)App.Current.Properties[App.loginPropertyName];

            if (usersClient.isAdmin(sessionId, login))
            {
                MenuStaff.Visibility = Visibility.Visible;
            }
        }
Пример #4
0
        private void FillAndSave(ReserversionWraper reserversion)
        {
            reserversion.From      = (DateTime)datePickerFrom.SelectedDate;
            reserversion.To        = (DateTime)datePickerTo.SelectedDate;
            reserversion.Customers = ((CustomerComboBoxWraper)comboBoxCustomer.SelectedItem).customer;
            reserversion.RoomId    = ((RoomsComboBoxWraper)comboBoxRoom.SelectedItem).room.Id;
            reserversion.Rooms     = ((RoomsComboBoxWraper)comboBoxRoom.SelectedItem).room;

            if (!Validator.Valid(reserversion))
            {
                return;
            }

            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];
            int    savedCustomersQuantity = client.Save(sessionId, reserversion);

            if (savedCustomersQuantity > 0)
            {
                ReserverionsDataGrid.ItemsSource = client.FindAll(sessionId);
            }
        }