Example #1
0
        private void CreateListTable(FastTrackPage page)
        {
            IList  list         = null;
            int    currPage     = 0;
            string sortProperty = "";
            bool   descending   = false;
            Type   type         = null;

            if (propertyName != null && propertyName != "")
            {
                string pageNr = page.Request.QueryString[propertyName + "Page"];
                if (pageNr != null)
                {
                    int.TryParse(pageNr, out currPage);
                }
                list = (IList)page.GetPropertyValue(propertyName);

                sortProperty = page.Request.QueryString[propertyName + "Sort"];
                if (page.Request.QueryString[propertyName + "desc"] != null)
                {
                    descending = true;
                }

                type = page.GetListPropertyItemType(propertyName);
            }
            else
            {
                currPage     = page.CurrentPage;
                list         = page.SelectedObjects;
                sortProperty = page.SortProperty;
                descending   = page.Descending;

                type = page.SelectedType;
            }

            ArrayList sorted = list as ArrayList;

            if (sorted != null && sortProperty != null)
            {
                ObjectComparer comparer = new ObjectComparer(page.DomainController, sortProperty, descending);
                sorted.Sort(comparer);
                list = sorted;
            }

            CreateHeaderAndRows(page, list, currPage, sortProperty, descending, type);
        }
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            FastTrackPage page = this.Page as FastTrackPage;

            if (page != null)
            {
                PropertyInfo property = page.GetPropertyInfo(propertyName);
                if (property != null)
                {
                    Type type = property.PropertyType;
                    if (page.IsListProperty(property.Name))
                    {
                        type = page.GetListPropertyItemType(property.Name);
                    }
                    page.Response.Redirect(page.GetListUrl(type, this.listUrl, page.SelectedObject, propertyName));
                }
            }
        }
Example #3
0
        private void CreateListTable(FastTrackPage page)
        {
            IList list = null;
            int currPage = 0;
            string sortProperty = "";
            bool descending = false;
            Type type = null;
            if (propertyName != null && propertyName != "")
            {
                string pageNr = page.Request.QueryString[propertyName + "Page"];
                if (pageNr != null)
                    int.TryParse(pageNr, out currPage);
                list = (IList)page.GetPropertyValue(propertyName);

                sortProperty = page.Request.QueryString[propertyName + "Sort"];
                if (page.Request.QueryString[propertyName + "desc"] != null)
                    descending = true;

                type = page.GetListPropertyItemType(propertyName);
            }
            else
            {
                currPage = page.CurrentPage;
                list = page.SelectedObjects;
                sortProperty = page.SortProperty;
                descending = page.Descending;

                type = page.SelectedType;
            }

            ArrayList sorted = list as ArrayList;
            if (sorted != null && sortProperty != null)
            {
                ObjectComparer comparer = new ObjectComparer(page.DomainController, sortProperty, descending);
                sorted.Sort(comparer);
                list = sorted;
            }

            CreateHeaderAndRows(page, list, currPage, sortProperty, descending, type);
        }