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 REGION WHERE ID_REGION = " + this.Id_region; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM MARCA WHERE ID_MARCA = '" + this.Id_Marca + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM MOVIMIENTO WHERE id_movimiento = " + this.Id_Movimiento; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Fecha = dr.GetDateTime(1); this.Descripcion = dr.GetString(2); return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM COBERTURA WHERE VEHICULO_id_vehiculo = '" + this.Id_vehiculo + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Id_cobertura = dr.GetString(0); this.Nombre = dr.GetString(1); this.Deducible = dr.GetInt32(2); this.Prima = dr.GetInt32(3); return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM CARGO WHERE id_Cargo = '" + this.Id_Cargo + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); CommonBC.con.Close(); CommonBC.con.Dispose(); return(true); } catch (Exception) { CommonBC.con.Close(); CommonBC.con.Dispose(); return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM CIUDAD WHERE ID_CIUDAD = " + this.Id_ciudad; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); Region region = new Region() { Id_region = dr.GetInt32(2) }; region.Leer(); this.Region = region; return(true); } catch (Exception) { return(false); } }
public bool Leer() { try { string cmd = "SELECT * FROM VEHICULO WHERE ID_VEHICULO = '" + this.Id_vehiculo + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Patente = dr.GetString(2); this.Anio = dr.GetInt32(3); this.Valor_fiscal = dr.GetInt32(4); Modelo modelo = new Modelo() { Id_modelo = dr.GetString(6) }; modelo.Leer(); this.Modelo = modelo; 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 MODELO WHERE ID_MODELO = '" + this.Id_modelo + "'";; OracleDataReader dr = CommonBC.OracleDataReader(cmd); this.Nombre = dr.GetString(1); Marca marca = new Marca() { Id_Marca = dr.GetString(2) }; marca.Leer(); this.Marca = marca; return(true); } catch (Exception) { return(false); } }
public bool validarCliente() { try { string cmd = "SELECT * FROM CLIENTE WHERE RUT = '" + this.Rut + "'"; OracleDataReader dr = CommonBC.OracleDataReader(cmd); string pass = dr.GetString(2); CommonBC.con.Close(); if (BCrypt.Verify(this.Pass, pass)) { this.Pass = pass; return(true); } else { return(false); } } catch (Exception e) { 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); } }