Example #1
0
        public async Task <ActionResult> Availability()
        {
            var _user = await UserManager.FindByEmailAsync(User.Identity.Name);

            TutorViewModel model = await _tutorService.GetTutorAvailabilityAsync(_user);

            return(View(model));
        }
Example #2
0
        public async Task <ActionResult> Availability()
        {
            string userid = Request.QueryString["userid"] ?? "";
            //TutorService _tutorService = new TutorService();
            var _user = await UserManager.FindByEmailAsync(User.Identity.Name);

            Tutor.ViewModels.TutorViewModel model = await _tutorService.GetTutorAvailabilityAsync(_user, userid);

            return(View("Availability", model));
        }
Example #3
0
        // GET: Tutor/Session
        public async Task <ActionResult> Index()
        {
            var _user = await UserManager.FindByEmailAsync(User.Identity.Name);

            TutorViewModel model = await _tutorService.GetTutorAvailabilityAsync(_user);

            var _sessionRequests = await _tuitionService.GetSessionByTutorUserIdAsync(_user.Id);

            _sessionRequests.ForEach(x =>
            {
                model.SessionRequests.Add(new SessionRequestsViewModel()
                {
                    Session       = x,
                    TutorUserId   = x.TutorUserId,
                    StudentUserId = x.UserId,
                    StudentUser   = x.User
                });
            });

            return(View(model));
        }
Example #4
0
        // GET: Tutor/Dashboard
        public async Task <ActionResult> Index()
        {
            var _user = await UserManager.FindByEmailAsync(User.Identity.Name);

            TutorViewModel model = await _tutorService.GetTutorAvailabilityAsync(_user);

            model.SessionsList = await _sessionService.GetSessionByTutorIdAsync(_user.Id);

            AccountService accountService = new AccountService();

            if (model.SessionsList != null && model.SessionsList.Count > 0)
            {
                for (int i = 0; i < model.SessionsList.Count; i++)
                {
                    model.SessionsList[i].TutorName = await accountService.GetFullName(model.SessionsList[i].UserId);
                }
            }
            return(View(model));
        }