/// <summary>
 /// Constructor with Storekeeper Window param
 /// </summary>
 /// <param name="storekeeperOpen">opens the storekeeper window</param>
 public ProductsViewModel(StorekeeperWindow storekeeperOpen)
 {
     storekeeper     = storekeeperOpen;
     UnstoredProduct = service.GetAllProducts().Where(product => product.Stored == false).ToList();
     StoredProduct   = service.GetAllProducts().Where(product => product.Stored == true).ToList();
     Priview();
 }
Esempio n. 2
0
        /// <summary>
        /// Checks if its possible to login depending on the given username and password and saves the logged in user to a list
        /// </summary>
        /// <param name="obj"></param>
        private void LoginExecute(object obj)
        {
            string password = (obj as PasswordBox).Password;

            if (Username == "Man2019" && password == "Man2019")
            {
                InfoLabel = "Logged in";
                ManagerWindow mw = new ManagerWindow();
                view.Close();
                mw.Show();
            }
            else if (Username == "Mag2019" && password == "Mag2019")
            {
                InfoLabel = "Logged in";
                StorekeeperWindow skw = new StorekeeperWindow();
                view.Close();
                skw.Show();
            }
            else
            {
                InfoLabel = "Wrong Username or Password";
            }
        }