public MestreFormacaoViewModel Update(MestreFormacaoViewModel obj) { BeginTransaction(); _mestreFormacaoService.Update(Mapper.Map <MestreFormacaoViewModel, MestreFormacao>(obj)); Commit(); return(obj); }
public MestreFormacaoViewModel Add(MestreFormacaoViewModel obj) { var mestreFormacao = Mapper.Map <MestreFormacaoViewModel, MestreFormacao>(obj); BeginTransaction(); _mestreFormacaoService.Add(mestreFormacao); Commit(); return(obj); }
public ActionResult Create(MestreFormacaoViewModel mestreFormacaoViewModel) { if (!ModelState.IsValid) { return(View(mestreFormacaoViewModel)); } _mestreFormacaoAppService.Add(mestreFormacaoViewModel); return(RedirectToAction("Index", new { id = mestreFormacaoViewModel.MestreId })); }
public ActionResult Edit(MestreFormacaoViewModel mestreFormacaoViewModel) { if (!ModelState.IsValid) { return(View(mestreFormacaoViewModel)); } _mestreFormacaoAppService.Update(mestreFormacaoViewModel); ViewBag.DadosMestre = _mestreAppService.GetById(mestreFormacaoViewModel.MestreId); return(RedirectToAction("Index", new { id = mestreFormacaoViewModel.MestreId })); }