public static List <ClientesTelefonos> GetLista() { List <ClientesTelefonos> lista = new List <ClientesTelefonos>(); var db = new Parcial2DB(); lista = db.CLientT.ToList(); return(lista); }
public static List <Clientes> GetLista(int id) { List <Clientes> lista = new List <Clientes>(); var db = new Parcial2DB(); lista = db.clientes.Where(u => u.clienteId == id).ToList(); return(lista); }
public static List <Clientes> GetList() { var lista = new List <Clientes>(); using (var db = new Parcial2DB()) { lista = db.clientes.ToList(); return(lista); } }
public static List <ClientesTelefonos> GetLis(int ClienteId) { var lista = new List <ClientesTelefonos>(); using (var conexion = new Parcial2DB()) { try { lista = conexion.CLientT.Where(ge => ge.ClienteId == ClienteId).ToList(); } catch (Exception) { } } return(lista); }
public static TiposTelefonos Buscar(int Id) { TiposTelefonos tt = new TiposTelefonos(); using (var conexion = new Parcial2DB()) { try { tt = conexion.TipoTelefono.Find(Id); } catch (Exception) { throw; } } return(tt); }
public static bool Guardar(TiposTelefonos Tipo) { bool retorno = false; Parcial2DB r = new Parcial2DB(); try { r.TipoTelefono.Add(Tipo); r.SaveChanges(); retorno = true; } catch (Exception) { throw; } return(retorno); }
public static Clientes Buscar(int Id) { Clientes Client = new Clientes(); using (var conexion = new Parcial2DB()) { try { Client = conexion.clientes.Find(Id); } catch (Exception) { throw; } } return(Client); }
public static bool Guardar(Clientes cliente) { bool retorno = false; Parcial2DB r = new Parcial2DB(); try { r.clientes.Add(cliente); r.SaveChanges(); retorno = true; } catch (Exception) { throw; } return(retorno); }
public static bool Guardar(ClientesTelefonos ct) { bool retorno = false; try { var db = new Parcial2DB(); db.CLientT.Add(ct); db.SaveChanges(); retorno = true; } catch (Exception) { throw; } return(retorno); }
public static bool Eliminar(int e) { bool r = false; using (var db = new Parcial2DB()) { try { Clientes c = db.clientes.Find(e); db.clientes.Remove(c); db.SaveChanges(); r = true; } catch (Exception) { throw; } return(r); } }