private void button1_Click(object sender, EventArgs e) { addTransit(); this.Close(); ParentTransitList ptl = new ParentTransitList(); ptl.Show(); }
// login service private void button1_Click_1(object sender, EventArgs e) { String userEmail = textBox1.Text; String password = maskedTextBox1.Text; String access = Sqlutil.UserSql.validLogin(userEmail, password); userEmailGlobal = userEmail; // route to different page based on access if (Enum.UserAccess.ADMIN.ToString().Equals(access)) { AdminForm.AdminListing af = new AdminForm.AdminListing(); af.Show(); this.Hide(); } else if (Enum.UserAccess.TRANSPORTER.ToString().Equals(access)) { TransitForm.TransporterForm tf = new TransitForm.TransporterForm(); tf.Show(); this.Hide(); } else if (Enum.UserAccess.PARENT.ToString().Equals(access)) { TransitForm.ParentTransitList ptl = new TransitForm.ParentTransitList(); ptl.Show(); this.Hide(); } else if (Constant.Constant.INVALID_PASSWORD.Equals(access)) { MessageBox.Show("Invalid Password", "Invalid"); } else { MessageBox.Show("User not found/ Inactive", "Invalid"); } }