Exemplo n.º 1
0
 public Shopping(WebService.Customer user)
 {
     currentuser = user;
     InitializeComponent();
     shoppingresult.Foreground = Brushes.Red;
     saldo.Text = user.Saldo.ToString();
     foreach (WebService.Product p in WebClient.GetProducts())
     {
         products.Items.Add(p.Name + ": " + p.Price.ToString() + " , " + p.Amount.ToString());
     }
     ResetInventory();
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            registerresult.Text = "";
            string username = myname.Text;
            string passw    = mypassword.Password;

            WebService.Customer mylogin = WebClient.GetUser(username, passw);
            if (mylogin == null)
            {
                loginresult.Text = "De ingevulde inloggegevens zijn incorrect";
            }
            else
            {
                currentuser = mylogin;
                Shopping shop = new Shopping(mylogin);
                shop.Show();
                this.Close();
            }
        }