public Contacto GetContacto(int id_contacto) { try { this.cnn = new Conexion(); return(new Contacto(cnn.GetRow(string.Format("SELECT * FROM contactos WITH(NOLOCK) WHERE id_contacto = {0}", id_contacto)))); } catch (Exception ex) { throw new Exception(ex.Message); } }
public Cliente GetCliente(int id_cliente) { Cliente result = new Cliente(); try { this.cnn = new Conexion(); result = new Cliente(cnn.GetRow(string.Format("SELECT * FROM clientes WITH(NOLOCK) WHERE id_cliente = {0}", id_cliente))); if (result.id_cliente > 0) { result.contactos.AddRange(new ContactoDAL().GetContactos(id_cliente)); } } catch (Exception ex) { throw new Exception(ex.Message); } return(result); }