private void picEdit_Click(object sender, EventArgs e) { using (AddUserForm frm = new AddUserForm()) { frm.ShowDialog(); } }
private void metroTile1_Click(object sender, EventArgs e) { using (AddUserForm frm = new AddUserForm()) { frm.ShowDialog(); } //try //{ // if (_sqlCon.State == ConnectionState.Closed) // { // //TODO: Add data validation to make sure the into is new. // _sqlCon.Open(); // SqlCommand sqlCmd = new SqlCommand("PWDBAddorEdit", _sqlCon); // sqlCmd.CommandType = CommandType.StoredProcedure; // sqlCmd.Parameters.AddWithValue("@mode", "Add"); // sqlCmd.Parameters.AddWithValue("@UserID", 0); // sqlCmd.Parameters.AddWithValue("@FirstName", txteditFirstName.Text.Trim()); // sqlCmd.Parameters.AddWithValue("@LastNAME", txteditLastName.Text.Trim()); // sqlCmd.Parameters.AddWithValue("@Email", txteditemail.Text.Trim()); // sqlCmd.Parameters.AddWithValue("@TeacherFirstName", txtEditTeachFName.Text.Trim()); // sqlCmd.Parameters.AddWithValue("@TeacherLastName", txtEditTeachLName.Text.Trim()); // sqlCmd.Parameters.AddWithValue("@Password", txtEditPW.Text.Trim()); // sqlCmd.ExecuteNonQuery(); // MessageBox.Show("Added sucsessfully"); // } //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message, "Error Message"); //} //finally //{ // _sqlCon.Close(); //} }