public void AddServiceToAccountType(int accountTypeId, int serviceTypeId) { var accountType = AccountTypeRepository.GetAccountType(accountTypeId); if (accountType == null) { throw new ArgumentException("accountTypeId"); } var serviceType = AccountTypeRepository.GetServiceType(serviceTypeId); if (serviceType == null) { throw new ArgumentException("serviceTypeId"); } var newService = new Data.Graph.AccountTypeService(); newService.ServiceType = serviceType; newService.DefaultEstimatedTime = 0; newService.DefaultRate = 0; newService.IsActive = true; accountType.AddService(newService); AccountTypeRepository.SaveAccountType(accountType); }
public void AddServiceToAccountType(int accountTypeId, int serviceTypeId) { var accountType = AccountTypeRepository.GetAccountType(accountTypeId); if (accountType == null) throw new ArgumentException("accountTypeId"); var serviceType = AccountTypeRepository.GetServiceType(serviceTypeId); if (serviceType == null) throw new ArgumentException("serviceTypeId"); var newService = new Data.Graph.AccountTypeService(); newService.ServiceType = serviceType; newService.DefaultEstimatedTime = 0; newService.DefaultRate = 0; newService.IsActive = true; accountType.AddService(newService); AccountTypeRepository.SaveAccountType(accountType); }