public ActionResult AddProduct() { var category = _category.GetAll().ToList(); ViewBag.Category = new SelectList(category, "Id", "Name"); var supplier = _supplier.GetAll().ToList(); ViewBag.Supplier = new SelectList(supplier, "Id", "Name"); return(View()); }
/// <summary> /// List the methods needed for data initialization /// </summary> private void InitializeData() { _categoryBusiness = new CategoryBusiness(); categories = _categoryBusiness.GetAll(); ListCategories.ItemsSource = categories; this.DataContext = categories; }
private void dialog_Closed(object sender, System.EventArgs e) { Button_Edit.Content = "NEw Edit"; categories = _categoryBusiness.GetAll(); this.DataContext = categories; ListCategories.ItemsSource = null; ListCategories.ItemsSource = categories; }
public IHttpActionResult GetAll() { var result = _category.GetAll().Select(c => new CategoryViewModel { Id = c.Id, Name = c.Name }); return(Ok(result)); }
private void InitializeData() { LoadEdit(productViewModel); var categories = _categoryBusiness.GetAll(); LoadComboBoxCategories(categories); var suppliers = _supplierBusiness.GetAll(); LoadComboBoxSuppliers(suppliers); productViewModel.AcceptValidModel = false; }
public IActionResult Get() { try { var categories = _category.GetAll(); return(Ok(categories)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public List <Category> GetAll() { return(_categoryBusiness.GetAll()); }
public IViewComponentResult Invoke() { return(View(categoryBusiness.GetAll())); }
public IActionResult CreateProduct() { ViewBag.Categories = categoryBusiness.GetAll(); return(View()); }