Example #1
0
        private void btnSingIn_Click(object sender, EventArgs e)
        {
            string portal = textBoxPortal.Text;
            string name = textBoxLogin.Text;
            string password = textBoxPass.Text;

            Properties.Settings.Default.Portal = portal;
            Properties.Settings.Default.UserName = name;

            if (checkBoxPass.Checked) {
                Properties.Settings.Default.Password = password;
                Properties.Settings.Default.SavePassword = true;
            } else {
                Properties.Settings.Default.Password = "";
                Properties.Settings.Default.SavePassword = false;
            }
            Properties.Settings.Default.Save();

            try {
                ILoginManager lm = new LoginManager();
                lm.Authentificate(portal, name, password);
            } catch (TeamLabExpception ex) {
                labelWrongCredentials.Text = ex.Message;
                this.DialogResult = System.Windows.Forms.DialogResult.Retry;
            }
        }