public ActionResult Index()
        {
            ViewBag.Message = User.IsInRole(Role.Supervisor) ? Role.Supervisor : Role.Manager;
            var totalAddAdjustmentQty      = _stockAdjustmentRepo.GetPendingAdjustmentByType("add", ViewBag.Message).Count;
            var totalSubtractAdjustmentQty =
                _stockAdjustmentRepo.GetPendingAdjustmentByType("subtract", ViewBag.Message).Count;
            var fromList = new List <string>
            {
                DateTime.Now.AddMonths(-3).ToString("dd/MM/yyyy"),
                DateTime.Now.AddMonths(-2).ToString("dd/MM/yyyy"),
                DateTime.Now.AddMonths(-1).ToString("dd/MM/yyyy")
            };
            var dash = new SupervisorDashboardDTO
            {
                PendingPOTotalAmount       = _poRepo.GetPendingPOTotalAmount(),
                PendingPOCount             = _poRepo.GetPendingApprovalPO().Count,
                POTotalAmount              = _poRepo.GetPOTotalAmount(fromList),
                PendingStockAdjAddQty      = totalAddAdjustmentQty,
                PendingStockAdjSubtractQty = totalSubtractAdjustmentQty,
                PendingStockAdjCount       = _stockAdjustmentRepo.GetPendingAdjustmentList().Count,
                TotalDisbursementAmount    = _disbursementRepo.GetDisbursementTotalAmount(fromList),
                GetPendingAdjustmentByRole = _stockAdjustmentRepo.GetPendingAdjustmentByRole(ViewBag.Message).Count
            };

            return(View(dash));
        }
Exemplo n.º 2
0
        public async Task <SupervisorDashboardDTO> GetSupervisorDashboard()
        {
            SupervisorDashboardDTO dto = new SupervisorDashboardDTO();

            Supervisor supervisor = await this.UnitOfWork.SupervisorRepository.GetByUserId(this.requestInfo.UserId);

            dto.Package = await this.UnitOfWork.PackageRepository.GetCount();

            dto.Vehicle = await this.UnitOfWork.VehicleRepository.GetCount();

            dto.Driver = await this.UnitOfWork.DriverRepository.GetCount(supervisor);

            return(dto);
        }