123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace bobrovTounApp
- {
- /// <summary>
- /// Логика взаимодействия для AddEditPage.xaml
- /// </summary>
- public partial class AddEditPage : Page
- {
- private Hotel _correntHotel = new Hotel();
- public AddEditPage()
- {
- InitializeComponent();
- DataContext = _correntHotel;
- StringBuilder errors = new StringBuilder();
- if (string.IsNullOrWhiteSpace(_correntHotel.name))
- errors.AppendLine("укажите название отеля");
- if (_correntHotel.countOfStars < 1 || _correntHotel.countOfStars > 5)
- errors.AppendLine("колличество звезд - число от 1 до 5");
- if (_correntHotel.Country == null)
- errors.AppendLine("выберите строку");
- if (errors.Length > 0)
- {
- MessageBox.Show(errors.ToString());
- return;
- }
- if (_correntHotel.id == 0) ;
- try
- {
-
- MessageBox.Show("Информация сохранена");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private static void page_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
-
- {
-
- }
- }
- }
- }
|