public void GetArticleList() { List<PortalArticleListTree> lists = new List<PortalArticleListTree>(); List<PortalArticleList> lists1 = new List<PortalArticleList>(); PortalArticleListBiz biz = new PortalArticleListBiz(); lists1 = biz.Select(); PortalArticleListTreeBiz treebiz = new PortalArticleListTreeBiz(); lists = treebiz.select(lists1); PortalArticleListTree newitem = new PortalArticleListTree(); newitem.FListId = 0; newitem.FListCode = ""; newitem.FListName = "根目录"; newitem.FListOrder = 10; newitem.FParentListId = 0; newitem.children = lists; List<PortalArticleListTree> newlists = new List<PortalArticleListTree>(); newlists.Add(newitem); string datasource = treebiz.ConvertToJson(newlists); Response.Write(datasource); }
private void Getwheresql(string _listid, ref string _sqlwhere) { if (!string.IsNullOrEmpty(_sqlwhere)) { _sqlwhere += " or "; } _sqlwhere += "(FListId =" + _listid + ")"; NameValueCollection where = new NameValueCollection(); where.Add("FParentListId", _listid); PortalArticleListBiz biz = new PortalArticleListBiz(); List<PortalArticleList> lists = new List<PortalArticleList>(); lists = biz.Select(where); foreach (PortalArticleList item in lists) { Getwheresql(item.FListId.ToString(), ref _sqlwhere); } }
public void GetGridData() { string _searchcontent = ""; string _sortname = ""; string _sortdirection = ""; string _pagenumber = ""; string _pagesize = ""; _searchcontent = Parameters["psearchcontent"]; _sortname = Parameters["psortname"]; if (!string.IsNullOrEmpty(_sortname)) { sSortName = _sortname; } _sortdirection = Parameters["psortdirection"]; if (!string.IsNullOrEmpty(_sortdirection)) { sSortDirection = _sortdirection; } _pagenumber = Parameters["ppagenumber"]; if (!string.IsNullOrEmpty(_pagenumber)) { sPageIndex = Convert.ToInt32(_pagenumber); } _pagesize = Parameters["ppagesize"]; if (!string.IsNullOrEmpty(_pagesize)) { sPageSize = Convert.ToInt32(_pagesize); } List<PortalArticleList> lists = new List<PortalArticleList>(); PortalArticleListBiz biz = new PortalArticleListBiz(); string _searchtext = _searchcontent; string _parentid = Parameters["pparentid"]; string wheresql = ""; if (string.IsNullOrEmpty(_parentid) || _parentid == "0") { wheresql = "(FParentListId is null)"; } else { wheresql = "(FParentListId = " + _parentid + ")"; } if (!string.IsNullOrEmpty(_searchtext)) { wheresql += " and (FListName like '%" + _searchtext + "%')"; } NameValueCollection where = new NameValueCollection(); where.Add("condition", wheresql); NameValueCollection orderby = new NameValueCollection(); orderby.Add(_sortname, _sortdirection); Int32 totalcount = 0; lists = biz.Select(where, orderby, Convert.ToInt32(sPageIndex), Convert.ToInt32(sPageSize), out totalcount); string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount); Response.Write(datasource); }
public void GetListItem() { string id = Parameters["pid"]; PortalArticleListBiz biz = new PortalArticleListBiz(); PortalArticleList item = new PortalArticleList(); item = biz.Select(id); Response.Write(item.ToJson()); }
public void GetParentId() { string id = Parameters["pchildid"]; PortalArticleListBiz biz = new PortalArticleListBiz(); PortalArticleList item = new PortalArticleList(); item = biz.Select(id); if (item == null) { Response.Write("0"); } else { if (string.IsNullOrEmpty(item.FParentListId.ToString())) { Response.Write("0"); } else { Response.Write(item.FParentListId.ToString()); } } }