コード例 #1
0
        public ActionResult About(int id)
        {
            List <Brachi.Bussines.BusPractica.Carro> lst = new BusCars().GetCarros();

            Brachi.Bussines.BusPractica.Carro car = lst.FirstOrDefault(l => l.id_car == id);
            return(View(car));
        }
コード例 #2
0
        public HttpResponseMessage PostCarro(Carro carro)
        {
            Carro car1 = new BusCars().CreateCarro(carro);

            if (car1 != null)
            {
                return(Request.CreateResponse(HttpStatusCode.Created, car1));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, false));
        }
コード例 #3
0
        public HttpResponseMessage PutCarro(int idp, Carro carro)
        {
            int car1 = new BusCars().UpdateCarro(carro);

            if (car1 > 0)
            {
                return(Request.CreateResponse(HttpStatusCode.Accepted, true));
            }
            return(Request.CreateResponse(HttpStatusCode.NotModified, false));
        }