private void signupButton_Click(object sender, EventArgs e) { DataClasses1DataContext databaseConnection = new DataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\shadman\Desktop\RUBER\Assets\RMS\RMS\RMSDB.mdf;Integrated Security=True;Connect Timeout=30"); var userlevel = 4; if (userType.selectedValue == "Employee") { userlevel = 3; } else if (userType.selectedValue == "Admin") { userlevel = 2; } user newuser = new user(); newuser.email = emailTextBox.Text; newuser.password = passwordTextBox.Text; newuser.usertype = userlevel; databaseConnection.users.InsertOnSubmit(newuser); databaseConnection.SubmitChanges(); var client = new SmtpClient("smtp.gmail.com", 587) { Credentials = new NetworkCredential("*****@*****.**", "040404rms"), EnableSsl = true }; client.Send("*****@*****.**", emailTextBox.Text.TrimStart().TrimEnd(), "Registration Confirmation Email", "Username: "******"\nPassword: "******"Your registration is successful. Please check your Email address for login credentials.", "Registration Confirmed", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); login l1 = new login(); l1.Show(); }
private void timer1_Tick(object sender, EventArgs e) { try { rectangleShape2.Width += 1; if (rectangleShape2.Width >= 288) { timer1.Stop(); login l1 = new login(); l1.Show(); this.Hide(); } } catch (Exception) { return; } }