Beispiel #1
0
        static void Main(string[] args)
        {
            Poehoe.Crypto.ZipCrypto = new PoehoeZipWin32.ZipCrypto();
            Poehoe.Crypto.AesKey = "087EC4624E964AE27DBDFE03279A2EE4";
            Poehoe.Crypto.ZipKey = "yawUBRu+reduka5UPha2#=cRUc@ThekawEvuju&?g$dru9ped=a@REQ!7h_?anut";
            Poehoe.Crypto.AesCrypto = new AesCrypto();
            var Sch = new School("$SCHOOL");
            var T = Sch.Login("$USER", "$PASS");
            T.Wait();
            var DDFR = GetLeerlingenDataRequest.Create(T.Result, new int[] {int.Parse(T.Result.InitData.Descendants(User.d2p1+"MijnTabelID").First().Value)}).Send(T.Result);
            DDFR.Wait();
            XDocument D = XDocument.Parse(DDFR.Result);
            var Data = new BinairFormaat(Convert.FromBase64String(D.Descendants(User.tempuri + "GetLeerlingenDataResult").First().Value));
            foreach(var F in Data.Fields) {
                Debug.WriteLine("public object {0} {1}\n\tget;\n\tprivate set;\n{2}", F.Name, "{", "}");

            }
             Console.ReadLine();
        }
        public async Task DoStuff(DateTime Week)
        {
            var WeekNum = DateTimeFormatInfo.CurrentInfo.Calendar.GetWeekOfYear(Week, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
            var PI = new ProgressIndicator()
            {
                IsIndeterminate = false,
                Text = "Loading week " + WeekNum,
                Value = 0,
                IsVisible = true
            };
            try
            {

                SystemTray.SetProgressIndicator(this, PI);

                var A = IsolatedStorageSettings.ApplicationSettings;
                var Username = A["Username"] as string;
                var Password = A["Password"] as string;
                var SchoolText = A["School"] as string;

                if (School != null && School.SchoolNaam != SchoolText)
                {
                    School = null;
                    User = null;
                }

                if (User != null && User.Username != Username)
                    User = null;

                School = School ?? new School(SchoolText);

                await School.SchoolVersion();

                PI.Value = 0.25;

                User = User ?? await School.Login(Username, Password);

                var Data = await User.GetLeerlingData();

                PI.Value = 0.5;

                DateTime Start = Week;
                DateTime End = Week.AddDays(4);
                string Stamnummer = Data.stamnr + "";

                var Requ = await AgendaRequest.Create(Start, End, User, Stamnummer).Send(User);

                PI.Value = 0.75;

                AgendaMapper Mapper = AgendaMapper.GetData(Requ, User);
                if(Week == StartOfWeek)
                    this.DataContext = new Data() { Title = "Week " + WeekNum, Mapper = Mapper };

                PI.Value = 1;

                await Task.Delay(2000);
                PI.IsVisible = false;
            }
            catch (Exception e)
            {
                PI.Text = "Error updating!";
                Thread.Sleep(2000);
                PI.IsVisible = false;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Constructor. Don't use!
 /// </summary>
 internal User(School S)
 {
     School = S;
     SetBaseAddress();
 }