本文整理汇总了C#中ICustomer类的典型用法代码示例。如果您正苦于以下问题:C# ICustomer类的具体用法?C# ICustomer怎么用?C# ICustomer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICustomer类属于命名空间,在下文中一共展示了ICustomer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateCustomer
public void ValidateCustomer(ICustomer customer, String message)
{
if (customer == null)
{
throw new ArgumentException(message);
}
}
示例2: AddAppointmentDialog
public AddAppointmentDialog(ICustomer icustomer, CreateCustomerDialog createCustomerDialog, List<IAppointment> appointments)
{
this.iCustomer = icustomer;
this.ccd = createCustomerDialog;
this.appointments = appointments;
InitializeComponent();
}
示例3: Create
/// <summary>
/// Creates a Braintree <see cref="Customer"/> from a Merchello <see cref="ICustomer"/>
/// </summary>
/// <param name="customer">
/// The customer.
/// </param>
/// <param name="paymentMethodNonce">
/// The "nonce-from-the-client"
/// </param>
/// <param name="billingAddress">
/// The billing address
/// </param>
/// <param name="shippingAddress">
/// The shipping Address.
/// </param>
/// <returns>
/// The <see cref="Attempt{Customer}"/>.
/// </returns>
public Attempt<Customer> Create(ICustomer customer, string paymentMethodNonce = "", IAddress billingAddress = null, IAddress shippingAddress = null)
{
if (Exists(customer)) return Attempt.Succeed(GetBraintreeCustomer(customer));
var request = RequestFactory.CreateCustomerRequest(customer, paymentMethodNonce, billingAddress);
Creating.RaiseEvent(new Core.Events.NewEventArgs<CustomerRequest>(request), this);
// attempt the API call
var attempt = TryGetApiResult(() => BraintreeGateway.Customer.Create(request));
if (!attempt.Success) return Attempt<Customer>.Fail(attempt.Exception);
var result = attempt.Result;
if (result.IsSuccess())
{
Created.RaiseEvent(new Core.Events.NewEventArgs<Customer>(result.Target), this);
return Attempt.Succeed((Customer)RuntimeCache.GetCacheItem(MakeCustomerCacheKey(customer), () => result.Target));
}
var error = new BraintreeApiException(result.Errors);
LogHelper.Error<BraintreeCustomerApiService>("Braintree API Customer Create return a failure", error);
return Attempt<Customer>.Fail(error);
}
示例4: Commerce
public Commerce(IBillingProcessor billingProcessor, ICustomer customer, INotifier notifier, ILogger logger)
{
_BillingProcessor = billingProcessor;
_Customer = customer;
_Notifier = notifier;
_Logger = logger;
}
示例5: Deposit
public Deposit(ICustomer customer, float amount, DateTime endDate)
{
Amount = amount;
EndDate = endDate;
Customer = customer;
History = new List<IOperationHistory>();
}
示例6: FullyRegister
private void FullyRegister(ISet behaviour, ICustomer customer)
{
Debug.WriteLine("Perform full customer registration");
behaviour.Perform()
.Given(customer.Register);
//.And(customer...)
}
示例7: CreateBooking
public IBooking CreateBooking(ISupplier supplier, ICustomer customer, string sale, int bookingNumber,
DateTime StartDate, DateTime EndDate)
{
//Calls Bookingcollection class for create
return bookingCollection.Create((Supplier)supplier, (Customer)customer, sale, bookingNumber, StartDate,
EndDate);
}
示例8: Account
public Account(int id, ICustomer customer, decimal balance, decimal interestRate, DateTime creatDate)
: this(id, customer, creatDate)
{
this.Balance = balance;
this.InterestRate = interestRate;
this.CreatedOn = DateTime.Now;
}
示例9: BankAccount
protected BankAccount(ICustomer customer,decimal balance,decimal monthlyInterestRate)
{
this.Customer = customer;
this.Balance = balance;
this.MonthlyInterestRate = monthlyInterestRate;
}
示例10: Update
public static bool Update(ICustomer customer)
{
List<ICustomer> customers = LoadAllCustomers();
ICustomer customerToBeUpdated = null;
for (int i = 0; i < customers.Count; i++)
{
ICustomer customerLoaded = customers[i];
if (customer.Id == customerLoaded.Id)
{
customerToBeUpdated = customerLoaded;
break;
}
}
if (customerToBeUpdated != null)
{
customers.Remove(customerToBeUpdated);
customers.Add(customer);
SaveAllCustomers(customers);
return true;
}
else
{
return false;
}
}
示例11: GetRules
public IEnumerable<IFinancingEligibilityRule> GetRules(ICustomer customer)
{
yield return new IsOldEnoughRule(customer.Age);
yield return new LivesInFinancingStateRule(customer.BillingStateAbbreviation);
yield return new HasNoDelinquenciesOnFileRule(customerId: customer.CustomerId, financingRepository: _financingRepository);
yield return new HasTopTierCreditScoreRule(ssn: customer.SSN, dateOfBirth: customer.DateOfBirth, financingRepository: _financingRepository);
}
示例12: Compare
public int Compare(ICustomer x, ICustomer y)
{
if (x.ArrivalTime != y.ArrivalTime) return x.ArrivalTime.CompareTo(y.ArrivalTime);
if (x.CartCount != y.CartCount) return x.CartCount.CompareTo(y.CartCount);
return x.CustomerType.CompareTo(y.CustomerType);
}
示例13: TradeAction
protected TradeAction(ICustomer customer, ISeller seller)
{
ThrowNewArgumentNullException(customer, seller);
_customer = customer;
_seller = seller;
}
示例14: Account
public Account(ICustomer owner, decimal balance, decimal interestRate)
{
this.Owner = owner;
this.Balance = balance;
this.InterestRate = interestRate;
this.openDate = DateTime.Now;
}
示例15: CustomerAddress
///TODO: We need to talk about the contstructor. An empty address does not make a lot of sense.
internal CustomerAddress(ICustomer customer, string label)
{
Mandate.ParameterNotNull(customer, "customer");
Mandate.ParameterNotNull(label, "label");
_customerKey = customer.Key;
_label = label;
}