Beispiel #1
0
 BillingCompany IAdminBillService.CreateBillCompany(string name, BillType billTypes, Address newAddress)
 {
     if (IsBillCompanyUnique(name))
     {
         return SingleTransactionOperation(CreateBillCompany, name, billTypes, newAddress);
     }
     throw new PropertyNotUniqueException("Name", name);
 }
Beispiel #2
0
        public BillingCompany CreateBillCompany(string name, BillType billTypes, Address newAddress)
        {
            var address = ((AddressService)_addressService).CreateAddress(newAddress);
            var billCompany = new BillingCompany
            {
                Name = name,
                Address = address,
                BillTypes = billTypes
            };

            DatabaseService.Save(billCompany);
            return billCompany;
        }
Beispiel #3
0
 public Address CreateAddress(Address newaddress)
 {
     return SingleTransactionOperation(x =>
     {
         DatabaseService.Save(x);
         return x;
     }, new Address
     {
         AddressLine1 = newaddress.AddressLine1,
         AddressLine2 = newaddress.AddressLine2,
         AddressLine3 = newaddress.AddressLine3,
         Country = newaddress.Country,
         PostCode = newaddress.PostCode,
         State = newaddress.State,
         Suburb = newaddress.Suburb
     });
     
 }
Beispiel #4
0
        public void CreateAddress(ApplicationUser user, Address newAddress)
        {
            //var theUser = DatabaseService.Get<User>(user.Id);
            //if (theUser != null)
            //{
            //    theUser.Address = ((AddressService) _addressService).CreateAddress(newAddress);
            //    DatabaseService.Save(theUser);
            //}
            //else
            //{
            //    throw new EntityNotFoundException<User>(user);
            //}

        }
Beispiel #5
0
 void IUserService.CreateAddress(ApplicationUser user, Address newAddress)
 {
     SingleTransactionAction(CreateAddress, user, newAddress);
 }
Beispiel #6
0
 Address IAddressService.CreateAddress(Address newaddress)
 {
     return SingleTransactionOperation(CreateAddress, newaddress);
 }