/// <summary> /// Hiển thị danh sách khách hàng /// </summary> /// <returns></returns> public ActionResult Index(int page = 1, string searchValue = "") { var model = new Models.CustomerPaginationResult() { Page = page, PageSize = AppSettings.DefaultPageSize, RowCount = CatalogBLL.Customer_Count(searchValue), Data = CatalogBLL.Customer_List(page, AppSettings.DefaultPageSize, searchValue), }; return(View(model)); }
/// <summary> /// Danh sách SelectListItem cho Customer /// </summary> /// <param name="allowSelectAll"></param> /// <returns></returns> public static List <SelectListItem> Customers(bool allowSelectAll = true) { List <SelectListItem> list = new List <SelectListItem>(); if (allowSelectAll) { list.Add(new SelectListItem() { Value = "0", Text = "-- All Customer Company Name --" }); } foreach (var customer in CatalogBLL.Customer_List()) { list.Add(new SelectListItem() { Value = customer.CustomerID.ToString(), Text = customer.CompanyName }); } return(list); }