public ActionResult SafeerPre(int?participantid, int?sessionid)
 {
     if (participantid != null)
     {
         var participant            = new ParticipiantRepository().Get(participantid.Value);
         evaluation_safeer_pre ecpp = new EvaluationSafeerPreRepository()
                                      .Get().FirstOrDefault(x => x.SessionId == sessionid && x.StudentId == participantid);
         if (ecpp == null)
         {
             ecpp = new evaluation_safeer_pre();
         }
         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());
 }
Exemple #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 SafeerPre(evaluation_safeer_pre ecpp)
        {
            var repo = new EvaluationSafeerPreRepository();

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