From 38e4d2aa6e8cf50a43316f065d1432ee43575310 Mon Sep 17 00:00:00 2001 From: Husky Date: Fri, 21 Feb 2020 09:54:52 +0100 Subject: [PATCH] WPF dateiumbenennungen --- KanSan/KanSan.csproj.user | 4 +- .../WindowProjektEdit.xaml} | 2 +- .../WindowProjektEdit.xaml.cs} | 2 +- KanSan/ViewModel/BaustelleViewModel.cs | 71 ------------------- KanSan/ViewModel/ProjektViewModel.cs | 59 +++++++++++++++ 5 files changed, 63 insertions(+), 75 deletions(-) rename KanSan/UI/{Baustelle/WindowBaustelleEdit.xaml => Projekt/WindowProjektEdit.xaml} (92%) rename KanSan/UI/{Baustelle/WindowBaustelleEdit.xaml.cs => Projekt/WindowProjektEdit.xaml.cs} (92%) delete mode 100644 KanSan/ViewModel/BaustelleViewModel.cs create mode 100644 KanSan/ViewModel/ProjektViewModel.cs diff --git a/KanSan/KanSan.csproj.user b/KanSan/KanSan.csproj.user index 48771d9..928cd91 100644 --- a/KanSan/KanSan.csproj.user +++ b/KanSan/KanSan.csproj.user @@ -7,7 +7,7 @@ - + Code @@ -18,7 +18,7 @@ Designer - + Designer diff --git a/KanSan/UI/Baustelle/WindowBaustelleEdit.xaml b/KanSan/UI/Projekt/WindowProjektEdit.xaml similarity index 92% rename from KanSan/UI/Baustelle/WindowBaustelleEdit.xaml rename to KanSan/UI/Projekt/WindowProjektEdit.xaml index 1836b7c..714bdd1 100644 --- a/KanSan/UI/Baustelle/WindowBaustelleEdit.xaml +++ b/KanSan/UI/Projekt/WindowProjektEdit.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:KanSan.UI" mc:Ignorable="d" - Title="FRMBaustelle" Height="450" Width="800" Closed="Window_Closed"> + Title="FRMBaustelle" Height="450" Width="800"> diff --git a/KanSan/UI/Baustelle/WindowBaustelleEdit.xaml.cs b/KanSan/UI/Projekt/WindowProjektEdit.xaml.cs similarity index 92% rename from KanSan/UI/Baustelle/WindowBaustelleEdit.xaml.cs rename to KanSan/UI/Projekt/WindowProjektEdit.xaml.cs index a549428..f8e850f 100644 --- a/KanSan/UI/Baustelle/WindowBaustelleEdit.xaml.cs +++ b/KanSan/UI/Projekt/WindowProjektEdit.xaml.cs @@ -29,7 +29,7 @@ namespace KanSan.UI { InitializeComponent(); - this.DataContext = new BaustelleViewModel(); + this.DataContext = new ProjektViewModel(); } diff --git a/KanSan/ViewModel/BaustelleViewModel.cs b/KanSan/ViewModel/BaustelleViewModel.cs deleted file mode 100644 index e336aab..0000000 --- a/KanSan/ViewModel/BaustelleViewModel.cs +++ /dev/null @@ -1,71 +0,0 @@ -using KanSan.Base; -using KanSan.Base.Interfaces; -using KanSan.Base.Models; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; - -namespace KanSan.ViewModel -{ - class BaustelleViewModel : PropertyChangedClass,INotifyPropertyChanged - { - private Projekt _baustelle; - IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext()); - - private string ort; - private string strasse; - private string projektnummer; - public string Ort - { - get - { - return ort; - } - set - { - if (ort == value) return; - ort = value; - OnPropertyChanged(); - } - } - public string Strasse - { - get - { - return strasse; - } - set - { - if (strasse == value) return; - strasse = value; - OnPropertyChanged(); - } - } - public string Projektnummer - { - get - { - return projektnummer; - } - set - { - if (projektnummer == value) return; - projektnummer = value; - OnPropertyChanged(); - } - } - - - - public BaustelleViewModel() - { - _baustelle = unitOfWork.BaustellenRepository.Get().First(); - ort = _baustelle.Ort; - strasse = _baustelle.Strasse; - projektnummer = _baustelle.Projektnummer; - } - } -} diff --git a/KanSan/ViewModel/ProjektViewModel.cs b/KanSan/ViewModel/ProjektViewModel.cs new file mode 100644 index 0000000..54eb87b --- /dev/null +++ b/KanSan/ViewModel/ProjektViewModel.cs @@ -0,0 +1,59 @@ +using KanSan.Base; +using KanSan.Base.Interfaces; +using KanSan.Base.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +namespace KanSan.ViewModel +{ + class ProjektViewModel : PropertyChangedClass,INotifyPropertyChanged + { + private Projekt _baustelle; + IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext()); + + + private string ortTeil; + private string baustelleNummer; + public string OrtTeil + { + get + { + return ortTeil; + } + set + { + if (ortTeil == value) return; + ortTeil = value; + OnPropertyChanged(); + } + } + + public string BaustelleNummer + { + get + { + return baustelleNummer; + } + set + { + if (baustelleNummer == value) return; + baustelleNummer = value; + OnPropertyChanged(); + } + } + + + + public ProjektViewModel() + { + _baustelle = unitOfWork.BaustellenRepository.Get().First(); + ortTeil = _baustelle.Ort; + + baustelleNummer = _baustelle.Projektnummer; + } + } +}