public ActionResult Index(string container, string entitySetName, string downloadID)
        {
            // increment the download
            EntitySet entitySet = EntitySetRepository.GetEntitySet(container, entitySetName);

            viewDataModel.EntitySetWrapper = new EntitySetWrapper()
            {
                EntitySet = entitySet
            };

            viewDataModel.EntitySetWrapper.RegisterDownload(downloadID);


            // get the download information

            // the download link information is there but it's in a list and I'm not sure which one to grab. The id is not in the list to match
            // just retrieve the download id?  Can match any other way?

            var downloadLink = "";

            // loop through download link list
            foreach (OrderedDictionary download in entitySet.DownloadLinks)
            {
                if (download["ID"].ToString() == downloadID)
                {
                    downloadLink = download["Link"].ToString();
                    break;
                }
            }


            // send them off to the download
            return(Redirect(downloadLink));
        }
Ejemplo n.º 2
0
        private void LoadControls(string container, string entitySetName)
        {
            model.ViewDataModel = new DataBrowserModel();
            model.ViewDataModel.EntitySetName = entitySetName;
            model.ViewDataModel.Container     = container;

            EntitySet entitySet = EntitySetRepository.GetEntitySet(container, entitySetName);

            var viewDs = new DatasetInfoDataSource();
            var views  = viewDs.GetAnalyticSummary(Helper.GenerateDatasetItemKey(entitySet.ContainerAlias, entitySet.EntitySetName));

            model.ViewDataModel.EntitySetWrapper = new EntitySetWrapper()
            {
                EntitySet     = entitySet,
                PositiveVotes = views.PositiveVotes,
                NegativeVotes = views.NegativeVotes,
                Views         = views.views_total
            };

            if (!entitySet.IsDownloadOnly && !entitySet.IsEmpty)
            {
                EntitySetDetails metaDataDetails = EntitySetDetailsRepository.GetMetaData(container, entitySetName);
                model.ViewDataModel.EntitySetDetails = metaDataDetails;
            }
        }