Exemplo n.º 1
0
        public static TipoTelefonoes Buscar(int id)
        {
            Contexto       db       = new Contexto();
            TipoTelefonoes telefono = new TipoTelefonoes();

            try
            {
                telefono = db.Tipo.Find(id);
            }
            catch (Exception)
            {
                throw;
            }
            return(telefono);
        }
Exemplo n.º 2
0
        public static bool Modificar(TipoTelefonoes telefono)
        {
            bool     paso = false;
            Contexto db   = new Contexto();

            try
            {
                db.Entry(telefono).State = System.Data.Entity.EntityState.Modified;
                if (db.SaveChanges() > 0)
                {
                    paso = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(paso);
        }
Exemplo n.º 3
0
        public static bool Guardar(TipoTelefonoes telefono)
        {
            bool     paso = false;
            Contexto db   = new Contexto();

            try
            {
                if (db.Tipo.Add(telefono) != null)
                {
                    db.SaveChanges();
                    paso = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(paso);
        }