public String NavigationList() { NavigationListViewData view = new NavigationListViewData(); view.pageDataParents = new BaseFrameWork.Model.PaginationData(); view.pageDataParents.PageIndex = 1; view.pageDataParents.PageSize = 10; view.pageDataParents.PagintionJsFunction = "window.System.NavigationList.firstSearch()"; view.pageDataParents.OrderBy = "OrderCode"; string sql = "select * from dbo.Menu where ParentGuid IS NULL"; view.menuListParents = new Pagintion(sql, null, view.pageDataParents).ToList <Menu>(); view.pageDataChildren = new BaseFrameWork.Model.PaginationData(); view.pageDataChildren.PageIndex = 1; view.pageDataChildren.PageSize = 10; view.pageDataChildren.PagintionJsFunction = "window.System.NavigationList.secondSearch()"; view.pageDataChildren.OrderBy = "OrderCode"; Guid ParentGuid = view.menuListParents.Count > 0 ? view.menuListParents[0].MenuGuid : Guid.Empty; sql = "select A.*, B.Name AS ParentName from dbo.Menu AS A INNER JOIN dbo.Menu AS B ON A.ParentGuid = B.MenuGuid where A.ParentGuid = @ParentGuid"; view.menuListChildren = new Pagintion(sql, new { ParentGuid = ParentGuid }, view.pageDataChildren).ToList <Menu>(); return(PageViewHelper.LoadPage("/System/NavigationList.aspx", view)); }
public string SecondSearch(Guid parentGuid, PaginationData pd) { NavigationListViewData view = new NavigationListViewData(); view.pageDataChildren = new BaseFrameWork.Model.PaginationData(); view.pageDataChildren.PageIndex = pd.PageIndex; view.pageDataChildren.PageSize = pd.PageSize; view.pageDataChildren.PagintionJsFunction = "window.System.NavigationList.secondSearch()"; view.pageDataChildren.OrderBy = pd.OrderBy; string sql = "select A.*, B.Name AS ParentName from dbo.Menu AS A INNER JOIN dbo.Menu AS B ON A.ParentGuid = B.MenuGuid where A.ParentGuid = @ParentGuid"; view.menuListChildren = new Pagintion(sql, new { ParentGuid = parentGuid }, view.pageDataChildren).ToList <Menu>(); string table = UserControlExcutor.RenderUserControl("/System/UserControl/NavigationListSecond.ascx", view); string pagination = UserControlExcutor.RenderUserControl("/System/CommonUserControl/Pagination.ascx", view.pageDataChildren); return(JsonHelper.ToJson(new { table = table, pagination = pagination })); }
public string FirstSearch(PaginationData pd) { NavigationListViewData view = new NavigationListViewData(); view.pageDataParents = new BaseFrameWork.Model.PaginationData(); view.pageDataParents.PageIndex = pd.PageIndex; view.pageDataParents.PageSize = pd.PageSize; view.pageDataParents.PagintionJsFunction = "window.System.NavigationList.firstSearch()"; view.pageDataParents.OrderBy = pd.OrderBy; string sql = "select * from dbo.Menu where ParentGuid IS NULL"; view.menuListParents = new Pagintion(sql, null, view.pageDataParents).ToList <Menu>(); string table = UserControlExcutor.RenderUserControl("/System/UserControl/NavigationListFirst.ascx", view); string pagination = UserControlExcutor.RenderUserControl("/System/CommonUserControl/Pagination.ascx", view.pageDataParents); return(JsonHelper.ToJson(new { table = table, pagination = pagination })); }