Пример #1
0
 public ShopViewModel(GeneralLogin generalLogin)
 {
     SeatNumber = generalLogin.Login;
     CategoryListProductList = new ObservableCollection <CategoryAndListProductHelper>();
     ProductList             = new List <Product>();
     Cart   = new ShoppingCart(SeatNumber);
     client = new HttpClient();
     LoadData();
 }
Пример #2
0
 public PassengerLoginViewModel()
 {
     GeneralLogin = new GeneralLogin()
     {
         Login = ""
     };
     LoginCommand       = new LoginCommand(this);
     CancelLoginCommand = new CancelLoginCommand(this);
     CancelLogin();
 }
Пример #3
0
 public ChatViewModel(GeneralLogin generalLogin)
 {
     Seat        = generalLogin.Login;
     SendMessage = new SendMessage()
     {
         Content = "", Seat = Seat
     };
     SendMessageCommand = new SendMessageCommand(this);
     ChatList           = new ObservableCollection <Chat>();
     Client             = new HttpClient();
     LoadChat();
 }
Пример #4
0
 public HomeViewModel(GeneralLogin generalLogin)
 {
     Flight = new Flight();
     if (generalLogin.GetType() == typeof(CabinCrewLogin))
     {
         LoadCabinMember((CabinCrewLogin)generalLogin);
     }
     else
     {
         LoadPassenger(generalLogin);
     }
     WeatherList = new ObservableCollection <Model.Weather>();
     GetWeatherData();
 }
Пример #5
0
        public async void LoadPassenger(GeneralLogin generalLogin)
        {
            Windows.Web.Http.HttpClient client = new Windows.Web.Http.HttpClient();
            try
            {
                var json = await client.GetStringAsync(new Uri("http://localhost:5000/api/User/passenger/" + generalLogin.Login));

                var passenger = JsonConvert.DeserializeObject <Model.Passenger>(json);
                if (passenger != null)
                {
                    Flight = passenger.Flight;
                }
            }
            catch (Exception) {};
        }
Пример #6
0
 public OrderViewModel(GeneralLogin generalLogin)
 {
     OrderList  = new ObservableCollection <Model.Order>();
     SeatNumber = generalLogin.Login;
 }
 public NavigationPassengerViewModel(GeneralLogin login, bool checkForNotifications)
 {
     CheckForNotifications = checkForNotifications;
     GeneralLogin          = login;
     LoadNotifications();
 }