private async void btnLogin_Click(object sender, RoutedEventArgs e) { pgbLogin.Visibility = Visibility.Visible; var allFieldsFilled = CheckAndPrintLoginDialog(); if (!allFieldsFilled) { DialogHost.IsOpen = true; } else { currentShop.Password = psLoginPassword.Password; var list = bL.GetAllShops() .Where(x => x.Pseudo == currentShop.Pseudo && x.Password == currentShop.Password); if (list.Count() != 0) { GridMain.Children.Clear(); GridMain.Children.Add(new AdminDashboard(list.Last())); } else { MessageBox.Show("Any User is associated to this account. Please sign-up"); pgbLogin.Visibility = Visibility.Hidden; } } }
static void TestConnexion() { var a = bl.GetAllShops(); if (a.Count(x => x.Pseudo == "Gab1" && x.Password == "Gab") == 1) { Console.WriteLine("OK"); } }
private void InitialiseShopsList() { bl = BL.BL.GetInstance(); shopsList = new List <Shop>(bl.GetAllShops()); //shopsList = new ObservableCollection<Shop> //{ // new Shop { Name = "Tip Top Shop 1", Address = "Rue du Lt Jean Vigneux, Saint Gratien, France", Location = new Location { Latitude = 32, Longitude = 35.191130 }, Phone = "157", Website = "google.fr", ImageURL="C:/Users/gabri/Pictures/m1.jpg", Supply = new ObservableCollection<IceCream> { new IceCream() } }, // new Shop { Name = "Tip Top Shop 2", Address = "Rue du Lt Jean Vigneux, Saint Gratien, France", Location = new Location { Latitude = 34, Longitude = 35.191132 }, Phone = "135", Website = "google.com", ImageURL="C:/Users/gabri/Pictures/m1.jpg", Supply = new ObservableCollection<IceCream> { } }, // new Shop { Name = "Tip Top Shop 3", Address = "Rue du Lt Jean Vigneux, Saint Gratien, France", Location = new Location { Latitude = 36.765192, Longitude = 35.191134 }, Phone = "0123", Website = "google.co.it", ImageURL="C:/Users/gabri/Pictures/m1.jpg", Supply = new ObservableCollection<IceCream> { new IceCream(), new IceCream() } }, // new Shop { Name = "Tip Top Shop 4", Address = "Rue du Lt Jean Vigneux, Saint Gratien, France", Location = new Location { Latitude = 38.765192, Longitude = 35.191134 }, Phone = "0123", Website = "google.co.it", ImageURL="C:/Users/gabri/Pictures/m1.jpg", Supply = new ObservableCollection<IceCream> { new IceCream(), new IceCream() } } //}; this.ListViewProducts.ItemsSource = shopsList; }