public ActionResult EmployeesDashboard() { EmployeeWidgetModel model = new EmployeeWidgetModel(); try { EmployeeWidgetDto dto = empService.GetEmployeesCountSummary(); model = Mapper.Map <EmployeeWidgetDto, EmployeeWidgetModel>(dto); } catch (Exception) { } return(PartialView(model)); }
public EmployeeWidgetDto GetEmployeesCountSummary() { EmployeeWidgetDto dto = new EmployeeWidgetDto { TotalEmployees = Entities.Where(e => e.IsDeleted == false).Count(), TotalBillableEmployees = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 4 && p.IsDeleted == false).Count(), ShadowResources = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 5 && p.IsDeleted == false).Count(), BenchStrength = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 6 && p.IsDeleted == false).Count(), EmployeesOnInternalProjects = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 7 && p.IsDeleted == false).Count(), EmployeesOnLabProjects = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 8 && p.IsDeleted == false).Count(), AwaitingProposal = DataContext.ProjectAllocations.Where(p => p.AllocationTypeID == 9 && p.IsDeleted == false).Count(), }; return(dto); }