예제 #1
0
        public void AddСustomer(CustomerRegistrationInfo customerRegistrationInfo)
        {
            var сustomerEntity = new СustomerEntity
            {
                Login    = customerRegistrationInfo.Login,
                Password = customerRegistrationInfo.Password
            };

            if (сustomerRepository.Contains(сustomerEntity))
            {
                throw new ArgumentException("This customer has been registered. Can't continue");
            }

            this.сustomerRepository.Add(сustomerEntity);
            this.сustomerRepository.Save();
        }
 private void OnCustomerUpdate(object sender, CustomerRegistrationInfo args)
 {
     this.ViewModel.UpdateCustomer(args);
 }
 public ActionResult CreateСustomer(CustomerRegistrationInfo customerRegistrationInfo)
 {
     сustomerService.AddСustomer(customerRegistrationInfo);
     return(Ok());
 }