コード例 #1
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     if (textBoxUsername.Text.Length < 1 || textBoxPassword.Text.Length < 1)
     {
         labelError.Visible = true;
         labelError.Text    = "You need to enter username and/or password!";
     }
     else
     {
         if (db.Login(textBoxUsername.Text, textBoxPassword.Text))
         {
             username = textBoxUsername.Text;
             FormApp form = new FormApp();
             form.Show();
             form.Activate();
             this.Hide();
             labelError.Visible = false;
             ClearBoxes();
         }
         else
         {
             labelError.Visible = true;
             labelError.Text    = "This user does not exist! Consider creating a new one by pressing Register button!";
         }
     }
 }
コード例 #2
0
 private void Register()
 {
     if (textBoxPassword.Text == textBoxPasswordConfirm.Text)
     {
         if (db.CheckUsernameDuplicate(textBoxUsername.Text))
         {
             labelError.Visible = true;
             labelError.Text    = "That username already exists! Please choose a different one.";
         }
         else
         {
             db.RegisterUser(textBoxUsername.Text, textBoxPassword.Text, textBoxName.Text, textBoxSurname.Text, textBoxAge.Text, comboBoxSex.Text, textBoxCountry.Text);
             this.Hide();
             loginForm.username = textBoxUsername.Text;
             FormApp fApp = new FormApp();
             fApp.Show();
             labelError.Visible = false;
             fApp.Activate();
             lForm.ClearBoxes();
             lForm.Hide();
         }
     }
     else
     {
         labelError.Visible = true;
         labelError.Text    = "Passwords must match!";
         textBoxPassword.Clear();
         textBoxPasswordConfirm.Clear();
     }
 }
コード例 #3
0
 public FormsController(FormApp app)
 {
     _app = app;
 }
コード例 #4
0
ファイル: TestForm.cs プロジェクト: zeroyou/OpenAuth.Net
 public TestForm()
 {
     _app = AutofacExt.GetFromFac <FormApp>();
 }
コード例 #5
0
 public FormsController(IAuth authUtil, FormApp app) : base(authUtil)
 {
     _app = app;
 }