Exemplo n.º 1
0
        private void BindData()
        {
            DataTable categories = AdminCategories.GetCategories(sectionID);

            CategoryGrid.DataSource = categories;
            CategoryGrid.DataBind();
        }
Exemplo n.º 2
0
        public static void PopulateCategoryData(int sectionID)
        {
            if (sectionID > 0)
            {
                DataTable sectionTable = AdminSections.GetSection(sectionID);
                if (sectionTable.Rows.Count > 0)
                {
                    DataRow sectionRow  = sectionTable.Rows[0];
                    string  sectionName = sectionRow["CategoryName"].ToString(); //sectionRow["CategoryDesc"].ToString();

                    DataTable categoriesDataTable = AdminCategories.GetCategories(sectionID);
                    collection = new CategoryCollection();
                    collection.Add(new Category(sectionID, 0, sectionName));
                    foreach (DataRow categoryRow in categoriesDataTable.Rows)
                    {
                        collection.Add(new Category((int)categoryRow["CategoryID"], (int)categoryRow["ParentID"], categoryRow["CategoryName"].ToString()));
                    }
                }
            }
            else
            {
                DataTable categoriesDataTable = AdminCategories.GetCategories();
                collection = new CategoryCollection();
                foreach (DataRow categoryRow in categoriesDataTable.Rows)
                {
                    collection.Add(new Category((int)categoryRow["CategoryID"], (int)categoryRow["ParentID"], categoryRow["CategoryName"].ToString()));
                }
            }
        }
Exemplo n.º 3
0
        private void BindData()
        {
            DataTable categories = AdminCategories.GetCategories(sectionID);

            CategoryGrid.DataSource = categories;
            CategoryGrid.DataBind();
            ModifiedDate.Text = DateTime.Now.ToString();
            CreatedDate.Text  = DateTime.Now.ToString();
        }