public ActionResult SYCPreP1(int?participantid, int?sessionid)
 {
     if (participantid != null)
     {
         var participant = new ParticipiantRepository().Get(participantid.Value);
         evaluation_syc_pre_part1 ecpp = new EvaluationSycPreePart1Repository()
                                         .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid);
         if (ecpp == null)
         {
             ecpp = new evaluation_syc_pre_part1();
         }
         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());
 }
Ejemplo n.º 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 SYCPreP1(evaluation_syc_pre_part1 ecpp)
        {
            var repo = new EvaluationSycPreePart1Repository();

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