Пример #1
0
        public ActionResult Edit(Guid id)
        {
            var barn     = _barnService.GetById(id);
            var barnForm = BarnForm.FromBarn(barn);

            return(View(barnForm));
        }
Пример #2
0
        public ActionResult Edit(Guid id, BarnForm barnForm)
        {
            if (!ModelState.IsValid)
            {
                return View(barnForm);
            }

            _barnService.Edit(barnForm.ToBarn());

            return RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Editado");
        }
Пример #3
0
        public ActionResult Edit(Guid id, BarnForm barnForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(barnForm));
            }

            _barnService.Edit(barnForm.ToBarn());

            return(RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Editado"));
        }
Пример #4
0
        public ActionResult Create(BarnForm barnForm)
        {
            if (!ModelState.IsValid)
            {
                return View(barnForm);
            }

            var barn = barnForm.ToBarn();

            _barnService.Create(barn);

            return RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Creado");
        }
Пример #5
0
        public ActionResult Create(BarnForm barnForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(barnForm));
            }

            var barn = barnForm.ToBarn();

            _barnService.Create(barn);

            return(RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Creado"));
        }
Пример #6
0
 public ActionResult Create()
 {
     var barnForm = new BarnForm();
     return View(barnForm);
 }
Пример #7
0
        public ActionResult Create()
        {
            var barnForm = new BarnForm();

            return(View(barnForm));
        }