コード例 #1
0
 public RevisorViewModel Update(RevisorViewModel obj)
 {
     BeginTransaction();
     _revisorService.Update(Mapper.Map <RevisorViewModel, Revisor>(obj));
     Commit();
     return(obj);
 }
コード例 #2
0
 public ActionResult Edit(RevisorViewModel revisorViewModel)
 {
     if (!ModelState.IsValid)
     {
         return(View(revisorViewModel));
     }
     _revisorAppService.Update(revisorViewModel);
     return(RedirectToAction("Index"));
 }
コード例 #3
0
        public RevisorViewModel Add(RevisorViewModel obj)
        {
            var revisor = Mapper.Map <RevisorViewModel, Revisor>(obj);

            BeginTransaction();
            _revisorService.Add(revisor);
            Commit();
            return(obj);
        }
コード例 #4
0
        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"));
        }