diff --git a/dcnsanplanung.DAL/Helper/WriteToDatabase.cs b/dcnsanplanung.DAL/Helper/WriteToDatabase.cs index b79f0c4..68add12 100644 --- a/dcnsanplanung.DAL/Helper/WriteToDatabase.cs +++ b/dcnsanplanung.DAL/Helper/WriteToDatabase.cs @@ -11,7 +11,7 @@ namespace dcnsanplanung.DAL.Helper { List haltungen = new List(); List LVPositionen = new List(); - public WriteToDatabase(string XMLFile, string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner") + public WriteToDatabase(string XMLFile, string connectionstring = "Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; 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; @@ -21,7 +21,7 @@ namespace dcnsanplanung.DAL.Helper public async Task WriteInHaltung() { - string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"; + string connectionstring = "Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"; HaltungDataService haltungDataService = new HaltungDataService(connectionstring); await haltungDataService.InsertHaltungBulk(haltungen); return true; @@ -29,7 +29,7 @@ namespace dcnsanplanung.DAL.Helper public async Task WriteInLV() { - string connectionstring = "Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"; + string connectionstring = "Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"; LVDataService lVDataService = new LVDataService(connectionstring); await lVDataService.InsertLeistungsverzeichnisPositionBulk(LVPositionen); return true; diff --git a/dcnsanplanung.DAL/Services/PostgresqlData/HaltungDataService.cs b/dcnsanplanung.DAL/Services/PostgresqlData/HaltungDataService.cs index 89fdc19..d9710fe 100644 --- a/dcnsanplanung.DAL/Services/PostgresqlData/HaltungDataService.cs +++ b/dcnsanplanung.DAL/Services/PostgresqlData/HaltungDataService.cs @@ -65,7 +65,7 @@ namespace dcnsanplanung.DAL.Services.PostgresqlData { Haltung result = new Haltung() { - ID = reader.GetInt32(0), + //ID = reader.GetInt32(0), Guid = Guid.Parse(reader.GetString(1)), Ref_Projekt_Guid = Guid.Parse(reader.GetString(2)), Objektbezeichnung = reader.GetString(3), diff --git a/dcnsanplanung.shared/Class1.cs b/dcnsanplanung.shared/Class1.cs deleted file mode 100644 index e99d550..0000000 --- a/dcnsanplanung.shared/Class1.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace dcnsanplanung.shared -{ - public class Class1 - { - - } -} \ No newline at end of file diff --git a/dcnsanplanung.wpf/ViewModel/HaltungObjektViewModel.cs b/dcnsanplanung.wpf/ViewModel/HaltungObjektViewModel.cs index 98d2468..604e76a 100644 --- a/dcnsanplanung.wpf/ViewModel/HaltungObjektViewModel.cs +++ b/dcnsanplanung.wpf/ViewModel/HaltungObjektViewModel.cs @@ -45,13 +45,13 @@ namespace dcnsanplanung.wpf.ViewModel private void doSpeichern() { - SchadenDataService schadenDataService = new SchadenDataService("Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"); + SchadenDataService schadenDataService = new SchadenDataService("Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"); schadenDataService.UpdateSchadenBuld(model.Kodierungen); } private async void LadeSchaeden() { - SchadenDataService schadenDataService = new SchadenDataService("Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"); + SchadenDataService schadenDataService = new SchadenDataService("Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"); IEnumerable src_kodierung = await schadenDataService.GetAllByHaltung(model); model.Kodierungen = src_kodierung.ToList(); diff --git a/dcnsanplanung.wpf/ViewModel/MainWindowViewModel.cs b/dcnsanplanung.wpf/ViewModel/MainWindowViewModel.cs index dcbd9c0..6ce8e6d 100644 --- a/dcnsanplanung.wpf/ViewModel/MainWindowViewModel.cs +++ b/dcnsanplanung.wpf/ViewModel/MainWindowViewModel.cs @@ -58,10 +58,10 @@ namespace dcnsanplanung.wpf.ViewModel private async void dooKlassifiziereAsync() { - DAL.Services.PostgresqlData.HaltungDataService haltungDataService = new DAL.Services.PostgresqlData.HaltungDataService("Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"); + DAL.Services.PostgresqlData.HaltungDataService haltungDataService = new DAL.Services.PostgresqlData.HaltungDataService("Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"); var s = await haltungDataService.GetAllByProjekt(0); // Alle Haltungen laden - SchadenDataService schadenDataService = new SchadenDataService("Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"); + SchadenDataService schadenDataService = new SchadenDataService("Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"); foreach (var item in s) { @@ -98,15 +98,15 @@ namespace dcnsanplanung.wpf.ViewModel async Task dooAsync() { - DAL.Helper.WriteToDatabase writer = new DAL.Helper.WriteToDatabase(@"D:\Airbus\Airbus Nordenham RW Viewer für Sanierungskonzept\Airbus Nordenham RW.xml"); + DAL.Helper.WriteToDatabase writer = new DAL.Helper.WriteToDatabase(@"C:\Users\damia\Desktop\dev\dcnsanplanung\RW.xml"); await writer.WriteInHaltung(); //Debugger.Break(); - await writer.WriteInLV(); + //await writer.WriteInLV(); } private async void LoadHaltungen() { - DAL.Services.PostgresqlData.HaltungDataService haltungDataService = new DAL.Services.PostgresqlData.HaltungDataService("Host = localhost; Database = sanplaner; Username = dcnsanplaner; Password = sanplaner"); + DAL.Services.PostgresqlData.HaltungDataService haltungDataService = new DAL.Services.PostgresqlData.HaltungDataService("Host = 10.1.0.2; Database = sanplaner; Username = sanplaner; Password = sanplaner"); var s = await haltungDataService.GetAllByProjekt(0); foreach(var item in s) { diff --git a/haltung.txt b/haltung.txt new file mode 100644 index 0000000..1d37f5e --- /dev/null +++ b/haltung.txt @@ -0,0 +1,49 @@ +-- Table: public.haltung + +-- DROP TABLE IF EXISTS public.haltung; + +CREATE TABLE IF NOT EXISTS public.haltung +( + id integer NOT NULL DEFAULT nextval('haltung_id_seq'::regclass), + guid text COLLATE pg_catalog."default", + ref_projekt_guid text COLLATE pg_catalog."default", + objektbezeichnung text COLLATE pg_catalog."default", + bewertungklasse integer, + dn integer, + material text COLLATE pg_catalog."default", + CONSTRAINT haltung_pkey PRIMARY KEY (id) +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.haltung + OWNER to sanplaner; + + + + + + + + + + + + + + +CREATE TABLE IF NOT EXISTS public.haltung +( + id SERIAL PRIMARY KEY, + guid text COLLATE pg_catalog."default", + ref_projekt_guid text COLLATE pg_catalog."default", + objektbezeichnung text COLLATE pg_catalog."default", + bewertungklasse integer, + dn integer, + material text COLLATE pg_catalog."default" +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.haltung + OWNER to sanplaner; \ No newline at end of file diff --git a/projekt.txt b/projekt.txt new file mode 100644 index 0000000..67c04b9 --- /dev/null +++ b/projekt.txt @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS public.projekt +( + id SERIAL PRIMARY KEY, + guid text COLLATE pg_catalog."default" +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.projekt + OWNER to sanplaner; \ No newline at end of file diff --git a/schaden.txt b/schaden.txt new file mode 100644 index 0000000..ad0db07 --- /dev/null +++ b/schaden.txt @@ -0,0 +1,25 @@ +-- Table: public.schaden + +-- DROP TABLE IF EXISTS public.schaden; + +CREATE TABLE IF NOT EXISTS public.schaden +( + id SERIAL PRIMARY KEY, + guid text COLLATE pg_catalog."default", + ref_haltung_guid text COLLATE pg_catalog."default", + entfernung numeric(8,2), + hauptcode text COLLATE pg_catalog."default", + ch1 text COLLATE pg_catalog."default", + ch2 text COLLATE pg_catalog."default", + q1 text COLLATE pg_catalog."default", + q2 text COLLATE pg_catalog."default", + kd integer, + ks integer, + kb integer, + streckenschaden text COLLATE pg_catalog."default" +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.schaden + OWNER to sanplaner; \ No newline at end of file