private void labelLog_Click(object sender, EventArgs e) { using (var context = new IMDBEntities()) { var result = (from c in context.Users where c.Username.Equals(TextBoxUsername.Text) select c).FirstOrDefault(); if (result != null) { if (result.Rights.Contains("admin")) { AdminOrUser aou = new AdminOrUser(TextBoxUsername.Text, this); aou.Show(); } else { UserPage up = new UserPage(result.Username, this); up.Show(); } SoundPlayer log = new SoundPlayer(@"C:\Users\Mosu\Desktop\proiect_utile\sound.wav"); log.Play(); } else { SystemSounds.Exclamation.Play(); MessageBox.Show("The password or username aren't correct!"); } } }
private void UserRatingButton_Click(object sender, EventArgs e) { AdminOrUser aou = new AdminOrUser(MemberUserName, this, MemberUserID, "Rating"); aou.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { AdminOrUser aou = new AdminOrUser(MemberUserName, this, MemberUserID, "Watchlist"); aou.Show(); this.Hide(); }
private void watchlistToolStripMenuItem_Click(object sender, EventArgs e) { int id; using (var con = new IMDBEntities()) { var result = (from a in con.Users where a.Username.Contains(MemberUserName) select a).First(); id = result.ID_User; } AdminOrUser aou = new AdminOrUser(MemberUserName, this, id, "Watchlist"); aou.Show(); this.Hide(); }
private void labelLog_Click(object sender, EventArgs e) { using (var context = new IMDBEntities()) { var result = (from c in context.Users where c.Username.Equals(TextBoxUsername.Text) select c).FirstOrDefault(); if (result != null) { string parola = result.Password; parola = parola.Replace(" ", string.Empty); string parola2 = CalculateMD5Hash(TextBoxPassword.Text); if (!parola2.Equals(parola)) { MessageBox.Show("The password isn't correct!", "Sign in Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (result.Rights.Contains("admin")) { AdminOrUser aou = new AdminOrUser(TextBoxUsername.Text, this); aou.Show(); } else { UserPage up = new UserPage(result.Username, this); up.Show(); } SoundPlayer log = new SoundPlayer(@"C:\Users\Mosu\Desktop\proiect_utile\sound.wav"); log.Play(); TextBoxUsername.Text = ""; TextBoxPassword.Text = ""; } } else { SystemSounds.Exclamation.Play(); MessageBox.Show("The password or username isn't correct!"); } } }