Пример #1
0
        internal void AddOrder(SampleOrderInformation order)
        {
            using (SqlConnection sqlConn = new SqlConnection(_connection))
            {
                sqlConn.Open();

                SqlCommand sqlCmd = new SqlCommand("AddOrder", sqlConn);
                sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;

                sqlCmd.Parameters.AddWithValue("@customerId", order.CustomerId);
                sqlCmd.Parameters.AddWithValue("@count", order.Count);
                sqlCmd.Parameters.AddWithValue("@price", order.Price);
                sqlCmd.Parameters.AddWithValue("@description", order.Description);
                sqlCmd.Parameters.AddWithValue("@orderEntryDate", order.OrderEntryDate);

                sqlCmd.ExecuteNonQuery();
            }
        }
Пример #2
0
        internal void AddOrder(SampleOrderInformation order)
        {
            var shard = GetShard(order.CustomerId.ToString());

            shard.AddOrder(order);
        }