Esempio n. 1
0
        public ActionResult Create(SapSystemViewModel sapSystem)
        {
            if (ModelState.IsValid)
            {
                var SapSystem = Mapper.Map<SapSystemViewModel, SapSystem>(sapSystem);
                _sapSystemApp.Add(SapSystem);

                return RedirectToAction("Index");
            }

            ViewBag.CustomerId = new SelectList(_customerApp.GetAll(), "CustomerId", "Nome", sapSystem.CustomerId);
            return View(sapSystem);
        }
Esempio n. 2
0
        public ActionResult Edit(SapSystemViewModel abapSystem)
        {
            if (ModelState.IsValid)
            {
                var produtoDomain = Mapper.Map<SapSystemViewModel, SapSystem>(abapSystem);
                _sapSystemApp.Update(produtoDomain);

                return RedirectToAction("Index");
            }

            ViewBag.CustomerId = new SelectList(_customerApp.GetAll(), "CustomerId", "Name", abapSystem.CustomerId);
            return View(abapSystem);
        }