using dcnsanplanung.DAL.Services.PostgresqlData; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace dcnsanplanung.DAL.Helper { public class WriteToDatabase { List haltungen = new List(); List LVPositionen = new List(); public WriteToDatabase(string XMLFile, string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner") { haltungen = new shared.Helper.ImportToSoftware(XMLFile).haltungen; LVPositionen = new shared.Helper.ImportLVToSoftware(@"C:\Users\damia\source\repos\dcnsanplanung\BE-BS-AWN DW_0001_OOWV_Stamm_LV_Kanalsanierung_xml33.X81").LVPositionen; } public async Task WriteInHaltung() { string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"; HaltungDataService haltungDataService = new HaltungDataService(connectionstring); await haltungDataService.InsertHaltungBulk(haltungen); return true; } public async Task WriteInLV() { string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"; LVDataService lVDataService = new LVDataService(connectionstring); await lVDataService.InsertLeistungsverzeichnisPositionBulk(LVPositionen); return true; } } }