Beispiel #1
0
        // GET: api/Marca/5
        public Marca Get(int id)
        {
            MarketPersistence mp    = new MarketPersistence();
            Marca             marca = mp.getMarca(id);

            return(marca);
        }
Beispiel #2
0
        // POST: api/Marca
        public void Post([FromBody] Marca value)
        {
            MarketPersistence mp = new MarketPersistence();
            long id;

            id = mp.saveMarca(value);
        }
Beispiel #3
0
        // DELETE: api/Marca/5
        public HttpResponseMessage Delete(int id)
        {
            MarketPersistence mp = new MarketPersistence();
            bool recordExisted   = false;

            recordExisted = mp.deleteMarca(id);

            HttpResponseMessage response;

            if (recordExisted)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }
Beispiel #4
0
        // PUT: api/Marca/5
        public HttpResponseMessage Put(int id, [FromBody] Marca value)
        {
            MarketPersistence mp = new MarketPersistence();
            bool recordExisted   = false;

            recordExisted = mp.updateMarca(id, value);

            HttpResponseMessage response;

            if (recordExisted)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }
Beispiel #5
0
        // GET: api/Marca
        public ArrayList Get()
        {
            MarketPersistence mp = new MarketPersistence();

            return(mp.findAll());
        }