Ejemplo n.º 1
0
        public void InsertCategory_Test()
        {
            CategroyViewModel categroy = new CategroyViewModel();

            categroy.Name = "Cloth";
            var result = categroyAppService.SaveNewCategroy(categroy);

            Assert.That(result, Is.True);
        }
Ejemplo n.º 2
0
        public ActionResult Create(CategroyViewModel newCategory)
        {
            if (!ModelState.IsValid)
            {
                return(View(newCategory));
            }

            bool result = categroyAppService.SaveNewCategroy(newCategory);

            if (result == false)
            {
                ViewBag.CategoryIsExist = true;
                return(View(newCategory));
            }
            ViewBag.CategoryIsExist = false;
            return(RedirectToAction("Index"));
        }