public ActionResult MrshdyAfter(int?participantid, int?sessionid)
 {
     if (participantid != null)
     {
         var participant = new ParticipiantRepository().Get(participantid.Value);
         evaluation_murshadee_after ecpp = new EvaluationMurshadeeAfterRepository()
                                           .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid);
         if (ecpp == null)
         {
             ecpp = new evaluation_murshadee_after();
         }
         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());
 }
Example #2
0
        private bool CheckIsEvaluationFilled(string eveCat, int participantId, int sessionid)
        {
            bool isPrefilled  = false;
            bool isPostfilled = false;

            switch (eveCat)
            {
            case "CP":
                isPrefilled  = new EvaluationCpPreRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                isPostfilled = new EvaluationCpPostRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                break;

            case "LP":
                isPrefilled  = new EvaluationCpPreRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                isPostfilled = new EvaluationCpPostRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                break;

            case "SYC":
                isPrefilled  = new EvaluationSycPreePart1Repository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                isPostfilled = new EvaluationSycPrePart2Repository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                break;

            case "Murshdee":
                isPrefilled  = new EvaluationMurshadeeBeforeRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                isPostfilled = new EvaluationMurshadeeAfterRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                break;

            case "Safeer":
                isPrefilled  = new EvaluationSafeerPreRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                isPostfilled = new EvaluationSafeerPreRepository().Get().Any(x => x.StudentId == participantId && x.SessionId == sessionid);
                break;
            }
            return(isPrefilled && isPostfilled);
        }
        public ActionResult MrshdyAfter(evaluation_murshadee_after ecpp)
        {
            var repo = new EvaluationMurshadeeAfterRepository();

            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"));
        }