public HttpResponseMessage Post(FilaEsperaViewModel filaEsperaViewModel)
        {
            if (ModelState.IsValid)
            {
                _filaEsperaApp.Add(filaEsperaViewModel);

                return(Request.CreateResponse(HttpStatusCode.Created, filaEsperaViewModel));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
        }
        public HttpResponseMessage Put(FilaEsperaViewModel filaEsperaViewModel)
        {
            if (ModelState.IsValid)
            {
                _filaEsperaApp.Update(filaEsperaViewModel);

                return(Request.CreateResponse(HttpStatusCode.Created, "Cadastro efetuado com sucesso!"));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
        }
Beispiel #3
0
        public void Update(FilaEsperaViewModel filaEsperaViewModel)
        {
            var filaEspera = Mapper.Map <FilaEsperaViewModel, FilaEspera>(filaEsperaViewModel);

            BeginTransaction();
            _filaEsperaService.Update(filaEspera);

            _logSistemaService.AddLog("FilaDeEspera", filaEsperaViewModel.FilaEsperaId, "Update", "");
            Commit();
        }