コード例 #1
0
        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());
        }
コード例 #2
0
 /// <summary>
 /// List the methods needed for data initialization
 /// </summary>
 private void InitializeData()
 {
     _categoryBusiness          = new CategoryBusiness();
     categories                 = _categoryBusiness.GetAll();
     ListCategories.ItemsSource = categories;
     this.DataContext           = categories;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        public IHttpActionResult GetAll()
        {
            var result = _category.GetAll().Select(c => new CategoryViewModel
            {
                Id   = c.Id,
                Name = c.Name
            });

            return(Ok(result));
        }
コード例 #5
0
        private void InitializeData()
        {
            LoadEdit(productViewModel);
            var categories = _categoryBusiness.GetAll();

            LoadComboBoxCategories(categories);
            var suppliers = _supplierBusiness.GetAll();

            LoadComboBoxSuppliers(suppliers);
            productViewModel.AcceptValidModel = false;
        }
コード例 #6
0
 public IActionResult Get()
 {
     try
     {
         var categories = _category.GetAll();
         return(Ok(categories));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
コード例 #7
0
 public List <Category> GetAll()
 {
     return(_categoryBusiness.GetAll());
 }
コード例 #8
0
 public IViewComponentResult Invoke()
 {
     return(View(categoryBusiness.GetAll()));
 }
コード例 #9
0
        public IActionResult CreateProduct()
        {
            ViewBag.Categories = categoryBusiness.GetAll();

            return(View());
        }