private void button1_Click(object sender, EventArgs e) { User myuser = new User(); myuser.Username = textBox1.Text; myuser.Password = textBox2.Text; if (MyDataBase.Finduser(myuser)) { AddBook add = new AddBook(); add.ShowDialog(); } else { MessageBox.Show("Invalid"); } }
private void button1_Click(object sender, EventArgs e) { User newuser = new User(); newuser.Name = textBox1.Text; newuser.Surname = textBox2.Text; newuser.Email = textBox3.Text; newuser.Username = textBox4.Text; newuser.Password = textBox5.Text; if (MyDataBase.Finduser(newuser)) { MessageBox.Show("Account exists"); } else { MyDataBase.Users.Add(newuser); AddBook add = new AddBook(); add.ShowDialog(); } }