public ActionResult PFPost(int?participantid, int?sessionid) { if (participantid != null) { var oSession = new SessionRepository().Get(sessionid.Value); var participant = new ParticipiantRepository().Get(participantid.Value); evaluation_pf_post ecpp = new EvaluationPFPostRepository() .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid); if (ecpp == null) { ecpp = new evaluation_pf_post(); } ecpp.StudentId = participantid.Value; ecpp.SessionId = sessionid.Value; ecpp.F1 = participant.Name + " " + participant.FatherName + " " + participant.Family; ecpp.F2 = participant.Email; ecpp.F4 = participant.Gender; if (participant.DateOfBirth != null) { string date = participant.DateOfBirth.Value.ToString("ddMMyyyy"); ecpp.F5_1 = date.ToArray()[1] + ""; ecpp.F5_2 = date.ToArray()[0] + ""; ecpp.F5_3 = date.ToArray()[3] + ""; ecpp.F5_4 = date.ToArray()[2] + ""; ecpp.F5_5 = date.ToArray()[7] + ""; ecpp.F5_6 = date.ToArray()[6] + ""; ecpp.F5_7 = date.ToArray()[5] + ""; ecpp.F5_8 = date.ToArray()[4] + ""; } ecpp.F6 = participant.school.SchoolName; ecpp.F7 = oSession.volunteer_profile.VolunteerName; return(View(ecpp)); } return(View()); }
public ActionResult PFPost(evaluation_pf_post ecpp) { var repo = new EvaluationPFPostRepository(); ecpp.RowId = Guid.NewGuid(); ecpp.CreatedAt = DateTime.Now; repo.Post(ecpp); var sessionrepo = new SessionRepository(); sessionrepo.SetPostEvaluationStatus(ecpp.StudentId, ecpp.SessionId); return(RedirectToAction("Index", "Session")); }