public void SetUp() { student = new StudentEducationalInfo() { secondarySchoolName = "Don Bosco", seniorSecondarySchoolName = "Shivam International", collegeName = "JSS", collegePercentage = 90 }; }
public void UpdateStudentEducationInfoIntoDatabase(StudentEducationalInfo student) { try { studentEducationDataAccess.UpdateStudentEducationInfoIntoDatabase(student); } catch (Exception exception) { throw exception; } }
public ActionResult QualificationInfo(StudentEducationalInfo studentEducation) { try { if (ModelState.IsValid) { studentEducationBusinessAccess.InsertStudentEducationInfoIntoDatabase(studentEducation); Session["marks"] = (Int32)studentEducation.collegePercentage; return(RedirectToAction("DecisionInfo", "Decision")); } return(View("QualificationInfo")); } catch (Exception exception) { return(View("Error")); } }
public void InsertStudentEducationInfoIntoDatabase(StudentEducationalInfo student) { try { using (connection) { SqlCommand sqlCommand = new SqlCommand("InsertStudentEducationInfoStoredProcedure", connection); sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue("@secondarySchoolName", student.secondarySchoolName); sqlCommand.Parameters.AddWithValue("@seniorSecondarySchoolName", student.seniorSecondarySchoolName); sqlCommand.Parameters.AddWithValue("@collegeName", student.collegeName); sqlCommand.Parameters.AddWithValue("@collegePercentage", student.collegePercentage); sqlCommand.Parameters.AddWithValue("@studentId", Session["studentId"]); connection.Open(); sqlCommand.ExecuteNonQuery(); } } catch (Exception exception) { throw exception; } }