Esempio n. 1
0
        // GET: Schedule/Quiz
        public ActionResult Quiz(int id)
        {
            List <Quiz> quizes = null;

            try
            {
                if (Session[ConstantFields.userSession] != null)
                {
                    User           u      = (User)Session[ConstantFields.userSession];
                    ScheduleFacade usrSch = new ScheduleFacade();

                    if (!usrSch.isUserEnrolled(u.UserID, id))
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                }

                quizes = _quizFacade.GetBySchedule(id);
            }
            catch (Exception ex)
            {
                log.Error("Exception ", ex);
            }
            ViewBag.ScheduleId = id;
            return(View(quizes));
        }
Esempio n. 2
0
        public ActionResult Index(int id)
        {
            List <StudentEnrollment> lst    = null;
            StudentEnrollment        std    = null;
            ScheduleFacade           usrSch = new ScheduleFacade();

            try
            {
                if (Session[ConstantFields.userSession] != null)
                {
                    User u = (User)Session[ConstantFields.userSession];

                    if (!usrSch.isUserEnrolled(u.UserID, id))
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                UserFacade user = new UserFacade();
                lst = user.getStudentEnrollmentWithLecturerName(id);

                if (lst == null || lst.Count == 0)
                {
                    lst = user.getStudentEnrollmentWithoutLecturerName(id);
                }

                std = lst[0];
            }
            catch (Exception ex)
            {
                log.Error("Exception ", ex);
            }
            return(View(std));
        }
Esempio n. 3
0
 public ScheduleController()
 {
     _forumThreadFacade = new ForumThreadFacade();
     _quizFacade        = new QuizFacade();
     _moduleFacade      = new ModuleFacade();
     crsFacade          = new CourseFacade();
     usrFacade          = new UserFacade();
     schFacade          = new ScheduleFacade();
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            ScheduleFacade facade = new ScheduleFacade();

            var patientId = Guid.NewGuid();

            facade.AddPatient(new SurgeryPatient()
            {
                AppointmentDate = DateTime.Now, FirstName = "Matthew", LastName = "Knudsen", Id = patientId
            });

            var patient = facade.GetPatient(patientId.ToString());
        }
Esempio n. 5
0
        public ActionResult EditStudentForm(StudentEnrollment std)
        {
            try
            {
                UserSchedule   usrSch = new UserSchedule();
                ScheduleFacade sch    = new ScheduleFacade();

                if (TempData[Constant.ConstantFields.usrScheduleID] != null)
                {
                    usrSch.UserScheduleID = (int)TempData[Constant.ConstantFields.usrScheduleID];
                }

                if (TempData[Constant.ConstantFields.scheduleID] != null)
                {
                    usrSch.ScheduleID = (int)TempData[Constant.ConstantFields.scheduleID];
                }

                usrSch.UserID = std.studentSelected;
                usrSch.ObsInd = "N";

                int uId = (int)usrSch.UserID;
                int sId = (int)usrSch.ScheduleID;

                if (sch.isUserEnrolled(uId, sId))
                {
                    this.AddNotification("This student already enrolled in this course schedule. ", NotificationType.ERROR);
                    return(RedirectToAction("EditStudentSchedule", new { id = usrSch.UserScheduleID }));
                    //return RedirectToAction("Index", "Home");
                }

                schFacade.updateLectureSchedule(usrSch);

                StudentSchedule(string.Empty);
            }
            catch (Exception ex)
            {
                log.Error("Exception ex ", ex);
            }


            return(View("StudentSchedule"));
        }