private void BindData() { DataTable categories = AdminCategories.GetCategories(sectionID); CategoryGrid.DataSource = categories; CategoryGrid.DataBind(); }
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())); } } }
private void BindData() { DataTable categories = AdminCategories.GetCategories(sectionID); CategoryGrid.DataSource = categories; CategoryGrid.DataBind(); ModifiedDate.Text = DateTime.Now.ToString(); CreatedDate.Text = DateTime.Now.ToString(); }