コード例 #1
0
 public ActionResult GetList(FriendlyLinkQuery query)
 {
     ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
     query.JournalID = CurAuthor.JournalID;
     IList<FriendlyLinkEntity> list = service.GetFriendlyLinkList(query);
     return Json(new { list });
 }
コード例 #2
0
 public ExecResult Del(FriendlyLinkQuery query)
 {
     ExecResult execResult = new ExecResult();
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     Int64[] LinkIDs = query.LinkIDs;
     if (LinkIDs == null)
     {
         execResult.result = EnumJsonResult.failure.ToString();
         execResult.msg = "没有删除任何数据!";
         return execResult;
     }
     string msg = string.Empty;
     bool result = service.BatchDeleteFriendlyLink(LinkIDs);
     if (result)
     {
         execResult.result = EnumJsonResult.success.ToString();
         execResult.msg = "删除友情链接成功!";
     }
     else
     {
         execResult.result = EnumJsonResult.failure.ToString();
         execResult.msg = "删除友情链接失败!";
     }
     return execResult;
 }
コード例 #3
0
 public ActionResult Delete(Int64[] LinkIDs)
 {
     ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
     FriendlyLinkQuery query = new FriendlyLinkQuery();
     query.JournalID = CurAuthor.JournalID;
     query.LinkIDs = LinkIDs;
     ExecResult result = service.DelFriendlyLink(query);
     return Json(new { result = result.result, msg = result.msg });
 }
コード例 #4
0
 public ActionResult GetPageList(FriendlyLinkQuery query)
 {
     ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
     query.JournalID = CurAuthor.JournalID;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<FriendlyLinkEntity> pager = service.GetFriendlyLinkPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
コード例 #5
0
 private FriendlyLinkEntity GetModel(Int64 LinkID)
 {
     FriendlyLinkEntity model = null;
     if (LinkID > 0)
     {
         FriendlyLinkQuery query = new FriendlyLinkQuery();
         query.JournalID = CurAuthor.JournalID;
         query.LinkID = LinkID;
         ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
         model = service.GetFriendlyLinkModel(query);
     }
     if (model == null)
         model = new FriendlyLinkEntity();
     return model;
 }
コード例 #6
0
 public Pager<FriendlyLinkEntity> GetPageList(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     Pager<FriendlyLinkEntity> pager = service.GetFriendlyLinkPageList(query);
     return pager;
 }
コード例 #7
0
 public FriendlyLinkEntity GetModel(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     FriendlyLinkEntity model = service.GetFriendlyLinkModel(query.LinkID);
     return model;
 }
コード例 #8
0
 public IList<FriendlyLinkEntity> GetList(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     IList<FriendlyLinkEntity> list = service.GetFriendlyLinkList(query);
     return list;
 }
コード例 #9
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     string strSql = "SELECT LinkID,JournalID,ChannelID,SiteName,SiteUrl,LogoUrl,LinkType,SortID,AddDate,ROW_NUMBER() OVER(ORDER BY LinkID DESC) AS ROW_ID FROM dbo.FriendlyLink with(nolock)",
            sumStr = "SELECT RecordCount=COUNT(1) FROM dbo.FriendlyLink with(nolock)";
     string whereSQL = GetFriendlyLinkFilter(query);
     if (!string.IsNullOrWhiteSpace(whereSQL))
     {
         strSql += " WHERE " + whereSQL;
         sumStr += " WHERE " + whereSQL;
     }
     return db.GetPageList<FriendlyLinkEntity>(string.Format(SQL_Page_Select, strSql, query.StartIndex, query.EndIndex)
         , sumStr
         , query.CurrentPage, query.PageSize
         , (dr, pager) =>
         {
             pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
         }
         , MakeFriendlyLinkList);
 }
コード例 #10
0
 /// <summary>
 /// 获取友情链接数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<FriendlyLinkEntity> GetFriendlyLinkList(FriendlyLinkQuery query)
 {
     return FriendlyLinkBusProvider.GetFriendlyLinkList(query);
 }
コード例 #11
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     return FriendlyLinkBusProvider.GetFriendlyLinkPageList(query);
 }
コード例 #12
0
 /// <summary>
 /// 删除友情链接
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult DelFriendlyLink(FriendlyLinkQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, FriendlyLinkQuery>(GetAPIUrl(APIConstant.FRIENDLYLINK_DEL), query);
     return result;
 }
コード例 #13
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     Pager<FriendlyLinkEntity> pager = clientHelper.Post<Pager<FriendlyLinkEntity>, FriendlyLinkQuery>(GetAPIUrl(APIConstant.FRIENDLYLINK_GETPAGELIST), query);
     return pager;
 }
コード例 #14
0
 /// <summary>
 /// 获取友情链接实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public FriendlyLinkEntity GetFriendlyLinkModel(FriendlyLinkQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     FriendlyLinkEntity model = clientHelper.Post<FriendlyLinkEntity, FriendlyLinkQuery>(GetAPIUrl(APIConstant.FRIENDLYLINK_GETMODEL), query);
     return model;
 }
コード例 #15
0
 /// <summary>
 /// 获取友情链接数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<FriendlyLinkEntity> GetFriendlyLinkList(FriendlyLinkQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     IList<FriendlyLinkEntity> list = clientHelper.Post<IList<FriendlyLinkEntity>, FriendlyLinkQuery>(GetAPIUrl(APIConstant.FRIENDLYLINK_GETLIST), query);
     return list;
 }
コード例 #16
0
 /// <summary>
 /// 获取条件
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 private string GetFriendlyLinkFilter(FriendlyLinkQuery query)
 {
     StringBuilder strFilter = new StringBuilder();
     strFilter.Append(" 1=1");
     if (query.JournalID > 0)
         strFilter.AppendFormat(" and JournalID={0}", query.JournalID);
     if (query.ChannelID > 0)
         strFilter.AppendFormat(" and ChannelID={0}", query.ChannelID);
     return strFilter.ToString();
 }
コード例 #17
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     return FriendlyLinkDataAccess.Instance.GetFriendlyLinkPageList(query);
 }
コード例 #18
0
 /// <summary>
 /// 获取友情链接数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<FriendlyLinkEntity> GetFriendlyLinkList(FriendlyLinkQuery query)
 {
     string strSql = "SELECT LinkID,JournalID,ChannelID,SiteName,SiteUrl,LogoUrl,LinkType,SortID,AddDate FROM dbo.FriendlyLink with(nolock)";
     string whereSQL = GetFriendlyLinkFilter(query);
     if (!string.IsNullOrWhiteSpace(whereSQL))
     {
         strSql += " WHERE " + whereSQL;
     }
     strSql += " order by SortID";
     return db.GetList<FriendlyLinkEntity>(strSql, MakeFriendlyLinkList);
 }