예제 #1
0
        public ActionResult Edit(ColaboradorViewModel colaborador)
        {
            if (ModelState.IsValid)
            {
                var colaboradorDomain = Mapper.Map <ColaboradorViewModel, Colaborador>(colaborador);
                _colaboradorAppServices.Update(colaboradorDomain);

                return(RedirectToAction("Index"));
            }

            return(View(colaborador));
        }
예제 #2
0
 public HttpResponseMessage Put(Colaborador colaborador)
 {
     if (colaborador == null)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
     else
     {
         _colaboradorAppServices.Update(colaborador);
         return(Request.CreateResponse(HttpStatusCode.OK, colaborador));
     }
 }