Ejemplo n.º 1
0
        public async Task <IActionResult> YearlyReport(int id)
        {
            var sal = await _salary.GetById(id);

            var userp = await _userProfile.GetById(sal.UserProfileId);

            var x = await _userManager.FindByEmailAsync(userp.Email);

            var model = await _salary.GetById(sal);

            var salaryYearVM = new SalaryYearViewModel
            {
                //Months = new SelectList(await monthQuery.Distinct().ToListAsync()),
                //Years = new SelectList(await yearQuery.Distinct().ToListAsync()),
                //Gradenames = new SelectList(await gradeQuery.Distinct().ToListAsync()),
                FullName = x.FullName,
                Appuser  = await _context.Users.Where(a => a.Email == userp.Email).ToListAsync(),
                Grades   = await _context.Grades.Where(a => a.Id == userp.GradeId).ToListAsync(),
                Sals     = await _context.Salaries.Include(u => u.UserProfile).Where(a => a.Year == sal.Year).Where(a => a.UserProfileId == sal.UserProfileId).ToListAsync()


                           //Sals = await PaginatedList<Salary>.CreateAsync(salaries.AsNoTracking(), pageNumber ?? 1, pageSize)
            };

            return(View(salaryYearVM));



            //if (model != null)
            //{

            //    return View(model);
            //}
            //return View();
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> UserYearlyReport(int id)
        {
            var sal = await _salary.GetById(id);

            var userp = await _userProfile.GetById(sal.UserProfileId);

            var x = await _userManager.FindByEmailAsync(userp.Email);

            //  var model = await _salary.GetYearReport(sal);

            var salaryYearVM = new SalaryYearViewModel
            {
                FullName = x.FullName,
                Appuser  = await _context.Users.Where(a => a.Email == userp.Email).ToListAsync(),
                Grades   = await _context.Grades.Where(a => a.Id == userp.GradeId).ToListAsync(),
                Sals     = await _context.Salaries.Include(u => u.UserProfile).Where(a => a.Year == sal.Year).Where(a => a.UserProfileId == sal.UserProfileId).ToListAsync()
            };

            return(View(salaryYearVM));
        }