Documentation

This commit is contained in:
francesco 2020-09-16 20:22:39 +02:00
parent b17d79e5ac
commit 974aa9c0b1
5 changed files with 56 additions and 11 deletions

View File

@ -16,7 +16,7 @@
<Grid Height="450" Width="800" Background="#FF89A9B2" >
<TextBlock Height="32" HorizontalAlignment="Left" Margin="10,18,0,0" Name="TextBlockHeading" Text="Locations" VerticalAlignment="Top" Width="310" FontSize="20" FontStretch="Normal"/>
<Grid HorizontalAlignment="Left" Height="416" VerticalAlignment="Top" Width="773">
<DataGrid Validation.ErrorTemplate="{x:Null}" CanUserAddRows="False" AutoGenerateColumns="False" HorizontalAlignment="Left" SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" Margin="10,196,0,76" x:Name="DataGridLocations" Width="763" ItemsSource="{Binding Path=Locations}" CanUserResizeRows="False">
<!--<DataGrid Validation.ErrorTemplate="{x:Null}" CanUserAddRows="False" AutoGenerateColumns="False" HorizontalAlignment="Left" SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" Margin="10,196,0,76" x:Name="DataGridLocations" Width="763" ItemsSource="{Binding Path=Locations}" CanUserResizeRows="False">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=location_id}" Header="id" Width="1*" IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding Path=parentid}" Header="ParentId" Width="1*" IsReadOnly="True" />
@ -25,7 +25,7 @@
<DataGridTextColumn Binding="{Binding Path=building}" Header="BuildingNr" Width="1*" IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding Path=room}" Header="RoomNr" Width="1*" IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
</DataGrid>-->
<TreeView Grid.Row="0" Margin="10,51,0,225" ItemsSource="{Binding LocationTree, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=true, Mode=TwoWay}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodesList, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=true, Mode=TwoWay}">
@ -34,7 +34,7 @@
</TreeView.ItemTemplate>
</TreeView>
<Button Content="Add" Height="25" HorizontalAlignment="Left" Margin="478,366,0,0" Name="BtnAdd" VerticalAlignment="Top" Width="70" Command="{Binding BtnAddDataClick}">
<!--<Button Content="Add" Height="25" HorizontalAlignment="Left" Margin="478,366,0,0" Name="BtnAdd" VerticalAlignment="Top" Width="70" Command="{Binding BtnAddDataClick}">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
@ -50,10 +50,10 @@
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button Content="Update" Height="25" HorizontalAlignment="Left" Margin="553,366,0,0" Name="BtnUpdateDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnUpdateDataClick}" />
</Button>-->
<!--<Button Content="Update" Height="25" HorizontalAlignment="Left" Margin="553,366,0,0" Name="BtnUpdateDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnUpdateDataClick}" />-->
<Button Content="Load Data" Height="25" HorizontalAlignment="Left" Margin="628,366,0,0" Name="BtnLoadDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnLoadDataClick}" />
<Button Content="Delete" Height="25" HorizontalAlignment="Left" Margin="703,366,0,0" Name="BtnDeleteDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnDeleteDataClick}"/>
<!--<Button Content="Delete" Height="25" HorizontalAlignment="Left" Margin="703,366,0,0" Name="BtnDeleteDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnDeleteDataClick}"/>-->
<TextBox HorizontalAlignment="Left" Height="23" Margin="248,22,0,0" TextWrapping="Wrap" Text="{Binding TxtConnectionString}" Name="TxtConnectionString" VerticalAlignment="Top" Width="525" />

View File

@ -12,7 +12,6 @@
| LINQ | Samstag, 15. August 23:55 |
| RegEx | Sonntag, 30. August 23:55 |
| Inversion of Control | Dienstag, 15. September 23:55 |
| Reflection & Serialization | Dienstag, 15. September 23:55 |
## NuGet
@ -89,4 +88,6 @@ CustomerNumber: Beginnend mit CU und folgt von 5 Zahlen.
## Inversion of Control
Inversion of Control wurde mit der AutoFac Libary umgesetzt.
Container wird im NavigationViewModel ersellt um die übrigen ViewModel zu implementieren. Dafür wurde eine Neue Klasse `Builder` erstellt.

BIN
dbTestat/CTE_OutPut.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

View File

@ -8,8 +8,6 @@
| ----------------------------------------------------------- | ---------------- |
| EntityFramework | 02.08.2020 23:55 |
| Hierarchiesche Structur der Location (CTE) | 15.08.2020 23:55 |
| Jahresvergliech (Window Function) | 30.08.2020 23:55 |
| Nachvollziehbare Adressänderungen (temporale Datenstruktur) | 15.09.2020 23:55 |
## Migration MySQL zu MS SQL
@ -48,6 +46,52 @@ SQL-String kann man ignorieren da es nur für den ADO.NET-teil Relevant ist.
## Hierarchiesche Structur der Location (CTE)
## Jahresvergliech (Window Function)
CTE Script:
## Nachvollziehbare Adressänderungen (temporale Datenstruktur)
```sql
;WITH cte_location AS (
SELECT
location_id, parentid, 0 AS locationLevel, loc.designation AS LocationDesignation,
pod.designation AS POD_Designation,
adr.streetname,
adr.streetnumber,
tow.zip,
tow.town
FROM
[inventarisierungsloesung].Location AS loc
INNER JOIN [inventarisierungsloesung].pointofdelivery pod ON pod.location_fk = loc.location_id
INNER JOIN [inventarisierungsloesung].address adr ON loc.address_fk = adr.address_id
INNER JOIN [inventarisierungsloesung].town tow ON adr.town_fk = tow.town_id
WHERE parentid IS NULL
UNION ALL
SELECT loc.location_id ,
loc.parentid ,
cte_loc.locationLevel + 1,
loc.designation,
pod.designation,
adr.streetname,
adr.streetnumber,
tow.zip,
tow.town
FROM [inventarisierungsloesung].Location AS loc
INNER JOIN cte_location AS cte_loc
ON cte_loc.location_id = loc.parentid
INNER JOIN [inventarisierungsloesung].pointofdelivery pod ON pod.location_fk = loc.location_id
INNER JOIN [inventarisierungsloesung].address adr ON loc.address_fk = adr.address_id
INNER JOIN [inventarisierungsloesung].town tow ON adr.town_fk = tow.town_id
)
Select * FROM cte_location
```
Der obige Script wird von einer StoredProcedure angesptossen.
ERROR: Aktuell liegt ein Fehler vor was aus Zeitgründen nicht behoben wird.
```
"The data reader is incompatible with the specified 'inventarisierungsloesungModel.Location'. A member of the type, 'location_id', does not have a corresponding column in the data reader with the same name."
```
Ausführung auf der Datenbank ergiebt folgender Output:
![CTE_OutPut](C:\Workspace\pa2.Testat\dbTestat\CTE_OutPut.bmp)