コード例 #1
0
 public ActionResult SafferPost(int?participantid, int?sessionid)
 {
     if (participantid != null)
     {
         var participant             = new ParticipiantRepository().Get(participantid.Value);
         evaluation_safeer_post ecpp = new EvaluationSafeerPostRepository()
                                       .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid);
         if (ecpp == null)
         {
             ecpp = new evaluation_safeer_post();
         }
         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());
 }
コード例 #2
0
        public ActionResult SafferPost(evaluation_safeer_post ecpp)
        {
            var repo = new EvaluationSafeerPostRepository();

            ecpp.Rowld     = Guid.NewGuid();
            ecpp.CreatedAt = DateTime.Now;
            repo.Post(ecpp);
            var sessionrepo = new SessionRepository();

            sessionrepo.SetPostEvaluationStatus(ecpp.StudentId, ecpp.SessionId);
            return(RedirectToAction("Index", "Session"));
        }