public void eliminarCliente(objClientes objCliente)
        {
            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tclientes_eliminar", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_cliente_id", OracleDbType.Int32, objCliente.Cod_Ciente, ParameterDirection.Input);

                conn.cmd.ExecuteReader();

                conn.cmd.Dispose();
                conn.connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al eliminar Cliente", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public Boolean consultarVehiculoNumeroPlaca(objVehiculoUsado objVehiculoUsado)
        {
            Boolean vehiculoUsadoEncontrado = false;

            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tvehiculo_usado_existente", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_numero_placa", OracleDbType.Varchar2, objVehiculoUsado.Numero_Placa, ParameterDirection.Input);
                conn.cmd.Parameters.Add("v_encontrado", OracleDbType.Int32, ParameterDirection.Output);

                conn.cmd.ExecuteReader();

                int vehiculoEncontradoDevuelto = Convert.ToInt32(conn.cmd.Parameters["v_encontrado"].Value.ToString());

                if (vehiculoEncontradoDevuelto > 0)
                {
                    vehiculoUsadoEncontrado = true;
                }

                conn.cmd.Dispose();
                conn.connection.Close();
                return(vehiculoUsadoEncontrado);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al consultar Vehículo Usado con la base de datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(vehiculoUsadoEncontrado);
            }
        }
        public void eliminarVehiculoNuevo(objVehiculoNuevo objVehiculoNuevo)
        {
            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tvehiculo_eliminar", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_cod_vehiculo", OracleDbType.Varchar2, objVehiculoNuevo.Cod_Vehiculo, ParameterDirection.Input);

                conn.cmd.ExecuteReader();

                conn.cmd.Dispose();
                conn.connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al eliminar Vehículo Nuevo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #4
0
        public void eliminarFactura(objFacturaVenta objFacturaVenta)
        {
            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tfactura_venta_eliminar", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_COD_FACT_VENTA", OracleDbType.Int32, objFacturaVenta.Cod_Fact_Venta, ParameterDirection.Input);

                conn.cmd.ExecuteReader();

                conn.cmd.Dispose();
                conn.connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al eliminar Factura", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        public Boolean consultarDepartamentoNombre(objDepartamentos objDepartamento)
        {
            Boolean departamentoEncontrado = false;

            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tdepartamentos_existente", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_nombre", OracleDbType.Varchar2, objDepartamento.Nombre, ParameterDirection.Input);
                conn.cmd.Parameters.Add("v_encontrado", OracleDbType.Int32, ParameterDirection.Output);

                conn.cmd.ExecuteReader();

                int departamentoEncontradoDevuelto = Convert.ToInt32(conn.cmd.Parameters["v_encontrado"].Value.ToString());

                if (departamentoEncontradoDevuelto > 0)
                {
                    departamentoEncontrado = true;
                }

                conn.cmd.Dispose();
                conn.connection.Close();
                return(departamentoEncontrado);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al consultar Departamento con la base de datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(departamentoEncontrado);
            }
        }
예제 #6
0
        public DataTable consultarEmpleados(int estado)
        {
            DataTable tablaEmpleados = new DataTable();

            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                if (estado == 1)
                {
                    conn.cmd = new OracleCommand("sp_templeados_activos_mostrar", conn.connection);
                }
                else if (estado == 2)
                {
                    conn.cmd = new OracleCommand("sp_templeados_nactivos_mostrar", conn.connection);
                }
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("c_empleados", OracleDbType.RefCursor, ParameterDirection.Output);

                OracleDataReader dataReader = conn.cmd.ExecuteReader();

                tablaEmpleados.Load(dataReader);

                conn.connection.Close();
                return(tablaEmpleados);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al consultar Empleados", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(tablaEmpleados);
            }
        }
        public void eliminarProveedor(objRepuestos objRepuestos)
        {
            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_trepuestos_eliminar", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_cod_repuesto", OracleDbType.Varchar2, objRepuestos.Cod_Repuesto, ParameterDirection.Input);

                conn.cmd.ExecuteReader();

                conn.cmd.Dispose();
                conn.connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al eliminar Repuesto", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public Boolean consultarProveedorCedulaJuridica(objProveedores objProveedor)
        {
            Boolean proveedorEncontrado = false;

            try
            {
                OracleConexion conn = new OracleConexion();
                if (conn.connection.State == ConnectionState.Closed)
                {
                    conn.connection.Open();
                }
                conn.cmd             = new OracleCommand("sp_tproveedores_existente", conn.connection);
                conn.cmd.CommandType = CommandType.StoredProcedure;

                conn.cmd.Parameters.Add("v_cedula_juridica", OracleDbType.Varchar2, objProveedor.Cedula_Juridica, ParameterDirection.Input);
                conn.cmd.Parameters.Add("v_encontrado", OracleDbType.Int32, ParameterDirection.Output);

                conn.cmd.ExecuteReader();

                int proveedorEncontradoDevuelto = Convert.ToInt32(conn.cmd.Parameters["v_encontrado"].Value.ToString());

                if (proveedorEncontradoDevuelto > 0)
                {
                    proveedorEncontrado = true;
                }

                conn.cmd.Dispose();
                conn.connection.Close();
                return(proveedorEncontrado);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error al consultar Proveedor con la base de datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(proveedorEncontrado);
            }
        }