public ActionResult Create()
 {
     var student = db.StudentProfiles.Find(User.Identity.Name);
     if (student == null)
     {
         return HttpNotFound("Student Profile not found.");
     }
     StudentQualification studentqualification = new StudentQualification
     {
         student_id = student.id,
         StudentProfile = student,
         award_date = DateTime.Now.Date
     };
     return View(studentqualification);
 }
 public ActionResult Create(StudentQualification studentqualification)
 {
     if (ModelState.IsValid)
     {
         db.StudentQualifications.Add(studentqualification);
         try
         {
             db.SaveChanges();
         }
         catch (Exception e)
         {
             return HttpNotFound("Failed to add qualification.<br/><br/>" + e.Message);
         }
     }
     return RedirectToAction("MyQualification", "StudentProfile", new { student_id = studentqualification.student_id });
 }
 public ActionResult Edit(StudentQualification studentqualification)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentqualification).State = EntityState.Modified;
         db.SaveChanges();
     }
     return RedirectToAction("MyQualification", "StudentProfile", new { student_id = studentqualification.student_id });
 }