public static void Modificar(Bancas banca)
        {
            var db = new BancaDB();

            db.Entry(banca).State = EntityState.Modified;
            db.SaveChanges();
        }
예제 #2
0
        public static void EliminarBancas(int id)
        {
            var db = new AlmacenBancasDB();

            Bancas b = (from p in db.Bancas
                        where id == p.BancaId
                        select p).FirstOrDefault();

            db.Bancas.Remove(b);
            db.SaveChanges();
        }
예제 #3
0
        public static void ActualizarBancas(int id, int banqueraId, int equipoid, int Rutaid)
        {
            var db = new AlmacenBancasDB();

            Bancas b = (from p in db.Bancas
                        where id == p.BancaId
                        select p).FirstOrDefault();

            b.BanqueraId = banqueraId;
            b.EquipoId   = equipoid;
            b.RutaId     = Rutaid;
        }
        public static bool Eliminar(int Id)
        {
            bool   retorno = false;
            var    db      = new BancaDB();
            Bancas banca   = Buscar(Id);

            if (banca != null)
            {
                db.Entry(banca).State = EntityState.Deleted;
                db.SaveChanges();
                retorno = true;
            }
            return(retorno);
        }
예제 #5
0
 public static void AgregarBancas(Bancas ba)
 {
     try
     {
         using (var db = new AlmacenBancasDB())
         {
             db.Bancas.Add(ba);
             db.SaveChanges();
             db.Dispose();
         }
     }
     catch (Exception exx)
     {
         throw exx;
     }
 }
        public static bool Guardar(Bancas banca)
        {
            bool retorno = false;

            try
            {
                BancaDB db = new BancaDB();
                db.bancas.Add(banca);
                db.SaveChanges();
                retorno = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(retorno);
        }