示例#1
0
 public void editarTramo(DTOTramo tramo, string tokenJWT)
 {
     using (var client = new HttpClient())
     {
         client.BaseAddress = new Uri(Baseurl);
         client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenJWT);
         var putTask = client.PutAsJsonAsync($"editar/linea/{tramo.IdLinea}/{tramo.IdParada}", tramo);
         putTask.Wait();
         //var result = putTask.Result;
     }
 }
示例#2
0
 public IHttpActionResult editarTramo(int IdLinea, int IdParada, [FromBody] DTOTramo tramo)
 {
     try
     {
         ETramo t = cAdmin.editarTramo(IdLinea, IdParada, tramo);
         if (t != null)
         {
             return(Ok(t));
         }
         return(Content(HttpStatusCode.NotFound, "El tramo ya existe"));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
示例#3
0
        public ETramo editarTramo(int IdLinea, int IdParada, DTOTramo tramo)
        {
            try
            {
                using (uybusEntities db = new uybusEntities())
                {
                    Tramo t = db.Tramo.Find(IdLinea, IdParada);

                    t.TiempoEstimado  = tramo.TiempoEstimado;
                    t.IdParada        = IdParada;
                    t.IdLinea         = IdLinea;
                    t.Orden           = tramo.Orden;
                    db.Entry(t).State = EntityState.Modified;
                    db.SaveChanges();
                    return(Converter.tramoAETramo(t));
                }
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
 public ETramo editarTramo(int IdLinea, int IdParada, DTOTramo tramo)
 {
     return(iTramo.editarTramo(IdLinea, IdParada, tramo));
 }