예제 #1
0
        public IActionResult Add(Brand brand)
        {
            var result = _brandManager.Add(brand);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
예제 #2
0
        public ActionResult Create(Brand brand)
        {
            var brandtable = brandManager.GetSome(5);

            ViewBag.brandlist = brandtable.ToList();

            if (brandManager.Add(brand))
            {
                ModelState.Clear();
                return(RedirectToAction("Create", new { success = "true" }));
            }
            var list = generalCategoryManager.GetAll();

            ViewBag.orglist = list.ToList();
            return(View(brand));
        }