public async Task <IActionResult> Index()
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var vacations = this.vocationService.GetAllForPerson <VacationsViewModel>(user.Id);

            var model = new AllVacationsViewModel {
                Vacations = vacations
            };

            return(View(model));
        }
        public async Task <IActionResult> Employee()
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var vacantions = this.vocationService.GetAllForDepartment <VacationsViewModel>(user.DepartmentId.Value, user.Id);

            var model = new AllVacationsViewModel {
                Vacations = vacantions
            };

            return(this.View(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Index()
        {
            var user = await this.userManager.GetUserAsync(this.User);

            var companyId = this.departmentService.GetCompanyIdByDepartmentId(user.DepartmentId);

            var vacations = this.vacationsService.GetAll <VacationsViewModel>(companyId);

            var model = new AllVacationsViewModel {
                Vacations = vacations
            };

            return(View("/Areas/Manager/Views/Vacations/Employee.cshtml", model));
        }
Exemplo n.º 4
0
        public AllVacationsViewModel GetAllVacations()
        {
            var vacations = context.Vacations.Select(v => new Vacation()
            {
                Id                = v.Id,
                StartDate         = v.StartDate,
                EndDate           = v.EndDate,
                VacationCreatedOn = v.VacationCreatedOn,
                Applicant         = v.Applicant,
                Approved          = v.Approved,
                Type              = v.Type,
            });

            var model = new AllVacationsViewModel()
            {
                Vacations = vacations
            };

            return(model);
        }