Esempio n. 1
0
 public void Delete(BUSES obj)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             db.Entry(obj).State = EntityState.Deleted;
             db.SaveChanges();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
 public void Add(BUSES obj)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             db.BUSES.Add(obj);
             db.SaveChanges();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 public IEnumerable <BUSES> GetAll()
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             return((from t in db.BUSES
                     select t).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
 public void Update(RUTAS obj)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             db.Entry(obj).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static IEnumerable <CIUDADES> GetAllId(this RutasBLL r, WInteger id)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             return((from t in db.CIUDADES
                     where !t.IdCiudad.Equals(id.Value)
                     select t).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 6
0
 public BUSES GetById(string id)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             return((from t in db.BUSES
                     where t.IdBus.Equals(id)
                     select t).SingleOrDefault());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 7
0
 public RUTAS GetById(WInteger id)
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             return((from t in db.RUTAS
                     where t.IdRuta.Equals(id.Value)
                     select t).SingleOrDefault());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 8
0
        public CIUDADES GetById(WInteger id)
        {
            try
            {
                using (db = new PasajesBDEntities())
                {
                    return((from t in db.CIUDADES
                            where t.IdCiudad.Equals(id.Value)
                            select t).SingleOrDefault());

                    //return db.CIUDADES.Where(x => x.IdCiudad.Equals(id)).SingleOrDefault();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 9
0
 public IEnumerable <object> GetAll2()
 {
     try
     {
         using (db = new PasajesBDEntities())
         {
             return((from t in db.RUTAS
                     join ciu in db.CIUDADES
                     on t.CiudadOrigen equals ciu.IdCiudad
                     join ciu2 in db.CIUDADES
                     on t.CiudadDestino equals ciu2.IdCiudad
                     select new { idruta = t.IdRuta, ciudadOrigen = ciu.NombreCiudad, ciudadDestino = ciu2.NombreCiudad, valor = t.Valor }).ToList());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }