コード例 #1
0
 /// <summary>
 /// Saves the current customer
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello Context.
 /// </param>
 /// <param name="customer">
 /// The customer.
 /// </param>
 /// <param name="raiseEvents">
 /// The raise Events.
 /// </param>
 protected static void SaveCustomer(IMerchelloContext merchelloContext, ICustomerBase customer, bool raiseEvents = true)
 {
     if (typeof(AnonymousCustomer) == customer.GetType())
     {
         merchelloContext.Services.CustomerService.Save(customer as AnonymousCustomer, raiseEvents);
     }
     else
     {
         ((CustomerService)merchelloContext.Services.CustomerService).Save(customer as Customer, raiseEvents);
     }
 }
コード例 #2
0
 /// <summary>
 /// Saves the current customer
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello Context.
 /// </param>
 /// <param name="customer">
 /// The customer.
 /// </param>
 private static void SaveCustomer(IMerchelloContext merchelloContext, ICustomerBase customer)
 {
     if (typeof(AnonymousCustomer) == customer.GetType())
     {
         merchelloContext.Services.CustomerService.Save(customer as AnonymousCustomer);
     }
     else
     {
         ((CustomerService)merchelloContext.Services.CustomerService).Save(customer as Customer);
     }
 }
コード例 #3
0
 /// <summary>
 /// Saves the current customer
 /// </summary>
 /// <param name="merchelloContext">
 /// The merchello Context.
 /// </param>
 /// <param name="customer">
 /// The customer.
 /// </param>
 private static void SaveCustomer(IMerchelloContext merchelloContext, ICustomerBase customer)
 {
     if (typeof(AnonymousCustomer) == customer.GetType())
     {
         merchelloContext.Services.CustomerService.Save(customer as AnonymousCustomer);
     }
     else
     {
         ((CustomerService)merchelloContext.Services.CustomerService).Save(customer as Customer);
     }
 }