コード例 #1
0
        public async Task <ActionResult> ApplicationList(int pageNumber)
        {
            var edOrgs = (await _odsApiFacadeFactory.Create())
                         .GetAllEducationOrganizations(_mapper);

            var vendorsIndexModel = new VendorApplicationsIndexModel
            {
                Vendors = Page <VendorApplicationsModel> .Fetch(VendorsApplicationsModel, pageNumber)
            };

            return(PartialView("_Applications", vendorsIndexModel));

            List <VendorApplicationsModel> VendorsApplicationsModel(int offset, int limit)
            {
                var vendors = _getVendorsQuery.Execute(offset, limit).ToList();

                var vendorsApplicationsModel = _mapper.Map <List <VendorApplicationsModel> >(
                    vendors, opts => opts.WithEducationOrganizations(edOrgs));

                if (CloudOdsAdminAppSettings.Instance.Mode.SupportsMultipleInstances)
                {
                    foreach (var model in vendorsApplicationsModel)
                    {
                        FilterInstanceSpecificApplications(model);
                    }
                }

                return(vendorsApplicationsModel);
            }
        }
コード例 #2
0
    internal Task <IResult> GetApplications(IGetVendorsQuery getVendorsAndApplicationsQuery, IMapper mapper)
    {
        var vendors      = getVendorsAndApplicationsQuery.Execute();
        var applications = new List <ApplicationModel>();

        foreach (var vendor in vendors)
        {
            applications.AddRange(mapper.Map <List <ApplicationModel> >(vendor.Applications));
        }
        return(Task.FromResult(AdminApiResponse <List <ApplicationModel> > .Ok(applications)));
    }
        public ActionResult Vendors()
        {
            var vendors = _getVendorsQuery
                          .Execute();

            var model = new GlobalSettingsModel
            {
                VendorListModel = new VendorsListModel
                {
                    Vendors = _mapper.Map <List <VendorOverviewModel> >(vendors)
                },
                GlobalSettingsTabEnumerations =
                    _tabDisplayService.GetGlobalSettingsTabDisplay(
                        GlobalSettingsTabEnumeration.Vendors)
            };

            return(View(model));
        }
コード例 #4
0
        public async Task <ActionResult> ApplicationList()
        {
            var vendors = _getVendorsQuery.Execute().Where(v => !v.IsSystemReservedVendor()).ToList();

            var edOrgs = (await _odsApiFacadeFactory.Create(CloudOdsEnvironment.Production))
                         .GetAllEducationOrganizations(_mapper);

            var vendorsApplicationsModel = _mapper.Map <List <VendorApplicationsModel> >(
                vendors, opts => opts.WithEducationOrganizations(edOrgs));

            if (CloudOdsAdminAppSettings.Instance.Mode.SupportsMultipleInstances)
            {
                foreach (var model in vendorsApplicationsModel)
                {
                    FilterInstanceSpecificApplications(model);
                }
            }
            return(PartialView("_Applications", vendorsApplicationsModel));
        }
コード例 #5
0
    internal Task <IResult> GetVendors(IGetVendorsQuery getVendorsQuery, IMapper mapper)
    {
        var vendorList = mapper.Map <List <VendorModel> >(getVendorsQuery.Execute());

        return(Task.FromResult(AdminApiResponse <List <VendorModel> > .Ok(vendorList)));
    }