Exemplo n.º 1
0
        public ActionResult Put(int id, MiniExcursionDao miniExcursion)
        {
            var affectedRows = miniExcursionDal.UpdateMiniExcursion(miniExcursion);

            if (affectedRows > 0 && id == miniExcursion.idMiniExcursion)
            {
                return(NoContent());
            }
            else
            {
                return(BadRequest("MiniExcursion has not been updated."));
            };
        }
Exemplo n.º 2
0
        public HttpResponseMessage Post([FromBody] MiniExcursionDao miniExcursion)
        {
            if (ModelState.IsValid)
            {
                miniExcursionDal.InsertMiniExcursion(miniExcursion);

                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
            else
            {
                return(new HttpResponseMessage(HttpStatusCode.BadRequest));
            }
        }