Letzte Projekt wird beigehalten
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using Microsoft.Win32;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,6 +10,10 @@ namespace StammGenerator.ViewModel
|
||||
{
|
||||
internal class ActualState : IActualState
|
||||
{
|
||||
const string userroot = "HKEY_CURRENT_USER\\Software";
|
||||
const string firmkey = "WWTech";
|
||||
const string subkey = "StammGenerator";
|
||||
|
||||
// TODO: set auf private set setzen
|
||||
public int ProjektID { get; set; }
|
||||
|
||||
@@ -25,6 +30,9 @@ namespace StammGenerator.ViewModel
|
||||
{
|
||||
OnProjektChanged();
|
||||
}
|
||||
|
||||
string keyName = userroot + "\\" + firmkey + "\\" + subkey;
|
||||
Registry.SetValue(keyName, "LastProjekt", ProjektID);
|
||||
}
|
||||
public void SetSchacht(Schacht schacht, bool notification = true)
|
||||
{
|
||||
@@ -61,6 +69,17 @@ namespace StammGenerator.ViewModel
|
||||
{
|
||||
HaltungChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
|
||||
public void LoadLastProjekt()
|
||||
{
|
||||
string keyName = userroot + "\\" + firmkey + "\\" + subkey;
|
||||
if(Registry.GetValue(keyName,"LastProjekt","")!= null)
|
||||
{
|
||||
ProjektID = Convert.ToInt32(Registry.GetValue(keyName, "LastProjekt", ""));
|
||||
OnProjektChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user