Beispiel #1
0
        public ActionResult Create(EditStuffsViewModel stuff)
        {
            try
            {
                if (!ModelState.IsValid)
                    return View(stuff);

                _stuffService.CreateStuff(_stuffMapper.StuffViewModelToStuff(stuff));

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Beispiel #2
0
        public ActionResult Delete(EditStuffsViewModel stuff)
        {
            try
            {
                _stuffService.DeleteStuff(stuff.Id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }