private void LoadProductCategoryDropdownList() { List <ProductCategory> productCategories = _productCategoryManager.GetAll(); productCategoryDropDownList.DataSource = productCategories; productCategoryDropDownList.DataValueField = "Id"; productCategoryDropDownList.DataTextField = "Name"; productCategoryDropDownList.DataBind(); }
public void GetAll() { System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); using (ProductCategoryManager mgr = new ProductCategoryManager()) { try { DataCollection = mgr.GetAll(); RowsAffected = mgr.RowsAffected; ResultText = "Rows Affected: " + RowsAffected.ToString(); } catch (Exception ex) { PublishException(ex); } } stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. ResultText += " - RunTime " + String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); Console.WriteLine(ResultText); }
public static List <ProductCategory> GetProductCategories() { ProductCategoryManager aManager = new ProductCategoryManager(); return(aManager.GetAll().ToList()); }