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); }
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); }
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); }