2 Commits

Author SHA1 Message Date
e7891c1a05 This fixed #4
Schacht können nun wieder gespeichert werden

Converter um Schachttype erweitert.
2023-08-08 09:56:32 +02:00
c5a2a15865 this fixes #5
Es wird nun ein Fehlermeldung angezeigt bei absturz
2023-08-08 09:46:33 +02:00
3 changed files with 26 additions and 1 deletions

View File

@@ -99,9 +99,10 @@ namespace SewerStammGen.DAL.Services.PostgresqlData
public async Task<Schacht> Update(Schacht entity)
{
// TODO: Typo in Schachtype beheben. Dies erfordert jedoch ein Datenbank updater Siehe Issue #7
string command = @"UPDATE " + tableName + " SET " +
"objektbezeichnung=@1, deckelrechtswert=@2, deckelhochwert=@3, deckelhoehe=@4, " +
"sohlrechtswert=@5, sohlhochwert=@6, sohlhoehe=@7, entwaesserung=@8, schachttype=@9, vermesser=@10, aufnahmedatum=@11, ref_projekt_id=@12 WHERE schacht_id=@13";
"sohlrechtswert=@5, sohlhochwert=@6, sohlhoehe=@7, entwaesserung=@8, schachtype=@9, vermesser=@10, aufnahmedatum=@11, ref_projekt_id=@12 WHERE schacht_id=@13";
using(var cmd = new NpgsqlCommand(command,conn))
{
cmd.Parameters.AddWithValue("1", entity.Objektbezeichnung);

View File

@@ -12,6 +12,7 @@ using System.Windows;
using CodeMeter;
using SewerStammGen.Shared;
using System.Threading;
using System.Windows.Threading;
namespace StammGenerator
{
@@ -58,6 +59,9 @@ namespace StammGenerator
protected override void OnStartup(StartupEventArgs e)
{
if (_host == null) return;
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
_host.Start();
MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() };
@@ -65,5 +69,24 @@ namespace StammGenerator
base.OnStartup(e);
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
Exception ex = (Exception)e.ExceptionObject;
string text = "Ein Software fehler ist Aufgetreten. Bitte kontaktiere uns mit folgende Information:\n\n";
MessageBox.Show(text + " " + ex.Message + "\n\n" + ex.StackTrace);
}
catch (Exception ex2)
{
MessageBox.Show("Fatal Non-UI error", ex2.Message, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
private void Current_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
throw new NotImplementedException();
}
}
}

View File

@@ -23,6 +23,7 @@ namespace StammGenerator.Converters
if (targetType == typeof(EEntwaeserung)) return (EEntwaeserung)parameter;
if (targetType == typeof(EExportType)) return (EExportType)parameter;
if (targetType == typeof(EKodierungssystem)) return (EKodierungssystem)parameter;
if (targetType == typeof(ESchachtType)) return (ESchachtType)parameter;
throw new NotImplementedException();
}
}