public virtual ActionResult PromotionCustomerCategories(int id) { PromotionViewModel promotionViewModel = this.GetViewModel(id, GlobalEnums.AccessLevel.Readable); if (promotionViewModel == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ViewBag.CustomerCategories = customerCategoryRepository.GetAllCustomerCategories().Select(pt => new SelectListItem { Text = pt.Name, Value = pt.CustomerCategoryID.ToString() }).ToList(); return(View(promotionViewModel)); }
public JsonResult GetAllCustomerCategories() { var result = commodityCategoryRepository.GetAllCustomerCategories().Select(s => new { s.CustomerCategoryID, s.Name }).ToList(); return(Json(result, JsonRequestBehavior.AllowGet)); }
public void BuildSelectLists(CustomerViewModel customerViewModel) { customerViewModel.CustomerCategoryDropDown = customerCategorySelectListBuilder.BuildSelectListItemsForCustomerCategories(customerCategoryRepository.GetAllCustomerCategories()); customerViewModel.CustomerTypeDropDown = customerTypeSelectListBuilder.BuildSelectListItemsForCustomerCategories(customerTypeRepository.GetAllCustomerTypes()); }