Пример #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/User
        public ActionResult Index()
        {
            if (CurrentUser.UserRole.ToString() == "Rackaz")
            {
                ViewBag.IsRackaz = true;
            }
            else
            {
                ViewBag.IsRackaz = false;
            }
            var result = _traineeService.GetTrainees(CurrentUser.Area);

            if (!result.Success)
            {
                var status = new StatusModel(false, result.Message);
                return(Error(status));
            }
            return(View(result.Data));
        }
Пример #3
0
        public async Task <IActionResult> OnGet()
        {
            listTrainees = await _traineeService.GetTrainees();

            return(Page());
        }