public RevisorViewModel Update(RevisorViewModel obj) { BeginTransaction(); _revisorService.Update(Mapper.Map <RevisorViewModel, Revisor>(obj)); Commit(); return(obj); }
public ActionResult Edit(RevisorViewModel revisorViewModel) { if (!ModelState.IsValid) { return(View(revisorViewModel)); } _revisorAppService.Update(revisorViewModel); return(RedirectToAction("Index")); }
public RevisorViewModel Add(RevisorViewModel obj) { var revisor = Mapper.Map <RevisorViewModel, Revisor>(obj); BeginTransaction(); _revisorService.Add(revisor); Commit(); return(obj); }
public ActionResult Create(RevisorViewModel revisorViewModel) { var areaViewModel = _areaAppService.GetAll(); if (!ModelState.IsValid) { ViewBag.AreaId = new SelectList(areaViewModel, "AreaId", "Descricao"); return(View(revisorViewModel)); } _revisorAppService.Add(revisorViewModel); ViewBag.AreaId = new SelectList(areaViewModel, "AreaId", "Descricao"); return(RedirectToAction("Index")); }