Example #1
0
        public dtoFileDownloadsResponse GetCommunityFilesRepoDownloads(Int64 communityId, Int64 ItemId, Int64 VersionId)
        {
            dtoFileDownloadsResponse response = new dtoFileDownloadsResponse();

            response.Success = false;

            if (communityId <= 0)
            {
                response.Downloads = null;
                response.ErrorInfo = GenericError.InvalidDataInput;
                return(response);
            }

            IList <FileRepoDownloads> ListFileRepo = (from FileRepoDownloads f in Manager.GetIQ <FileRepoDownloads>()
                                                      where f.IdCommunity == communityId && f.IdItem == ItemId && f.IdVersion == VersionId
                                                      select f).ToList();

            response.Downloads = ListFileRepo;
            response.Success   = true;
            response.ErrorInfo = GenericError.None;

            return(response);
        }
        public dtoFileDownloadsResponse GetDownloads(int Id, int VersionId, int CommunityId = -1)
        {
            dtoFileDownloadsResponse response = new dtoFileDownloadsResponse();

            response.ErrorInfo = LastError;

            if (Id > 1 && VersionId > 1)
            {
                if (CommunityId == -1 && AppContext != null && AppContext.UserContext != null && AppContext.UserContext.CurrentCommunityID >= 0)
                {
                    CommunityId = AppContext.UserContext.CurrentCommunityID;
                }

                response = Service.GetCommunityFilesRepoDownloads(CommunityId, Id, VersionId);
            }
            else
            {
                response.ErrorInfo = Adevico.APIconnection.Core.GenericError.InvalidDataInput;
            }

            CheckResponse(response);

            return(response);
        }