Exemple #1
0
        protected void OnLoginClick(object sender, LoginClickEventArgs eArgs)
        {
            ((Login)sender).Hide();

            this.sol = new ScoutsOnLine(eArgs.omgeving);
            var auth = sol.Authenticate(eArgs.username, eArgs.password);
            if (auth.LoggedIn)
            {
                var username = eArgs.username;
                repository = new UserModelRepository(username);
                FilterDataSource();

                progressBar1.Style = ProgressBarStyle.Marquee;

                var worker = new GetMembersWorker(sol);
                worker.ProgressChanged += OnMembersProgressChanged;
                worker.RunWorkerCompleted += OnMembersCompleted;
                worker.RunWorkerAsync();

                repository.Model.RoleList = new RoleList(auth.Roles);
                repository.Model.UserId = auth.UserId;
            }
            else
            {
                ((Login)sender).Show();
            }
        }
 public GetMembersWorker(ScoutsOnLine sol)
 {
     this.sol = sol;
     this.WorkerReportsProgress = this.WorkerSupportsCancellation = true;
 }