public bool Leer() { try { string cmd = "SELECT * FROM TALLER WHERE id_taller = " + "'" + this.Id_Taller + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); this.Fono = dr.GetString(2); this.Direccion = dr.GetString(3); Ciudad ciudad = new Ciudad() { Id_ciudad = dr.GetInt32(4) }; ciudad.Leer(); this.Ciudad = ciudad; Empleado empleado = new Empleado() { Id_Empleado = dr.GetString(5) }; empleado.Leer(); this.Empleado = empleado; return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM EMPLEADO WHERE id_empleado = '" + this.Id_Empleado + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Rut = dr.GetString(1); this.Nombres = dr.GetString(3); this.Apellidos = dr.GetString(4); this.Correo = dr.GetString(5); this.Fono = dr.GetString(6); this.FechaNacimiento = dr.GetString(7); this.Direccion = dr.GetString(8); Ciudad ciudad = new Ciudad() { Id_ciudad = dr.GetInt32(9) }; ciudad.Leer(); this.Ciudad = ciudad; Cargo cargo = new Cargo() { Id_Cargo = dr.GetInt32(10) }; Cargo.Leer(); this.Cargo = cargo; return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM SINIESTRO WHERE ID_SINIESTRO = '" + this.Id_Siniestro + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Fecha = dr.GetDateTime(1); this.Direccion = dr.GetString(3); this.Estado = dr.GetString(4); this.Patente = dr.GetString(7); Empleado empleado = new Empleado() { Id_Empleado = dr.GetString(8) }; empleado.Leer(); this.Empleado = empleado; Ciudad ciudad = new Ciudad() { Id_ciudad = dr.GetInt32(9) }; ciudad.Leer(); this.Ciudad = ciudad; Taller taller = new Taller() { Id_Taller = dr.GetString(11) }; taller.Leer(); this.Taller = taller; MovimientoColeccion movimientoColeccion = new MovimientoColeccion(); this.MovimientoColeccion = movimientoColeccion.LeerTodos(this.Id_Siniestro); return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM CLIENTE WHERE RUT = '" + this.Rut + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Id_cliente = dr.GetString(0); this.Nombres = dr.GetString(3); this.Apellidos = dr.GetString(4); this.Correo = dr.GetString(5); this.FechaNacimiento = dr.GetString(7); this.Activo = dr.GetString(8).Equals("t"); this.Direccion = dr.GetString(9); Ciudad ciudad = new Ciudad() { Id_ciudad = dr.GetInt32(10) }; ciudad.Leer(); this.Ciudad = ciudad; VehiculoColeccion vehiculoColeccion = new VehiculoColeccion(); this.VehiculoColeccion = vehiculoColeccion.LeerTodos(this.Id_cliente); SiniestroColeccion siniestroColeccion = new SiniestroColeccion(); this.SiniestroColeccion = siniestroColeccion.LeerTodos(this.Id_cliente); CommonBC.con.Close(); return(true); } catch (Exception e) { return(false); } }