Exemple #1
0
        public ActionResult Create(CreateStyleViewModel model)
        {
            try
            {
                if (false == ModelState.IsValid)
                    return View(model);

                var style = _styleOrchestrator.CreateStyle(model.Name, model.Color, model.Glass);
                return RedirectToAction("Details", "Style", new {id = style.Id});
            }
            catch
            {
                return View(model);
            }
        }
Exemple #2
0
        // GET: Admin/Style/Create
        public ActionResult Create()
        {
            var viewModel = new CreateStyleViewModel();

            return View(viewModel);
        }