Exemplo n.º 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 });
 }
 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;
 }
Exemplo n.º 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 });
 }
Exemplo n.º 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 });
 }
Exemplo n.º 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;
 }
 public Pager<FriendlyLinkEntity> GetPageList(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     Pager<FriendlyLinkEntity> pager = service.GetFriendlyLinkPageList(query);
     return pager;
 }
 public FriendlyLinkEntity GetModel(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     FriendlyLinkEntity model = service.GetFriendlyLinkModel(query.LinkID);
     return model;
 }
 public IList<FriendlyLinkEntity> GetList(FriendlyLinkQuery query)
 {
     IFriendlyLinkService service = ServiceContainer.Instance.Container.Resolve<IFriendlyLinkService>();
     IList<FriendlyLinkEntity> list = service.GetFriendlyLinkList(query);
     return list;
 }
Exemplo n.º 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);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 获取友情链接数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<FriendlyLinkEntity> GetFriendlyLinkList(FriendlyLinkQuery query)
 {
     return FriendlyLinkBusProvider.GetFriendlyLinkList(query);
 }
Exemplo n.º 11
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     return FriendlyLinkBusProvider.GetFriendlyLinkPageList(query);
 }
 /// <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;
 }
 /// <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;
 }
 /// <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;
 }
 /// <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;
 }
Exemplo n.º 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();
 }
Exemplo n.º 17
0
 /// <summary>
 /// 获取友情链接分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FriendlyLinkEntity> GetFriendlyLinkPageList(FriendlyLinkQuery query)
 {
     return FriendlyLinkDataAccess.Instance.GetFriendlyLinkPageList(query);
 }
Exemplo n.º 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);
 }