//SeedDatabases //Ensure that critical configuration information is present in the database //Twilio SMS messages are based on CommunicationConfigurations //Database should have a CommunicationConfiguration that sends an SMS to 14158067915 //Load Repository and query for CommunicationConfigurations. If null, create one set to 14158067915 //If not null, make sure that at least one exists where the ToAddress is 14158067915 public void ConfigureCommunicationConfigs() { IUnitOfWork uow = ObjectFactory.GetInstance <IUnitOfWork>(); CommunicationConfigurationRepository communicationConfigurationRepo = uow.CommunicationConfigurationRepository; List <CommunicationConfigurationDO> curConfigureCommunicationConfigs = communicationConfigurationRepo.GetAll().ToList(); if (curConfigureCommunicationConfigs.Find(config => config.ToAddress == CloudConfigurationManager.GetSetting("MainSMSAlertNumber")) == null) // it is not true that there is at least one commConfig that has the Main alert number { CommunicationConfigurationDO curCommConfig = new CommunicationConfigurationDO(); curCommConfig.CommunicationType = CommunicationType.Sms; curCommConfig.ToAddress = CloudConfigurationManager.GetSetting("MainSMSAlertNumber"); communicationConfigurationRepo.Add(curCommConfig); uow.SaveChanges(); } }
public void AddMainSMSAlertToDb(CommunicationConfigurationRepository communicationConfigurationRepo) { }
public void AddMainSMSAlertToDb(CommunicationConfigurationRepository communicationConfigurationRepo) { }