예제 #1
0
        private async void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            LoginButton.IsEnabled = false;
            LoginButton.Content   = "Logowanie...";
            var identifier = IdentifierBox.Text;
            var password   = PasswordBox.Password;

            var data = await Task.Factory.StartNew(() => Client.Login(identifier, password));

            if (data == null)
            {
                MessageBox.Show("Wpisano nieprawdiłowe dane logowania lub wystąpił problem z połączeniem.", "Błąd",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                LoginButton.Content = "Pobieranie danych...";
                this.Title          = $"Frekwencja {Version} | {identifier}";
                ListBoxSubjects.Items.Clear();
                await ProcessAttendances();
            }

            GlobalStatsButton.IsEnabled = true;
            LoginButton.IsEnabled       = true;
            LoginButton.Content         = "Zaloguj się";
        }
예제 #2
0
        private static void PromptLogin()
        {
            LoginCredentials credentials = new LoginCredentials();

            Console.Write("Identyfikator: ");
            credentials.Username = Console.ReadLine();
            Console.Write("Hasło: ");
            credentials.Password = Console.ReadLine();

            Client.Login(credentials.Username, credentials.Password);
            Properties.Settings.Default.LoginCredentials = JsonConvert.SerializeObject(credentials);
        }
예제 #3
0
        static void Login()
        {
            Console.WriteLine("Zaloguj się");
            Console.Write("Login: "******"Hasło: ");
            var password = Console.ReadLine();

            Console.WriteLine("Trwa logowanie...");
            client.Login(username, password);
            Console.Clear();
        }
예제 #4
0
        static void Main(string[] args)
        {
            // Display header and get user credentials
            displayHeader();
            Console.Write("Username: "******"Password: ");
            var password = Console.ReadLine();

            // Create a new instance and login to Synergia
            client.Login(username, password);

            // Display main screen
            displayHeader();
            displayMenu();
        }