コード例 #1
0
        public ProductsVariableCostUpdate UpdateProductVariableCost(ProductsVariableCostUpdate productsVariableCostUpdate)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("ProcedureUpdateProductsVariableCost", connection))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Parameters.AddWithValue("@VariableCostIDUpdate", productsVariableCostUpdate.ProductsVariableCostID);
                    command.Parameters.AddWithValue("@VariableCostValueUpdate", productsVariableCostUpdate.ProductsVariableCost);

                    connection.Open();
                    command.ExecuteNonQuery();
                }

                return(productsVariableCostUpdate);
            }
        }
コード例 #2
0
 public IActionResult Put([FromBody] ProductsVariableCostUpdate productsVariableCostUpdate)
 {
     return(Ok(new ProductVariableCostsDataLayer(_configuration).UpdateProductVariableCost(productsVariableCostUpdate)));
 }