private void Send_OnClick(object sender, RoutedEventArgs e) { if (area.SelectedIndex == -1 || AccomoType.SelectedIndex == -1 || roomType.SelectedIndex == -1 || adults.SelectedIndex == -1 || child.SelectedIndex == -1 || checkInTimeDatePicker.Text.Length == 0 || Check_Out_Date.Text.Length == 0) { MessageBox.Show("You must enter all the details", "Failed", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None); return; } if (checkInTimeDatePicker.SelectedDate >= Check_Out_Date.SelectedDate) { MessageBox.Show("Check in Date must Start before check out date", "Failed", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None); return; } var guestRequest = new GuestRequest(); guestRequest.SpecificRequirements.Breakfast = brrackfast.Content.ToString(); guestRequest.SpecificRequirements.Lunch = lunch.Content.ToString(); guestRequest.SpecificRequirements.Dinner = dinner.Content.ToString(); guestRequest.SpecificRequirements.TwinBeds = tweenB.Content.ToString(); guestRequest.SpecificRequirements.DoubleBed = doublB.Content.ToString(); guestRequest.SpecificRequirements.BabyCrib = badyCrib.Content.ToString(); guestRequest.SpecificRequirements.Bathtub = bathub.Content.ToString(); guestRequest.SpecificRequirements.PrivateBathroom = privetBath.Content.ToString(); guestRequest.SpecificRequirements.RoomService = roomSer.Content.ToString(); guestRequest.SpecificRequirements.WashingMachine = laundryS.Content.ToString(); guestRequest.SpecificRequirements.Jacuzzi = jacuzzi.Content.ToString(); guestRequest.SpecificRequirements.Pool = pool.Content.ToString(); guestRequest.SpecificRequirements.Spa = spa.Content.ToString(); guestRequest.SpecificRequirements.Gym = gym.Content.ToString(); guestRequest.SpecificRequirements.Terrace = terrace.Content.ToString(); guestRequest.SpecificRequirements.Garden = garden.Content.ToString(); guestRequest.SpecificRequirements.ChildrenAttractions = childrenAt.Content.ToString(); guestRequest.SpecificRequirements.AirConditioning = airCond.Content.ToString(); guestRequest.SpecificRequirements.WiFi = wifi.Content.ToString(); guestRequest.SpecificRequirements.Tv = tv.Content.ToString(); guestRequest.AmountOfAdults = (uint)adults.SelectedItem; guestRequest.AmountOfChildren = (uint)child.SelectedItem; guestRequest.Area = (enums.Area)area.SelectedItem; guestRequest.SubArea = (enums.Districts)subArea.SelectedItem; guestRequest.TypeOfAccommodationRequested = (System.Type)AccomoType.SelectedItem; guestRequest.StyleOfUnitRequested = (Style)roomType.SelectionBoxItem; guestRequest.CheckInDate = checkInTimeDatePicker.DisplayDate; guestRequest.CheckOutDate = Check_Out_Date.DisplayDate; guestRequest.ClientLoginDetails = _login; //guestRequest.GuestRequestKey //guestRequest.OrderStatus try { _instance.AddACustomerRequirement(guestRequest); MessageBox.Show( "Your booking request has been received successfully, vacation offers will be sent to you soon ..."); var welcome = new Welcome(); welcome.Show(); Close(); } catch (Exception exception) { MessageBox.Show(exception.ToString(), "Failed", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None); } }
//add unit private void AddUnit_OnClick(object sender, RoutedEventArgs e) { if (ChoosAccommodationToAddUnit.SelectedIndex == -1 || UnitNumber.Background != Brushes.White && UnitNumber.BorderBrush != Brushes.Gray || UnitPrice.Background != Brushes.White && UnitPrice.BorderBrush != Brushes.Gray) { MessageBox.Show("You must enter all the details", "Failed", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None); return; } var hostingUnit = new HostingUnit(); hostingUnit.UnitOptions.Breakfast = (bool)ButtonBreakfast.Content; hostingUnit.UnitOptions.Lunch = (bool)ButtonLunch.Content; hostingUnit.UnitOptions.Dinner = (bool)ButtonDinner.Content; hostingUnit.UnitOptions.TwinBeds = (bool)ButtonTweenBed.Content; hostingUnit.UnitOptions.DoubleBed = (bool)ButtonDoubleBed.Content; hostingUnit.UnitOptions.BabyCrib = (bool)ButtonBadyCrib.Content; hostingUnit.UnitOptions.Bathtub = (bool)ButtonBathub.Content; hostingUnit.UnitOptions.PrivateBathroom = (bool)ButtonPrivetBathroom.Content; hostingUnit.UnitOptions.RoomService = (bool)ButtonRoomServis.Content; hostingUnit.UnitOptions.WashingMachine = (bool)ButtonLaundyservices.Content; hostingUnit.UnitOptions.Jacuzzi = (bool)UpdateButtonJacuzzi.Content; hostingUnit.UnitOptions.Pool = (bool)UpdateButtonPool.Content; hostingUnit.UnitOptions.Spa = (bool)UpdateButtonSpa.Content; hostingUnit.UnitOptions.Gym = (bool)UpdateButtonGym.Content; hostingUnit.UnitOptions.Terrace = (bool)UpdateButtonTerrece.Content; hostingUnit.UnitOptions.Garden = (bool)UpdateButtonGarden.Content; hostingUnit.UnitOptions.ChildrenAttractions = (bool)UpdateButtonChildrenAttraction.Content; hostingUnit.UnitOptions.AirConditioning = (bool)UpdateButtonAirConditioning.Content; hostingUnit.UnitOptions.WiFi = (bool)UpdateButtonWifi.Content; hostingUnit.UnitOptions.Tv = (bool)UpdateButtonTv.Content; hostingUnit.HostId = HostId; hostingUnit.UnitNumber = UnitNumber.Text; hostingUnit.UnitPrice = Convert.ToDecimal(UnitPrice.Text); foreach (var item in AccommodationToBeUpdated) { if (item.AccommodationName == ChoosAccommodationToAddUnit.Text) { hostingUnit.AccommodationKey = item.AccommodationKey; break; } } try { _instance.AddAHostingUnit(hostingUnit); MessageBox.Show( "Your booking request has been received successfully, vacation offers will be sent to you soon ..."); var welcome = new Welcome(); welcome.Show(); Close(); } catch (Exception exception) { MessageBox.Show(exception.ToString(), "Failed", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None); } }