示例#1
0
        public ActionResult Index(Area area)
        {
            var status = new StatusModel();
            var tutors = _tutorService.GetTutors(area);

            if (tutors.Success)
            {
                var trainees = _traineeService.GetTrainees(area);

                if (trainees.Success)
                {
                    var tutorTrainnee = new TutorTraineeNewYearViewModel
                    {
                        Tutors   = tutors.Data.Where(t => t.User.IsActive).ToList(),
                        Trainees = trainees.Data.Where(t => t.User.IsActive).ToList(),
                        Area     = area
                    };

                    return(View("NewYearAreaSelected", tutorTrainnee));
                }
                else
                {
                    status = trainees;
                }
            }
            else
            {
                status = tutors;
            }



            return(Error(status));
        }
示例#2
0
        // GET: Rackaz/Tutor
        public ActionResult Index()
        {
            if (CurrentUser.UserRole.ToString() == "Rackaz")
            {
                ViewBag.IsRackaz = true;
            }
            else
            {
                ViewBag.IsRackaz = false;
            }
            var result = _tutorService.GetTutors(CurrentUser.Area);

            if (!result.Success)
            {
                var status = new StatusModel(false, result.Message);
                return(Error(status));
            }
            return(View(result.Data));
        }