Ejemplo n.º 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();
            }
        }
Ejemplo n.º 2
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (LoginClick != null)
     {
         var eventArgs = new LoginClickEventArgs(username.Text, password.Text, Omgeving.Text);
         LoginClick(this, eventArgs);
     }
 }