コード例 #1
0
        public bool AddCustomer(CustomerBasicDetails customer)
        {
            try
            {
                using (var dataContract = new CustomerContract())
                {
                    using (var scope = new TransactionScope())
                    {
                        Guid customerId = Guid.NewGuid();
                        var  isSaved    = dataContract.AddNewCoustomer(customer, customerId);
                        if (isSaved)
                        {
                            new CustomerAttributeServices().AddCustomerAddress(customer, customerId);
                            new PasswordServices().CreateAccountPassword(customerId, customer.Password);
                            new OtpServicescs().SendOTP(new OtpDetailsModel {
                                Email = customer.Email, RefCustomerGuid = customerId, CustomerName = customer.FirstName + " " + customer.LastName, Prupose = "RegisterUser"
                            });
                        }
                        scope.Complete();

                        return(true);
                    }
                }
            }
            catch
            {
                throw;
            }
        }