Esempio n. 1
0
        public async Task <DashBoardTotalCount> GetDashBoardCountsAsync()
        {
            string agencyCode         = User.UserAgency();
            DashBoardTotalCount model = new DashBoardTotalCount();
            int branchId = User.UserBranch();

            if (User.IsInRole(RoleNames.DataEntry) || User.IsInRole(RoleNames.PurshaseSpecialist))
            {
                model.processNeedAction = await _dashboardService.GetUnderEstablishedTendersCount(branchId);
            }
            else if (User.IsInRole(RoleNames.Auditer))
            {
                model.processNeedAction = await _dashboardService.GetProcessNeedsApprovalByStatusPaging(branchId, agencyCode);
            }
            else if (User.IsInRole(RoleNames.PreQualificationCommitteeManager))
            {
                int committeeId = User.SelectedCommittee();
                model.processNeedAction = await _dashboardService.GetTendersNeedApprovalForPreQualificationCommitteeManagerCount(committeeId, agencyCode);
            }
            else if (User.IsInRole(RoleNames.EtimadOfficer))
            {
                model.processNeedAction = await _dashboardService.GetProcessNeedsApprovalForEtimadOfficcer(branchId, agencyCode);
            }
            else if (User.IsInRole(RoleNames.OffersOppeningManager))
            {
                int committeeId = User.SelectedCommittee();
                model.processNeedAction = await _dashboardService.GetTendersWaitingForApproveOpeningReportCount(committeeId);
            }
            else if (User.IsInRole(RoleNames.OffersCheckManager))
            {
                int committeeId = User.SelectedCommittee();
                model.processNeedAction = await _dashboardService.GetCheckingAndAwardingStageProcessNeedsActionCount(committeeId);
            }
            else if (User.IsInRole(RoleNames.OffersOpeningAndCheckManager))
            {
                int committeeId = User.SelectedCommittee();
                model.processNeedAction = await _dashboardService.GetVROCheckingAndAwardingStageProcessNeedsActionCount(committeeId);
            }
            else if (User.IsInRole(RoleNames.OffersOpeningAndCheckSecretary))
            {
                int committeeId = User.SelectedCommittee();
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersCountForVROOpeningCheckingStage(committeeId);
            }
            else if (User.IsInRole(RoleNames.ApproveTenderAward))
            {
                model.processNeedAction = await _dashboardService.GetFinalAwardingStageProcessNeedsActionCount();
            }
            else if (User.IsInRole(RoleNames.PrePlanningAuditor))
            {
                model.processNeedAction = await _dashboardService.GetPrePlaningNeedApprovalCount(agencyCode);
            }
            else if (User.IsInRole(RoleNames.PrePlanningCreator))
            {
                model.RejectedTendersCount = await _dashboardService.GetPrePlaningRejectedCount(agencyCode);
            }
            else if (User.IsInRole(RoleNames.MonafasatBlackListCommittee))
            {
                model.processNeedAction = await _dashboardService.GetManagerBlockNeedApprovalCount();
            }
            else if (User.IsInRole(RoleNames.MonafasatBlockListSecritary))
            {
                model.processNeedAction = await _dashboardService.GetSecretaryBlockNeedApprovalCount();
            }
            //////////////////////////////////////
            model.TenderInvitationCount = await _dashboardService.GetTendersInvitationsCount(branchId);

            model.LastTenPurshaseCount = await _dashboardService.GetLastTenPurshaseCount(branchId, agencyCode);

            ////////
            if (User.IsInRole(RoleNames.DataEntry) || User.IsInRole(RoleNames.PurshaseSpecialist))
            {
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersCountForDataEntry(branchId);
            }
            else if (User.IsInRole(RoleNames.OffersOppeningSecretary))
            {
                int committeeId = User.SelectedCommittee();
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersCountForOpeningStage(committeeId);
            }
            else if (User.IsInRole(RoleNames.OffersCheckSecretary))
            {
                int committeeId = User.SelectedCommittee();
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersCountOfCheckAndAwardingStage(committeeId);
            }
            else if (User.IsInRole(RoleNames.OffersPurchaseSecretary) || User.IsInRole(RoleNames.OffersPurchaseManager))
            {
                int committeeId = User.SelectedCommittee();
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersCountOfDirectPurchaseCheckAndAwardingStage(committeeId);
            }
            else if (User.IsInRole(RoleNames.MonafasatBlockListSecritary))
            {
                model.RejectedTendersCount = await _dashboardService.GetRejectedCountBlock();
            }

            else if (User.IsInRole(RoleNames.SecretaryGrievanceCommittee))
            {
                model.RejectedTendersCount = await _dashboardService.GetRejectedTendersOfGrievenceCount(User.UserAgency());
            }
            else if (User.IsInRole(RoleNames.TechnicalCommitteeUser))
            {
                int committeeId = User.SelectedCommittee();
                int userId      = User.UserId();
                model.PendingEnquiriesCount = await _dashboardService.GetPendingEnquiriesCount(committeeId, userId);
            }
            if (User.IsInRole(RoleNames.SecretaryGrievanceCommittee))
            {
                model.RejectedTendersCount = await _dashboardService.GetRejectedEscalationsPaging(User.UserAgency());
            }
            if (User.IsInRole(RoleNames.ManagerGrievanceCommittee))
            {
                model.processNeedAction = await _dashboardService.GetTendersNeedActionOfGrievenceCount(User.UserAgency());
            }
            if (User.IsInRole(RoleNames.OffersPurchaseManager))
            {
                int committeeId = User.SelectedCommittee();
                model.processNeedAction = await _dashboardService.GetTendersNeedApprovalForDirectPurchaseCountAsync(committeeId);
            }
            return(model);
        }
Esempio n. 2
0
        public async Task <ActionResult> GetTotalCountsAsync()
        {
            DashBoardTotalCount model = await _ApiClient.GetAsync <DashBoardTotalCount>("Dashboard/GetDashBoardCountsAsync", null);

            return(Json(model));
        }