コード例 #1
0
        public void seleccionarPorId(EstanteEntidad estanteEntidad)
        {
            string     sql = @"Select  IdEstante,NombreEstante,IdProducto,Estado  from  Estante 
            Where (IdEstante = @IdEstante) ";
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@IdEstante", estanteEntidad.IdEstante);
            cmd.CommandText = sql;
        }
コード例 #2
0
        public void eliminar(EstanteEntidad estanteEntidad)
        {
            string     sql = @"Delete from  Estante 
            Where (@IdEstante = IdEstante) ";
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@IdEstante", estanteEntidad.IdEstante);
            cmd.CommandText = sql;
        }
コード例 #3
0
        public void insertar(EstanteEntidad estanteEntidad)
        {
            string     sql = @"Insert into Estante(NombreEstante,IdProducto,Estado) values (@NombreEstante,@IdProducto,@Estado)";
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@NombreEstante", estanteEntidad.NombreEstante);
            cmd.Parameters.AddWithValue("@IdProducto", estanteEntidad.productoEntidad.IdProducto);
            cmd.Parameters.AddWithValue("@Estado", estanteEntidad.Estado);
            cmd.CommandText = sql;
        }
コード例 #4
0
        public void actualizar(EstanteEntidad estanteEntidad)
        {
            string     sql = @"Update  Estante SET 
            NombreEstante = @NombreEstante ,IdProducto = @IdProducto ,Estado = @Estado  Where (@IdEstante =" + estanteEntidad.IdEstante + ")";
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.AddWithValue("@IdEstante", estanteEntidad.IdEstante);
            cmd.Parameters.AddWithValue("@NombreEstante", estanteEntidad.NombreEstante);
            cmd.Parameters.AddWithValue("@IdProducto", estanteEntidad.productoEntidad.IdProducto);
            cmd.Parameters.AddWithValue("@Estado", estanteEntidad.Estado);
            cmd.CommandText = sql;
        }