private void button3_Click(object sender, EventArgs e) { Home_renter_view hrv = new Home_renter_view(); hrv.Show(); this.Hide(); }
private void b_login_Click(object sender, EventArgs e) { string s = textBox1.Text; string s2 = textBox2.Text; var str = from a2 in ul.UserLists where a2.UserId == s && a2.Password == s2 select a2; UserList pa = str.First(); s2 = pa.Password.ToString(); string s3 = pa.UserType.ToString(); try { if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Admin")) { Admin_Form af = new Admin_Form(); af.Show(); this.Hide(); } else if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Landowner")) { Landowner_View lv = new Landowner_View(); lv.Show(); this.Hide(); } else if (s.Equals(textBox1.Text) && s2.Equals(textBox2.Text) && s3.Equals("Home Renter")) { Home_renter_view hrv = new Home_renter_view(); hrv.Show(); this.Hide(); } } catch (Exception) { if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("Please enter a valid input"); } } }