예제 #1
0
 protected void BindCategoryList()
 {
     try
     {
         CategoryController sysmgr = new CategoryController();
         List <Category>    info   = sysmgr.Categories_List();
         info.Sort((x, y) => x.CategoryName.CompareTo(y.CategoryName));
         CategoryList.DataSource     = info;
         CategoryList.DataTextField  = nameof(Category.CategoryName);
         CategoryList.DataValueField = nameof(Category.CategoryID);
         CategoryList.DataBind();
         CategoryList.Items.Insert(0, "select...");
     }
     catch (Exception ex)
     {
         errormsgs.Add(GetInnerException(ex).ToString());
         LoadMessageDisplay(errormsgs, "alert alert-danger");
     }
 }
예제 #2
0
 protected void BindCategoryList()
 {
     //this will be a standard lookup for the Category record
     try
     {
         CategoryController sysmgr = new CategoryController();
         List<Category> info = null;
         info = sysmgr.Categories_List();
         info.Sort((x, y) => x.CategoryName.CompareTo(y.CategoryName));
         CategoryList.DataSource = info;
         CategoryList.DataTextField = nameof(Category.CategoryName);
         CategoryList.DataValueField = nameof(Category.CategoryID);
         CategoryList.DataBind();
         CategoryList.Items.Insert(0, "select...");
     }
     catch (Exception ex)
     {
         MessageLabel.Text = ex.Message;
     }
 }
예제 #3
0
 public void BindCategoryList()
 {
     //TODO: code the method to load the CategoryList control
     try
     {
         CategoryController sysmgr = new CategoryController();
         List <Category>    info   = sysmgr.Categories_List();
         info.Sort((x, y) => x.CategoryName.CompareTo(y.CategoryName));
         CategoryList.DataSource     = info;
         CategoryList.DataTextField  = nameof(Category.CategoryName);
         CategoryList.DataValueField = nameof(Category.CategoryID);
         CategoryList.DataBind();
         CategoryList.Items.Insert(0, "select ...");
     }
     catch (Exception ex)
     {
         errormsgs.Add("File Error: " + GetInnerException(ex).Message);
         LoadMessageDisplay(errormsgs, "alert alert-warning");
     }
 }
예제 #4
0
 protected void BindCategoryList()
 {
     //this will be a standard lookup for the Category records
     try
     {
         CategoryController sysmgr = new CategoryController();
         List <Category>    info   = null;
         info = sysmgr.Categories_List();
         info.Sort((x, y) => x.CategoryName.CompareTo(y.CategoryName));
         CategoryList.DataSource     = info;
         CategoryList.DataTextField  = nameof(Category.CategoryName);
         CategoryList.DataValueField = nameof(Category.CategoryID);
         CategoryList.DataBind();
         CategoryList.Items.Insert(0, "select...");
     }
     catch (Exception ex)
     {
         //using the specialized error handling DataList control
         errormsgs.Add(GetInnerException(ex).ToString());
         LoadMessageDisplay(errormsgs, "alert alert-danger");
     }
 }