Ejemplo n.º 1
0
        /// <summary>
        /// 本期下载排行
        /// </summary>
        /// <param name="helper"></param>
        /// <returns></returns>
        public static IList<IssueContentEntity> GeCurIssueDownloadsOrderList(this HtmlHelper helper, int TopCount)
        {
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();

            # region 年卷期

            IssueSetQuery issuequery = new IssueSetQuery();
            issuequery.JournalID = GetJournalID();
            IssueSiteEntity issueInfoEntity = service.GetCurIssueInfo(issuequery);
            if (issueInfoEntity == null)
            {
                issueInfoEntity = new IssueSiteEntity();
                issueInfoEntity.Year = DateTime.Now.Year;
                issueInfoEntity.Volume = 1;
                issueInfoEntity.Issue = 1;
            }
            # endregion

            IssueContentQuery query = new IssueContentQuery();
            query.JournalID = GetJournalID();
            query.PageSize = TopCount;
            query.Year = issueInfoEntity.Year;
            query.Issue = issueInfoEntity.Issue;
            query.CurrentPage = 1;
            query.SortName = " Downloads ";
            query.SortOrder = " DESC ";
            Pager<IssueContentEntity> listIssueContentEntity = service.GetIssueContentPageList(query);
            if (listIssueContentEntity != null)
            {
                return listIssueContentEntity.ItemList;
            }
            else
            {
                return new List<IssueContentEntity>();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取当前期刊最新的年、卷、期、当期封面图片
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public IssueSiteEntity GetCurIssueInfo(IssueSetQuery query)
        {
            IssueSiteEntity issueInfoEntity = null;
            string sql = @"SELECT TOP 1 y.[Year],y.Volume,issue.Issue,issue.TitlePhoto
                            FROM dbo.YearVolume y WITH(NOLOCK),(SELECT TOP 1 i.JournalID,i.Issue,i.TitlePhoto FROM dbo.IssueSet i WITH(NOLOCK) WHERE i.JournalID=@JournalID AND i.Status=1 AND i.TitlePhoto<>'' AND i.TitlePhoto IS NOT NULL ORDER BY i.Issue DESC) issue
                            WHERE y.JournalID=@JournalID AND y.Status=1 ORDER BY [Year] DESC";

            DbCommand cmd = db.GetSqlStringCommand(sql);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                issueInfoEntity = new IssueSiteEntity();
                if (dr.Read())
                {
                    issueInfoEntity.Year = TypeParse.ToInt(dr["Year"], DateTime.Now.Year);
                    issueInfoEntity.Volume = TypeParse.ToInt(dr["Volume"], 0);
                    issueInfoEntity.Issue = TypeParse.ToInt(dr["Issue"], 0);
                    issueInfoEntity.TitlePhoto = dr.IsDBNull(dr.GetOrdinal("TitlePhoto")) ? "" : dr["TitlePhoto"].ToString();
                }
                dr.Close();
            }
            return issueInfoEntity;
        }
Ejemplo n.º 3
0
 public IssueSiteEntity GetCurIssueInfo()
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     IssueSetQuery query = new IssueSetQuery();
     query.JournalID = CurAuthor.JournalID;
     IssueSiteEntity issueInfoEntity = service.GetCurIssueInfo(query);
     if (issueInfoEntity == null)
     {
         issueInfoEntity = new IssueSiteEntity();
     }
     return issueInfoEntity;
 }