示例#1
0
        private void CustomersGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RoomWraper selectedRoom = (RoomWraper)CustomersDataGrid.SelectedItem;

            if (selectedRoom != null)
            {
                textBoxNumber.Text = selectedRoom.Number.ToString();
                textBoxFloor.Text  = selectedRoom.Floor.ToString();
                textBoxBedNo.Text  = selectedRoom.BedNo.ToString();
                textBoxBathNo.Text = selectedRoom.BathNo.ToString();
            }
        }
示例#2
0
        private void buttonUpdate_Click(object sender, RoutedEventArgs e)
        {
            RoomWraper room = (RoomWraper)CustomersDataGrid.SelectedItem;

            room.Number = Int32.Parse(textBoxNumber.Text);
            room.Floor  = Int32.Parse(textBoxFloor.Text);
            room.BedNo  = Int32.Parse(textBoxBedNo.Text);
            room.BathNo = Int32.Parse(textBoxBathNo.Text);

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

            client.Save(sessionId, room);
        }
示例#3
0
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            RoomWraper room = new RoomWraper();

            room.Number = Int32.Parse(textBoxNumber.Text);
            room.Floor  = Int32.Parse(textBoxFloor.Text);
            room.BedNo  = Int32.Parse(textBoxBedNo.Text);
            room.BathNo = Int32.Parse(textBoxBathNo.Text);

            RoomsServiceClient client    = new RoomsServiceClient();
            String             sessionId = (String)App.Current.Properties[App.sessionPropertyName];
            int savedRoomsQuantity       = client.Save(sessionId, room);

            if (savedRoomsQuantity == 1)
            {
                CustomersDataGrid.ItemsSource = client.FindAll(sessionId);
            }
        }
示例#4
0
 public RoomsComboBoxWraper(RoomWraper room)
 {
     this.room = room;
 }