Пример #1
0
        /// <summary>
        /// Tries to get user with the input credentials from the database
        /// </summary>
        private void LogUserIn()
        {
            if (ContextCredentials.CheckTheAdmin(Email, Password))
            {
                App.User = new Customer(Email, Password);
                Application.Current.MainPage = new MainPage();
                return;
            }
            App.User = Customer.GetCustomer(Email, Password, App.User.GetCart());

            /// Unsuccesful operation
            if (App.User == null)
            {
                Application.Current.MainPage.DisplayAlert
                (
                    "Unsuccesfull login",
                    "Invalid login information",
                    "OK"
                );
                return;
            }
            Application.Current.MainPage = new MainPage();
        }