Exemplo n.º 1
0
 public ActionResult DelIssueContent(Int64[] ContentIDs)
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     IssueContentQuery query = new IssueContentQuery();
     query.JournalID = CurAuthor.JournalID;
     query.contentIDs = ContentIDs;
     ExecResult result = service.DelIssueContent(query);
     return Json(new { result = result.result, msg = result.msg });
 }
Exemplo n.º 2
0
        //专辑文章
        public ActionResult Album(int? OrderType, long JChannelID, int page = 1)
        {
            IIssueFacadeService magazineService = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
            IssueContentQuery contentQuery = new IssueContentQuery();
            contentQuery.JournalID = JournalID;
            contentQuery.JChannelID = JChannelID;

            if (Convert.ToInt32(Request["Year"]) == 0)
                contentQuery.Year = null;
            else
                contentQuery.Year = Convert.ToInt32(Request["Year"]);

            if (Convert.ToInt32(Request["Issue"]) == 0)
                contentQuery.Issue = null;
            else
                contentQuery.Issue = Convert.ToInt32(Request["Issue"]);

            if (Request["Title"].ToString() == "0")
                contentQuery.Title = null;
            else
                contentQuery.Title = Request["Title"].ToString();

            if (Request["JChannelID"].ToString() == "2")
                contentQuery.Keywords = "271,272";
            else
                contentQuery.JChannelID = Convert.ToInt64(Request["JChannelID"]);
            contentQuery.CurrentPage = page;

            contentQuery.SortName = " Year DESC,Issue ";

            contentQuery.SortOrder = " DESC ";
            contentQuery.PageSize = 20;

            Pager<IssueContentEntity> pagerContentEntity = magazineService.GetIssueContentPageList(contentQuery);

            if (pagerContentEntity != null)
            {
                ViewBag.PagerInfo = Utils.GetPageNumbers(page, pagerContentEntity.TotalPage, "/Magazine/ChannelList/?Year=" + Convert.ToInt32(Request["Year"]) + "&Issue=" + Convert.ToInt32(Request["Issue"]) + "&JChannelID=" + JChannelID + "&Title=" + Request["Title"].ToString(), contentQuery.PageSize);
            }
            else
            {
                pagerContentEntity = new Pager<IssueContentEntity>();
            }
            //ViewBag.Year = Year;
            //ViewBag.Issue = Issue;
            //ViewBag.journalChannelList = HtmlHelperExtensions.GeIssueContentList(1000, Issue, Year).Count;
            return View(pagerContentEntity);
        }
Exemplo n.º 3
0
 //本期下载排行
 public ActionResult curDown(IssueContentQuery contentQuery, int page = 1)
 {
     IIssueFacadeService magazineService = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     contentQuery.JournalID = JournalID;
     contentQuery.CurrentPage = page;
     contentQuery.SortName = " Downloads ";
     contentQuery.SortOrder = " DESC ";
     contentQuery.PageSize = 10;
     Pager<IssueContentEntity> pagerContentEntity = magazineService.GetIssueContentPageList(contentQuery);
     if (pagerContentEntity != null)
     {
         ViewBag.PagerInfo = Utils.GetPageNumbers(page, pagerContentEntity.TotalPage, "/Magazine/curDown/?Year=" + contentQuery.Year + "&Issue=" + contentQuery.Issue, 10);
     }
     else
     {
         pagerContentEntity = new Pager<IssueContentEntity>();
     }
     ViewBag.Year = contentQuery.Year;
     ViewBag.Issue = contentQuery.Issue;
     return View(pagerContentEntity);
 }
Exemplo n.º 4
0
 //本期浏览排行
 public ActionResult curList(IssueContentQuery contentQuery, int page = 1)
 {
     IIssueFacadeService magazineService = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     contentQuery.JournalID = JournalID;
     contentQuery.CurrentPage = page;
     contentQuery.SortName = " Hits ";
     contentQuery.SortOrder = " DESC ";
     contentQuery.PageSize = 10;
     Pager<IssueContentEntity> pagerContentEntity = magazineService.GetIssueContentPageList(contentQuery);
     if (pagerContentEntity != null)
     {
         ViewBag.PagerInfo = Utils.GetPageNumbers(page, pagerContentEntity.TotalPage, "/Magazine/curList/?Year=" + contentQuery.Year + "&Issue=" + contentQuery.Issue, 10);
     }
     else
     {
         pagerContentEntity = new Pager<IssueContentEntity>();
     }
     ViewBag.Year = contentQuery.Year;
     ViewBag.Issue = contentQuery.Issue;
     //ViewBag.journalChannelList = HtmlHelperExtensions.GeIssueContentList(1000, ViewBag.Issue, ViewBag.Year).Count;
     return View(pagerContentEntity);
 }
Exemplo n.º 5
0
 public Pager<IssueContentEntity> GetIssueContentPageList(IssueContentQuery query)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     Pager<IssueContentEntity> pager = service.GetIssueContentPageList(query);
     return pager;
 }
Exemplo n.º 6
0
 /// <summary>
 /// 获取期刊分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<IssueContentEntity> GetIssueContentPageList(IssueContentQuery query)
 {
     return IssueDataAccess.Instance.GetIssueContentPageList(query);
 }
Exemplo n.º 7
0
 public IssueContentEntity GetIssueContentModel(IssueContentQuery query)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     IssueContentEntity model = service.GetIssueContent(query);
     return model;
 }
Exemplo n.º 8
0
 public ActionResult ShowDownloads(long ID)
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     IssueContentQuery contentQuery = new IssueContentQuery();
     contentQuery.JournalID = JournalID;
     contentQuery.contentID = ID;
     IssueContentEntity contentEntity = service.GetIssueContentModel(contentQuery);
     if (contentEntity == null)
     {
         contentEntity = new IssueContentEntity();
     }
     else
     {
         service.UpdateIssueContentHits(contentQuery);
     }
     return View(contentEntity);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获取期刊内容列表(根据期刊栏目ID)
 /// </summary>
 /// <param name="helper"></param>
 /// <param name="JChannelID">栏目ID</param>
 /// <param name="TopCount">显示条数</param>
 /// <returns></returns>
 public static IList<IssueContentEntity> GeIssueContentList(this HtmlHelper helper, long JChannelID, int TopCount)
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     IssueContentQuery query = new IssueContentQuery();
     query.JournalID = GetJournalID();
     query.JChannelID = JChannelID;
     query.PageSize = TopCount;
     query.CurrentPage = 1;
     query.SortName = " Year DESC,Issue ";
     query.SortOrder = " DESC ";
     string key = string.Format(CacheKey.SITE_GETJOURNAL_ISSUECONTENTLIST, query.JournalID, 1, JChannelID, TopCount);
     object objCacheData = CacheStrategyFactory.Instance.GetObject(key);
     Pager<IssueContentEntity> listIssueContentEntity = null;
     if (objCacheData == null)
     {
         listIssueContentEntity = service.GetIssueContentPageList(query);
     }
     else
     {
         listIssueContentEntity = (Pager<IssueContentEntity>)objCacheData;
     }
     if (listIssueContentEntity != null)
     {
         return listIssueContentEntity.ItemList;
     }
     else
     {
         return new List<IssueContentEntity>();
     }
 }
Exemplo n.º 10
0
 public bool UpdateIssueContentHtmlHits(IssueContentQuery model)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     return service.UpdateIssueContentHtmlHits(model);
 }
Exemplo n.º 11
0
 public ActionResult List(IssueContentQuery contentQuery, int page = 1)
 {
     IIssueFacadeService magazineService = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     contentQuery.JournalID = JournalID;
     contentQuery.CurrentPage = page;
     contentQuery.PageSize = 10;
     contentQuery.Authors = contentQuery.Authors == "作者姓名" ? "" : contentQuery.Authors;
     contentQuery.Keywords = contentQuery.Keywords == "关键词" ? "" : contentQuery.Keywords;
     contentQuery.Title = contentQuery.Title == "标题" ? "" : Request.QueryString["Title"];
     contentQuery.WorkUnit = contentQuery.WorkUnit == "作者单位" ? "" : contentQuery.WorkUnit;
     Pager<IssueContentEntity> pagerContentEntity = magazineService.GetIssueContentPageList(contentQuery);
     if (pagerContentEntity != null)
     {
         ViewBag.PagerInfo = Utils.GetPageNumbers(page, pagerContentEntity.TotalPage, "/Magazine/List/?Year=" + contentQuery.Year + "&Issue=" + contentQuery.Issue + "&JChannelID=" + contentQuery.JChannelID + "&Title=" + contentQuery.Title, 10);
     }
     else
     {
         pagerContentEntity = new Pager<IssueContentEntity>();
     }
     ViewBag.Year = Request.QueryString["Year"] == "" ? 0 : int.Parse(Request.QueryString["Year"]);
     ViewBag.Issue = Request.QueryString["Issue"] == "" ? 0 : int.Parse(Request.QueryString["Issue"]);
     ViewBag.journalChannelList = HtmlHelperExtensions.GeIssueContentList(1000, ViewBag.Issue, ViewBag.Year).Count;
     return View(pagerContentEntity);
 }
Exemplo n.º 12
0
 /// <summary>
 /// 获取期刊查询条件
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 private string GetIssueContentFilter(IssueContentQuery query)
 {
     StringBuilder strFilter = new StringBuilder(" JournalID=" + query.JournalID);
     if (query.Year != null)
         strFilter.Append(" and Year=").Append(query.Year.Value);
     if (query.Issue != null)
         strFilter.Append(" and Issue=").Append(query.Issue.Value);
     if (query.JChannelID != null)
         strFilter.Append(" and JChannelID=").Append(query.JChannelID.Value);
     query.Title = query.Title.TextFilter();
     if (!string.IsNullOrWhiteSpace(query.Title))
         strFilter.AppendFormat(" and Title like '%{0}%'", WKT.Common.Security.SecurityUtils.SafeSqlString(query.Title));
     query.Authors = query.Authors.TextFilter();
     if (!string.IsNullOrWhiteSpace(query.Authors))
         strFilter.AppendFormat(" and Authors like '%{0}%'", WKT.Common.Security.SecurityUtils.SafeSqlString(query.Authors));
     query.Keywords = query.Keywords.TextFilter();
     if (!string.IsNullOrWhiteSpace(query.Keywords))
         strFilter.AppendFormat(" and Keywords like '%{0}%'", WKT.Common.Security.SecurityUtils.SafeSqlString(query.Keywords));
     query.WorkUnit = query.WorkUnit.TextFilter();
     if (!string.IsNullOrWhiteSpace(query.WorkUnit))
         strFilter.AppendFormat(" and WorkUnit like '%{0}%'", WKT.Common.Security.SecurityUtils.SafeSqlString(query.WorkUnit));
     if(query.contentIDs!=null)
         strFilter.AppendFormat(" and ContentID in ({0})", string.Join(",", query.contentIDs));
     //if (query.isRegDoi != -1)
     //    strFilter.Append(" and isRegDoi=").Append(query.isRegDoi);
     if (query.IsHot)
         strFilter.AppendFormat(" and IsHot=1");
     return strFilter.ToString();
 }
Exemplo n.º 13
0
        /// <summary>
        /// 确定录用稿件列表  TODO:没有用到,备用
        /// 确定年卷期使用
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<IssueContentEntity> GetContributionIssuePageList(IssueContentQuery query)
        {
            int recordCount = 0;
            List<SqlParameter> listParameters = new List<SqlParameter>();
            StringBuilder sbSQL = new StringBuilder("SELECT i.ContentID,c.Title,c.CID,c.JournalID,c.CNumber,c.SubjectCat,c.AuthorID,c.AddDate,i.Issue,i.Year,i.Volume FROM dbo.ContributionInfo c WITH(NOLOCK) LEFT JOIN dbo.IssueContent i WITH(NOLOCK) ON c.JournalID=i.JournalID AND c.CID=i.CID WHERE c.JournalID=@JournalID AND c.Status=200");
            SqlParameter pJournalID = new SqlParameter("@JournalID", SqlDbType.BigInt);
            pJournalID.Value = query.JournalID;
            listParameters.Add(pJournalID);

            if (query.AuthorID != null && query.AuthorID > 0)
            {
                SqlParameter pAuthorID = new SqlParameter("@AuthorID", SqlDbType.BigInt);
                pAuthorID.Value = query.AuthorID.Value;
                listParameters.Add(pAuthorID);
                sbSQL.Append(" AND i.AuthorID=@AuthorID");
            }

            if (!string.IsNullOrEmpty(query.CNumber))
            {
                SqlParameter pCNumber = new SqlParameter("@CNumber", SqlDbType.VarChar, 50);
                pCNumber.Value = SecurityUtils.SafeSqlString(query.CNumber);
                listParameters.Add(pCNumber);
                sbSQL.Append(" AND c.CNumber=@CNumber");
            }
            if (query.JChannelID != null && query.JChannelID > 0)
            {
                SqlParameter pSubjectCat = new SqlParameter("@JChannelID", SqlDbType.BigInt);
                pSubjectCat.Value = query.JChannelID.Value;
                listParameters.Add(pSubjectCat);
                sbSQL.Append(" AND i.JChannelID=@JChannelID");
            }
            if (!string.IsNullOrEmpty(query.Title))
            {
                sbSQL.Append(" AND c.Title LIKE '%" + SecurityUtils.SafeSqlString(query.Title) + "%'");
            }

            if (query.Year != null && query.Year > 0)
            {
                SqlParameter pYear = new SqlParameter("@Year", SqlDbType.Int);
                pYear.Value = query.Year.Value;
                listParameters.Add(pYear);
                sbSQL.Append(" AND i.Year=@Year");
            }

            if (query.Issue != null && query.Issue > 0)
            {
                SqlParameter pIssue = new SqlParameter("@Issue", SqlDbType.Int);
                pIssue.Value = query.Issue.Value;
                listParameters.Add(pIssue);
                sbSQL.Append(" AND i.Issue=@Issue");
            }

            DataSet ds = db.PageingQuery(query.CurrentPage, query.PageSize, sbSQL.ToString(), "c.AddDate DESC", listParameters.ToArray(), ref recordCount);
            Pager<IssueContentEntity> pager = new Pager<IssueContentEntity>();
            if (ds != null && ds.Tables.Count > 0)
            {
                List<IssueContentEntity> list = new List<IssueContentEntity>();
                if (ds != null)
                {
                    IssueContentEntity cEntity = null;
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        cEntity = new IssueContentEntity();
                        cEntity.ContentID = row.IsNull("ContentID") ? 0 : (Int64)row["ContentID"];
                        cEntity.CID = row.IsNull("CID") ? 0 : (Int64)row["CID"];
                        cEntity.JournalID = (Int64)row["JournalID"];
                        cEntity.CNumber = row["CNumber"].ToString();
                        cEntity.Title = row["Title"].ToString();
                        cEntity.AuthorID = (Int64)row["AuthorID"];
                        cEntity.Year = row.IsNull("Year") ? 0 : TypeParse.ToInt(row["Year"]);
                        cEntity.Volume = row.IsNull("Volume") ? 0 : TypeParse.ToInt(row["Volume"]);
                        cEntity.Issue = row.IsNull("Issue") ? 0 : TypeParse.ToInt(row["Issue"]);
                        cEntity.AddDate = Convert.ToDateTime(row["AddDate"]);
                        list.Add(cEntity);
                    }
                }
                pager.ItemList = list;
            }
            pager.CurrentPage = query.CurrentPage;
            pager.PageSize = query.PageSize;
            pager.TotalRecords = recordCount;
            return pager;
        }
Exemplo n.º 14
0
 /// <summary>
 /// 设置录用稿件的年期
 /// </summary>
 /// <returns></returns>
 public bool SetContributionYearIssue(IssueContentQuery cEntity)
 {
     bool flag = false;
     try
     {
         DbCommand cmd = db.GetStoredProcCommand("UP_SetContributionYearIssue");
         db.AddInParameter(cmd, "@CID", DbType.Int64, cEntity.CID);
         db.AddInParameter(cmd, "@JournalID", DbType.Int64, cEntity.JournalID);
         db.AddInParameter(cmd, "@AuthorID", DbType.Int64, cEntity.AuthorID);
         db.AddInParameter(cmd, "@JChannelID", DbType.Int64, cEntity.JChannelID);
         db.AddInParameter(cmd, "@Year", DbType.Int32, cEntity.Year);
         db.AddInParameter(cmd, "@Volume", DbType.Int32, cEntity.Volume);
         db.AddInParameter(cmd, "@Issue", DbType.Int32, cEntity.Issue);
         db.ExecuteNonQuery(cmd);
         flag = true;
     }
     catch (SqlException ex)
     {
         throw ex;
     }
     return flag;
 }
Exemplo n.º 15
0
        /// <summary>
        /// 更新期刊内容浏览次数(RichHTML)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateIssueContentHtmlHits(IssueContentQuery model)
        {
            StringBuilder whereCommandText = new StringBuilder();
            whereCommandText.Append("  ContentID=@ContentID AND JournalID=@JournalID");
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" HtmlHits=HtmlHits+1");
            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.IssueContent SET {0} WHERE {1}", sqlCommandText.ToString(), whereCommandText.ToString()));
            db.AddInParameter(cmd, "@ContentID", DbType.Int64, model.contentID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, model.JournalID);

            bool result = false;
            try
            {
                db.ExecuteNonQuery(cmd);
                result = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }
Exemplo n.º 16
0
 /// <summary>
 /// 更新期刊内容浏览次数(RichHTML)
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateIssueContentHtmlHits(IssueContentQuery model)
 {
     return IssueDataAccess.Instance.UpdateIssueContentHtmlHits(model);
 }
Exemplo n.º 17
0
 /// <summary>
 /// 更新期刊内容下载次数
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateIssueContentDownloads(IssueContentQuery model)
 {
     return IssueDataAccess.Instance.UpdateIssueContentDownloads(model);
 }
Exemplo n.º 18
0
 /// <summary>
 /// 设置录用稿件的年期
 /// </summary>
 /// <returns></returns>
 public bool SetContributionYearIssue(IssueContentQuery cEntity)
 {
     return IssueDataAccess.Instance.SetContributionYearIssue(cEntity);
 }
Exemplo n.º 19
0
 public ExecResult DelIssueContent(IssueContentQuery query)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     return service.DelIssueContent(query.contentIDs);
 }
Exemplo n.º 20
0
 /// <summary>
 /// 获取期刊实体
 /// </summary>
 /// <param name="contentID"></param>
 /// <returns></returns>
 public IssueContentEntity GetIssueContent(IssueContentQuery query)
 {
     IssueContentEntity issueContentEntity = null;
     string strSql = "SELECT TOP 1 * FROM dbo.vw_IssueContent WITH(NOLOCK) WHERE ContentID=@ContentID AND JournalID=@JournalID";
     DbCommand cmd = db.GetSqlStringCommand(strSql);
     db.AddInParameter(cmd, "@ContentID", DbType.Int64, query.contentID);
     db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         if (dr.Read())
             issueContentEntity = MakeIssueContent(dr);
         dr.Close();
     }
     return issueContentEntity;
 }
Exemplo n.º 21
0
 public ExecResult SetContributionYearIssue(IssueContentQuery cEntity)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     return service.SetContributionYearIssue(cEntity);
 }
Exemplo n.º 22
0
 /// <summary>
 /// 获取期刊数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<IssueContentEntity> GetIssueContentList(IssueContentQuery query)
 {
     string strSql = "SELECT * FROM dbo.vw_IssueContent with(nolock)";
     string whereSQL = GetIssueContentFilter(query);
     if (!string.IsNullOrWhiteSpace(whereSQL))
     {
         strSql += " WHERE " + whereSQL;
     }
     strSql += " ORDER BY " + query.OrderStr;
     return db.GetList<IssueContentEntity>(strSql, MakeIssueContentList);
 }
Exemplo n.º 23
0
 public ActionResult GetIssueContentList(IssueContentQuery query)
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     query.JournalID = SiteConfig.SiteID;
     IList<IssueContentEntity> list = service.GetIssueContentList(query);
     return Json(new { list });
 }
Exemplo n.º 24
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>();
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 查看期刊
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public ActionResult Show(long ID)
        {
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
            IssueContentQuery contentQuery = new IssueContentQuery();
            contentQuery.JournalID = JournalID;
            contentQuery.contentID = ID;
            IssueContentEntity contentEntity = service.GetIssueContentModel(contentQuery);
            if (contentEntity == null)
            {
                contentEntity = new IssueContentEntity();
            }
            else
            {
                service.UpdateIssueContentHits(contentQuery);

                # region 记录浏览日志

                if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["RecodeViewLog"]))
                {
                    try
                    {
                        IssueViewLogEntity issueLogEntity = new IssueViewLogEntity();
                        issueLogEntity.ContentID = ID;
                        issueLogEntity.JournalID = JournalID;
                        issueLogEntity.IP = Utils.GetRealIP();
                        issueLogEntity.Daytime = TypeParse.ToInt(DateTime.Now.ToString("yyyyMMdd"));
                        issueLogEntity.Year = DateTime.Now.Year;
                        issueLogEntity.Month = DateTime.Now.Month;
                        issueLogEntity.AuthorID = 0;
                        service.SaveViewLog(issueLogEntity);
                    }
                    catch
                    {
                    }
                }
                # endregion
            }
            return View(contentEntity);
        }
Exemplo n.º 26
0
 public IList<IssueContentEntity> GetIssueContentList(IssueContentQuery query)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     IList<IssueContentEntity> list = service.GetIssueContentList(query);
     return list;
 }
Exemplo n.º 27
0
 /// <summary>
 /// 历史点击排行
 /// </summary>
 /// <param name="contentQuery"></param>
 /// <param name="year1"></param>
 /// <param name="year2"></param>
 /// <param name="page"></param>
 /// <returns></returns>
 public ActionResult ShowOrder(IssueContentQuery contentQuery, int year1, int year2, int page = 1)
 {
     IIssueFacadeService magazineService = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     contentQuery.JournalID = JournalID;
     contentQuery.CurrentPage = page;
     contentQuery.PageSize = 20;
     contentQuery.SortName = " Hits ";
     contentQuery.SortOrder = " DESC ";
     contentQuery.Year = year1;
     contentQuery.Volume = year2;
     contentQuery.Authors = contentQuery.Authors == "作者姓名" ? "" : contentQuery.Authors;
     contentQuery.Keywords = contentQuery.Keywords == "关键词" ? "" : contentQuery.Keywords;
     contentQuery.Title = contentQuery.Title == "标题" ? "" : contentQuery.Title;
     contentQuery.WorkUnit = contentQuery.WorkUnit == "作者单位" ? "" : contentQuery.WorkUnit;
     Pager<IssueContentEntity> pagerContentEntity = magazineService.GetIssueContentPageList(contentQuery);
     if (pagerContentEntity != null)
     {
         ViewBag.PagerInfo = Utils.GetPageNumbers(page, pagerContentEntity.TotalPage, "/Magazine/ShowOrder?year1=" + contentQuery.Year + "&year2=" + contentQuery.Volume + "&JChannelID=1", 10);
     }
     else
     {
         pagerContentEntity = new Pager<IssueContentEntity>();
     }
     return View(pagerContentEntity);
 }
Exemplo n.º 28
0
        public IList<IssueContentEntity> GetIssueContentList2(int Year,int Issue)
        {
            IssueContentQuery query = new IssueContentQuery();
            query.Year = Year;
            query.Issue = Issue;

            IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
            IList<IssueContentEntity> list = service.GetIssueContentList(query);
            return list;
        }
Exemplo n.º 29
0
        /// <summary>
        /// 获取期刊分页数据
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<IssueContentEntity> GetIssueContentPageList(IssueContentQuery query)
        {
            if (query.contentIDs!=null&&query.contentIDs.Length > 0)
            {
                string strSql = "SELECT *,ROW_NUMBER() OVER(ORDER BY " + query.OrderStr + ") AS ROW_ID FROM dbo.vw_IssueContent with(nolock)"
                , sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.vw_IssueContent with(nolock)";
                string whereSQL = string.Format(" ContentID in ({0})", string.Join(",", query.contentIDs));// "ContentID in (" + query.Keywords + ")";
                if (!string.IsNullOrWhiteSpace(whereSQL))
                {
                    strSql += " WHERE " + whereSQL;
                    sumStr += " WHERE " + whereSQL;
                }
                return db.GetPageList<IssueContentEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
                    , sumStr
                    , query.CurrentPage, query.PageSize
                    , (dr, pager) =>
                    {
                        pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                    }
                    , MakeIssueContentList);
            }

            else if (query.JChannelID == -1)//地震学报(合并摘要所用),Keywords用于存储文章ID列表
            {
                string strSql = "SELECT *,ROW_NUMBER() OVER(ORDER BY " + query.OrderStr + ") AS ROW_ID FROM dbo.vw_IssueContent with(nolock)"
                , sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.vw_IssueContent with(nolock)";
                string whereSQL = "ContentID in (" + query.Keywords + ")";
                if (!string.IsNullOrWhiteSpace(whereSQL))
                {
                    strSql += " WHERE " + whereSQL;
                    sumStr += " WHERE " + whereSQL;
                }
                return db.GetPageList<IssueContentEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
                    , sumStr
                    , query.CurrentPage, query.PageSize
                    , (dr, pager) =>
                    {
                        pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                    }
                    , MakeIssueContentList);
            }
            else if (query.JChannelID == 1)//地震学报(期刊下载/查看排行所用),其中query.Volume表示年范围的第二个year2 【year1,year2】
            {
                string strSql = "SELECT *,ROW_NUMBER() OVER(ORDER BY " + query.OrderStr + ") AS ROW_ID FROM dbo.vw_IssueContent with(nolock) where Year between '" + query.Year + "' and '" + query.Volume + "'"
                , sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.vw_IssueContent with(nolock) where Year between '" + query.Year + "' and '" + query.Volume + "'";
                string whereSQL = string.Empty;
                if (query.JChannelID == 1)
                    whereSQL = "";
                else
                    whereSQL = GetIssueContentFilter(query);
                if (!string.IsNullOrWhiteSpace(whereSQL))
                {
                    strSql += " WHERE " + whereSQL;
                    sumStr += " WHERE " + whereSQL;
                }
                return db.GetPageList<IssueContentEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
                    , sumStr
                    , query.CurrentPage, query.PageSize
                    , (dr, pager) =>
                    {
                        pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                    }
                    , MakeIssueContentList);
            }
            else
            {
                string strSql = "SELECT *,ROW_NUMBER() OVER(ORDER BY " + query.OrderStr + ") AS ROW_ID FROM dbo.vw_IssueContent with(nolock)"
                , sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.vw_IssueContent with(nolock)";
                string whereSQL = GetIssueContentFilter(query);
                if (!string.IsNullOrWhiteSpace(whereSQL))
                {
                    strSql += " WHERE " + whereSQL;
                    sumStr += " WHERE " + whereSQL;
                }
                return db.GetPageList<IssueContentEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
                    , sumStr
                    , query.CurrentPage, query.PageSize
                    , (dr, pager) =>
                    {
                        pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                    }
                    , MakeIssueContentList);
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// 获取期刊实体
 /// </summary>
 /// <param name="contentID"></param>
 /// <returns></returns>
 public IssueContentEntity GetIssueContent(IssueContentQuery query)
 {
     return IssueDataAccess.Instance.GetIssueContent(query);
 }