Ejemplo n.º 1
0
 protected void BackToUserListClicked(object sender, EventArgs e)
 {
     PT3.Userlist BackToUserList = new Userlist(Username, Password, database);
     BackToUserList.Show();
     this.Hide();
     this.Dispose();
 }
Ejemplo n.º 2
0
    protected void OnLoginRegisterButtonClicked(object sender, EventArgs e)
    {
        Console.WriteLine("testasdf");
        //databaseFunc.Register("test1", "test2");
        Console.WriteLine(databaseFunc.CheckUsername(Username.Text));
        Console.WriteLine(databaseFunc.CheckPassword(Username.Text, Password.Text));

        if (databaseFunc.CheckUsername(Username.Text) == true && !databaseFunc.CheckPassword(Username.Text, Password.Text))// TODO :(Als Wachtwoord fout)
        {
            MessageDialog dialog = new MessageDialog(
                this,
                DialogFlags.Modal,
                MessageType.Info,
                ButtonsType.Ok,
                Username.Text + " is al in gebruik, of wachtwoord is fout"
                );
            dialog.Run();
            dialog.Destroy();
        }
        else
        {
            //database.CreateDatabase();
            // Console.WriteLine("testasdf");
            username = Username.Text;
            password = Password.Text;
            this.Hide();
            Loginsucces = new PT3.Userlist(username, password, databaseFunc);
            //Loginsucces.Show();
            Console.WriteLine("checkusername is ");
            Console.WriteLine(databaseFunc.CheckUsername(username));
            if (!databaseFunc.CheckUsername(username))
            {
                databaseFunc.Register(username, password);
            }
            Console.WriteLine(databaseFunc.CheckPassword(username, password));
            databaseFunc.switchOnlinestatus(username, true);//zet online

            this.Dispose();
        }
    }