Esempio n. 1
0
        private void AddCustomer(InMemoryDB db, int customerId)
        {
            var customer = new SampleCustomerInformation()
            {
                Age        = 10,
                CustomerId = customerId,
                Name       = "Mohsen"
            };

            db.AddCustomer(customer);
        }
Esempio n. 2
0
        public void AddCustomer(SampleCustomerInformation customer)
        {
            using (SqlConnection sqlConn = new SqlConnection(_connection))
            {
                sqlConn.Open();

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

                sqlCmd.Parameters.AddWithValue("@customerId", customer.CustomerId);
                sqlCmd.Parameters.AddWithValue("@title", customer.Title);
                sqlCmd.Parameters.AddWithValue("@birthdate", customer.Birthdate.Date);
                sqlCmd.Parameters.AddWithValue("@address", customer.Address);
                sqlCmd.Parameters.AddWithValue("@job", customer.Job);

                sqlCmd.ExecuteNonQuery();
            }
        }
Esempio n. 3
0
        internal void AddCustomer(SampleCustomerInformation customer)
        {
            var shard = GetShard(customer.CustomerId.ToString());

            shard.AddCustomer(customer);
        }
Esempio n. 4
0
 public void AddCustomer(SampleCustomerInformation customer)
 {
     customers.Add(customer);
 }