Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mainViewModel"></param>
        public HomeViewModel(MainViewModel mainViewModel) : base(mainViewModel)
        {
            // 1 -Load from Config
            string prNr = ConfigurationManager.AppSettings.Get("prNr");
            string idNr = ConfigurationManager.AppSettings.Get("idNr");

            // 2 - Create credentials
            Credentials cred = new Credentials(idNr, prNr);

            // 3 - Create observer instance
            _observer = new Observer.IhkObserver(_welcome, _login, _results, cred);

            //Directly load
            ExecuteLoadResults();
        }
Beispiel #2
0
        private async Task <IEnumerable <SubjectMarks> > GetResultsAsync()
        {
            // TODO (MG): Improve this
            string welcome = "https://ausbildung.ihk.de/pruefungsinfos/Peo/Willkommen.aspx?knr=155";
            string login   = "******";
            string results = "https://ausbildung.ihk.de/pruefungsinfos/Peo/Ergebnisse.aspx";

            Observer.IhkObserver observer = new Observer.IhkObserver(welcome, login, results, Credentials);
            string captcha = string.Empty;

            do
            {
                captcha = (await CaptchaSolver.CaptchaSolver.DeCaptchAsync(
                               await observer.GetLoginCaptchaAsync())).Item2;
            } while (!await observer.LoginAsync(captcha));

            return(await observer.GetExamInformationAsync());
        }
Beispiel #3
0
 static ObserverHandler()
 {
     _observer = new Observer.IhkObserver();
 }