private void button2_Click(object sender, EventArgs e) { User user = null; if (textPassword.Text == textBoxRepeatPassword.Text) { using (var session = DataProvider.Driver.Session()) { session.ReadTransaction(tx => user = DataProvider.Instance.GetUser(tx, textEmail.Text)); if (user == null) { User newUser = new User(textIme.Text, textPrezime.Text, textBrTel.Text, textEmail.Text, textPassword.Text); session.WriteTransaction(tx => DataProvider.Instance.CreateUser(tx, newUser)); DataProvider.Instance.User = newUser; FormUser fu = new FormUser(); this.Hide(); fu.Show(); } else { MessageBox.Show("User with this email already exists."); } } } else { MessageBox.Show("Your passwords don't match. Try again"); } }
public FormSeeMovies(String name, FormUser fu, bool flag) { InitializeComponent(); this.VideoClubName = name; this.FormUser = fu; this.Flag = flag; }
private void button1_Click(object sender, EventArgs e) { User user = null; using (var session = DataProvider.Driver.Session()) { session.ReadTransaction(tx => user = DataProvider.Instance.GetUser(tx, textBox1.Text)); if (user != null && user.Password == textBox2.Text) { FormUser fu = new FormUser(); this.Hide(); fu.Show(); } else { MessageBox.Show("User with this email and password doesn't exist."); } } DataProvider.Instance.User = user; }
private void FormSeeMovies_FormClosing(object sender, FormClosingEventArgs e) { FormUser.Close(); }