public static async Task SendDataToResultatenhetServiceByKstnr(IEnumerable <long> kstnrList) { var resList = new List <ResultatenhetInputDTO>(); var slitList = Split <long>(kstnrList); foreach (var sublist in slitList) { var subOrganisationsList = LoadFromOracle.FindResultatenheterById(sublist); resList.AddRange(from org in subOrganisationsList where org.UPPL_DATUM != null select new ResultatenhetInputDTO() { OrganisationsId = "0", KostnadsstalleNr = org.KSTNR, Namn = org.FNAMN + " " + org.ENAMN, Typ = org.KSTTYP, systemId = $"DB{org.KSTNR}{org.KSTTYP}", uppdateradDatum = DateTime.Now.ToString(DateTimeFormat), uppdateradAv = "PSE", skapadDatum = org.UPPL_DATUM.ToString(DateTimeFormat), skapadAv = "PSE" }); } var stopWatch = new Stopwatch(); stopWatch.Start(); Console.WriteLine("Start -- SendDataToResultatenhetService " + resList.Count); await CallOdlService.Send(resList, "/api/Organisation/resultatenhet"); stopWatch.Stop(); var ts = stopWatch.Elapsed; string elapsedTime = $"{ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}.{ts.Milliseconds / 10:00}"; Console.WriteLine("SendDataToResultatenhetService"); Console.WriteLine("Time to save " + resList.ToList().Count() + " Organisation " + elapsedTime); Console.WriteLine("End -- SendDataToResultatenhetService"); }
public static async Task SendDataToPersonService(IList <Anstallning> persons) { var stopWatch = new Stopwatch(); var personDTOList = persons.Select(p => new PersonInputDTO() { Personnummer = p.PERSNR.ToString(), Fornamn = p.FNAMN, Mellannamn = "", Efternamn = p.ENAMN, Namn = p.FNAMN + " " + p.ENAMN, systemId = $"DB20-{p.PERSNR.ToString()}", uppdateradDatum = DateTime.Now.ToString(DateTimeFormat), uppdateradAv = "PSE", skapadDatum = DateTime.Now.ToString(DateTimeFormat), skapadAv = "PSE" }).ToList(); Console.WriteLine("Start -- SendDataToPersonService"); stopWatch.Start(); await CallOdlService.Send(personDTOList, "/api/Person/person"); // Format and display the TimeSpan value. var ts = stopWatch.Elapsed; string elapsedTime = $"{ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}.{ts.Milliseconds / 10:00}"; Console.WriteLine("SendDataToPersonService"); Console.WriteLine("Time to save " + personDTOList.ToList().Count() + " persons " + elapsedTime); Console.WriteLine("End -- SendDataToPersonService"); stopWatch.Stop(); }
public static async void SendToOdlPerson(IList <dynamic> adressInputWorkDTOList) { await CallOdlService.Send(adressInputWorkDTOList, "/api/Adress/personadress"); }
public static async void SendToOdlOrg(IList <dynamic> adressInputWorkDTOList) { await CallOdlService.Send(adressInputWorkDTOList, "/api/Adress/organisationadress"); }