public ActionResult MrshdyBefore(int?participantid, int?sessionid) { if (participantid != null) { var participant = new ParticipiantRepository().Get(participantid.Value); evaluation_murshadee_before ecpp = new EvaluationMurshadeeBeforeRepository() .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid); if (ecpp == null) { ecpp = new evaluation_murshadee_before(); } ecpp.StudentId = participantid.Value; ecpp.SessionId = sessionid.Value; ecpp.F1 = participant.school.SchoolName; ecpp.F5 = participant.Name; ecpp.F6 = participant.FatherName; ecpp.F7 = participant.Family; ecpp.F8 = participant.Mobile; ecpp.F9 = participant.Email; ecpp.F10 = participant.FacebookAddress; ecpp.F11 = participant.TwitterAddress; return(View(ecpp)); } return(View()); }
public ActionResult MrshdyBefore(evaluation_murshadee_before ecpp) { var repo = new EvaluationMurshadeeBeforeRepository(); ecpp.Rowld = Guid.NewGuid(); ecpp.CreatedAt = DateTime.Now; repo.Post(ecpp); var sessionrepo = new SessionRepository(); sessionrepo.SetPreEvaluationStatus(ecpp.StudentId, ecpp.SessionId); return(RedirectToAction("Index", "Session")); }