private void AddCategories() { CategoriesManager categoriesManager = new CategoriesManager(); List <Categories> categories = categoriesManager.SelectAllCategories(); for (int i = 1; i < categories.Count; i++) { ddlCategories.Items.Add(categories[i].cCategory); } }
/// <summary> /// 创建分类 Widget /// </summary> private void CreateCategories() { divCategories.InnerHtml = string.Empty; divCategories.InnerHtml = "<header><h3 class=\"h5\">分类</h3></header>"; CategoriesManager categoriesManager = new CategoriesManager(); List <Categories> categories = categoriesManager.SelectAllCategories(); for (int i = 0; i < categories.Count; i++) { divCategories.InnerHtml += "<div class=\"item d-flex justify-content-between\"><a href=\"#\">" + categories[i].cCategory + "</a><span>" + categories[i].cSum + "</span></div>"; } }