private async Task CreateIncidents(ISimsDbHost sims, SimsDbContext ctx, SeedingConfigData seeder) { var iManager = sims.Incidents; List <Task <BaseIncident> > TaskList = new List <Task <BaseIncident> >(); await iManager.Add(seeder.GetNewIncidents()); var coreIncident = seeder.GetNewIncidents().ElementAt(0); var newBatch = new List <BaseIncident>(); for (var x = 0; x < 9000 / 20; ++x) { foreach (var title in this.titleList) { var newIncident = coreIncident.WithTitle($"{title}-{x}") .WithStatus((int)SimsIncidentStatusTypes.Unassigned) .WithLeadOfficer(""); newBatch.Add(newIncident); } } var numbersTest = coreIncident.WithTitle("Number Searching Test Incident 1234 1234.5678 RIM2021.123 RIM2021-123 (1234)") .WithStatus((int)SimsIncidentStatusTypes.Unassigned) .WithLeadOfficer(""); newBatch.Add(numbersTest); await iManager.Add(newBatch); }
public SimsManangement(SimsDbContext ctx, IMapper mapper, ISIMSAttachmentHost attachments, string userId, ILoggerFactory logging) { // unsure about this tbh.... this.SimsDbHost = FSA.SIMSManagerDb.Repositories.SimsDbHost.CreateHost(ctx, mapper, userId); this.attachments = attachments; this.logging = logging; }
private async Task CreateSignalStakeholders(ISimsDbHost sims, SeedingConfigData seeder) { var stakeholders = seeder.GetSignalStakeholder.ToList(); await sims.Signals.Stakeholders.Add(stakeholders[0].HostId, stakeholders[0]); await sims.Signals.Stakeholders.Add(stakeholders[1].HostId, stakeholders[1]); await sims.Signals.Stakeholders.Add(stakeholders[2].HostId, stakeholders[2]); await sims.Signals.Stakeholders.Add(stakeholders[3].HostId, stakeholders[3]); }
private async Task CreateAddress(ISimsDbHost sims, IMapper map) { var viewAddressModels = System.Text.Json.JsonSerializer.Deserialize <List <SimsAddressViewModel> >(File.OpenText("./Setup/orgs.json").ReadToEnd()); var addresses = map.Map <List <SimsAddress> >(viewAddressModels); await sims.Addresses.Add(addresses); var cString = ((JsonElement)Config["ConnectionStrings:FSADbConn"]).ToString(); var conn = new SqlConnection(cString); conn.Open(); var sqlFile = File.ReadAllText("./Setup/LaFiles.sql"); var sqlCmd = new SqlCommand(sqlFile, conn); sqlCmd.ExecuteNonQuery(); conn.Close(); }
private async Task CreateIncidentProducts(ISimsDbHost sims, SeedingConfigData seeder) { var products = seeder.GetNewProducts(); var tasks = products.Select(p => sims.Incidents.Products.Add(p.HostId, p)); await Task.WhenAll(tasks); await sims.Incidents.Products.Fbos.Add(1, 1, (int)(FboTypes.Consignor | FboTypes.Exporter | FboTypes.Hospitality_service)); await sims.Incidents.Products.Fbos.Add(1, 2, (int)FboTypes.Unknown); await sims.Incidents.Products.Fbos.Add(1, 3, (int)(FboTypes.Importer | FboTypes.Manufacturer)); await sims.Incidents.Products.Fbos.Add(2, 4, (int)(FboTypes.Retailer | FboTypes.Manufacturer)); await sims.Incidents.Products.Fbos.Add(2, 5, (int)(FboTypes.Packer_filler | FboTypes.Storage)); await sims.Incidents.Products.Fbos.Add(2, 6, (int)FboTypes.Unknown); }
private async Task CreateSignals(ISimsDbHost sims) { var signals = SignalSeed.Signals(); var signalCount = signals.Count; int lastRound = 0; while (signalCount > 0) { var thisRound = 400; if (thisRound >= signalCount) { thisRound = signalCount; } await sims.Signals.AddBatch(signals.Skip(lastRound).Take(thisRound).ToList()); signalCount = signalCount - thisRound; lastRound = thisRound; } }
public SignalNotes(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public AttachmentUpdates(ISIMSAttachmentHost attachments, ISimsDbHost dbHost) { this.attachments = attachments; this.dbHost = dbHost; }
public UserAuditLogger(ISimsDbHost dbHost) => this.DbHost = dbHost;
public OnlineFormStakeholders(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public IncidentAttachments(ISimsDbHost dbHost, ISPAttachmentManagement attachments) { this.dbHost = dbHost; this.attachments = attachments; }
internal AddressManagment(ISimsDbHost dbHost) { this.dbHost = dbHost; }
private async Task CreateOnlineFormEntries(ISimsDbHost sims, SeedingConfigData seeder) { var forms = seeder.GetOnlineFormData.ToList(); var stakeholders = seeder.GetOnlineFormStakeholders.ToList(); var products = seeder.GetOnlineFormProducts.ToList(); await sims.OnlineForms.AddBatch(forms); await sims.OnlineForms.Stakeholders.Add(1, stakeholders[0]); await sims.OnlineForms.Stakeholders.Add(2, stakeholders[1]); await sims.OnlineForms.Stakeholders.Add(3, stakeholders[2]); await sims.OnlineForms.Stakeholders.Add(4, stakeholders[3]); await sims.OnlineForms.Stakeholders.Add(5, stakeholders[4]); await sims.OnlineForms.Stakeholders.Add(6, stakeholders[5]); await sims.OnlineForms.Stakeholders.Add(7, stakeholders[6]); await sims.OnlineForms.Stakeholders.Add(8, stakeholders[7]); await sims.OnlineForms.Stakeholders.Add(9, stakeholders[8]); await sims.OnlineForms.Stakeholders.Add(10, stakeholders[9]); await sims.OnlineForms.Stakeholders.Add(11, stakeholders[10]); await sims.OnlineForms.Stakeholders.Add(12, stakeholders[11]); await sims.OnlineForms.Stakeholders.Add(13, stakeholders[12]); await sims.OnlineForms.Stakeholders.Add(14, stakeholders[13]); await sims.OnlineForms.Stakeholders.Add(15, stakeholders[14]); await sims.OnlineForms.Products.Add(1, products[0]); await sims.OnlineForms.Products.Add(2, products[1]); await sims.OnlineForms.Products.Add(2, products[2]); await sims.OnlineForms.Products.Add(3, products[3]); await sims.OnlineForms.Products.Add(3, products[2]); await sims.OnlineForms.Products.Add(3, products[4]); await sims.OnlineForms.Products.Add(4, products[2]); await sims.OnlineForms.Products.Add(4, products[0]); await sims.OnlineForms.Products.Add(4, products[1]); await sims.OnlineForms.Products.Add(4, products[4]); await sims.OnlineForms.Products.Add(4, products[3]); await sims.OnlineForms.Products.Add(5, products[4]); await sims.OnlineForms.Products.Add(6, products[1]); await sims.OnlineForms.Products.Add(7, products[2]); await sims.OnlineForms.Products.Add(8, products[3]); await sims.OnlineForms.Products.Add(9, products[4]); await sims.OnlineForms.Products.Add(10, products[0]); await sims.OnlineForms.Notes.Add(1, @"Stakeholder Address Sally Stakeholder AddressLine1, AddressLine2 Town County PostCode", 0); await sims.OnlineForms.Notes.Add(3, @"Stakeholder Address Henry plate AddressLine1, AddressLine2 Town County PostCode", (32 + 128 + 256)); await sims.OnlineForms.Notes.Add(4, @"Stakeholder Address Mavis Coupe AddressLine1, AddressLine2 Town County PostCode", 1); await sims.OnlineForms.Notes.Add(5, @"Stakeholder Address Jame Flan AddressLine1, AddressLine2 Town County PostCode", (1 + 1024 + 4096)); }
public SignalProducts(ISimsDbHost dbHost) { this.dbHost = dbHost; }
internal OnlineFormImporter(ISimsDbHost host, ILogger <OnlineFormImporter> logger) { this.host = host; this.logger = logger; }
public Lookups(ISimsDbHost simsDbHOst) { this.simsDbHOst = simsDbHOst; }
public IncidentNotes(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public OnlineFormProducts(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public IncidentStakeholders(ISimsDbHost dbHost) { this.dbHost = dbHost; }
internal Signals(ISimsDbHost dbHost, ISIMSAttachmentHost attachments) { this.dbHost = dbHost; this.attachments = attachments; }
public OnlineForms(ISimsDbHost simsDbHost, OnlineFormImporter formImporter, ILogger <OnlineForms> logger) { this.dbHost = simsDbHost; this.formImporter = formImporter; this.logger = logger; }
public SignalAttachments(ISimsDbHost dbHost, ISPAttachmentManagement attachments) { this.dbHost = dbHost; this.attachments = attachments; }
public SignalStakeholders(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public SignalLinks(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public IncidentLinks(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public IncidentProducts(ISimsDbHost dbHost) { this.dbHost = dbHost; }
public OnlineNotes(ISimsDbHost dbHost) { this.dbHost = dbHost; }