public ActionResult Create(StudentProfile studentprofile)
        {
            if (ModelState.IsValid)
            {
                db.StudentProfiles.Add(studentprofile);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(studentprofile);
        }
 protected bool CheckAvoidedSessions(Interview interview, IList<AvoidedSession> sessions, StudentProfile student)
 {
     if (sessions != null)
     {
         foreach (var session in sessions)
         {
             if ((session.academic_organizations == null || session.academic_organizations.ToList().Contains(student.academic_organization)) &&
                 (session.academic_plans == null || session.academic_plans.ToList().Contains(student.academic_plan_primary)) &&
                 (session.academic_levels == null || session.academic_levels.ToList().Contains(student.academic_level)))
             {
                 List<bool> avoidedDayOfWeekList = PrepareAvoidedDayOfWeek(session);
                 if (avoidedDayOfWeekList[Convert.ToInt16(interview.start_time.DayOfWeek)])
                 {
                     if ((interview.start_time.TimeOfDay >= session.start_time.TimeOfDay && interview.start_time.TimeOfDay < session.end_time.TimeOfDay) ||
                         (interview.end_time.TimeOfDay > session.start_time.TimeOfDay && interview.end_time.TimeOfDay <= session.end_time.TimeOfDay) ||
                         (interview.start_time.TimeOfDay <= session.start_time.TimeOfDay && interview.end_time.TimeOfDay >= session.end_time.TimeOfDay))
                     {
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
 public ActionResult Edit(StudentProfile studentprofile)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentprofile).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(studentprofile);
 }
 public ActionResult EditRemarks(StudentProfile studentprofile)
 {
     StudentProfile student = db.StudentProfiles.Find(studentprofile.id);
     if (studentprofile == null)
     {
         return HttpNotFound("Student Profile not found");
     }
     student.remarks = studentprofile.remarks;
     db.SaveChanges();
     return Content(student.remarks);
 }
 public bool IsEligible(Program program, StudentProfile student)
 {
     if (student != null && program != null)
     {
         return ((true)
             && ((String.IsNullOrEmpty(program.eligible_academic_career)) || (program.eligible_academic_career.Split(',').Contains(student.academic_career)))
             && ((String.IsNullOrEmpty(program.eligible_academic_organization)) || (program.eligible_academic_organization.Split(',').Contains(student.academic_organization)))
             && ((String.IsNullOrEmpty(program.eligible_academic_plan)) || (program.eligible_academic_plan.Split(',').Contains(student.StudentAcademicPlan.major_plan1)
                 || (!String.IsNullOrEmpty(student.StudentAcademicPlan.major_plan2) && program.eligible_academic_plan.Split(',').Contains(student.StudentAcademicPlan.major_plan2))
                 || (!String.IsNullOrEmpty(student.StudentAcademicPlan.major_plan3) && program.eligible_academic_plan.Split(',').Contains(student.StudentAcademicPlan.major_plan3))
                 || (!String.IsNullOrEmpty(student.StudentAcademicPlan.major_plan4) && program.eligible_academic_plan.Split(',').Contains(student.StudentAcademicPlan.major_plan4))
                 ))
             && ((String.IsNullOrEmpty(program.eligible_program_status)) || (program.eligible_program_status.Split(',').Contains(student.program_status)))
             && ((String.IsNullOrEmpty(program.eligible_academic_level)) || (program.eligible_academic_level.Split(',').Contains(student.academic_level))));
     }
     else
     {
         return false;
     }
 }