Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alexander Scharfenberg
Raumverwaltung_HMWK
Commits
6f1f9ea5
Commit
6f1f9ea5
authored
Oct 06, 2021
by
Alexander Scharfenberg
Browse files
working program
parent
95532245
Changes
13
Hide whitespace changes
Inline
Side-by-side
Raumverwaltung_HMWK/AddFloorWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Stockwerk anlegen" Height="300" Width="400">
Title="Stockwerk anlegen" Height="300" Width="400"
ResizeMode="NoResize"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
...
...
Raumverwaltung_HMWK/AddLocationWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Standorteingabe" Height="200" Width="280">
Title="Standorteingabe" Height="200" Width="280"
ResizeMode="NoResize"
>
<Grid>
<StackPanel Orientation="Vertical" Margin="0,20,0,0">
<TextBlock FontSize="15" HorizontalAlignment="Center">Standort eingeben:</TextBlock>
...
...
Raumverwaltung_HMWK/AddRoomWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Raum erstellen" Height="400" Width="300">
Title="Raum erstellen" Height="400" Width="300"
ResizeMode="NoResize"
>
<Grid Background="Thistle">
<Grid.RowDefinitions>
<RowDefinition Height="75"></RowDefinition>
...
...
Raumverwaltung_HMWK/DeleteFloorWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Stockwerk entfernen" Height="300" Width="250">
Title="Stockwerk entfernen" Height="300" Width="250"
ResizeMode="NoResize"
>
<Grid>
<StackPanel Orientation="Vertical" Margin="0,0,0,0">
<TextBlock FontSize="15" HorizontalAlignment="Center">Standort wählen:</TextBlock>
...
...
Raumverwaltung_HMWK/DeleteLocationWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Standort löschen" Height="200" Width="280">
Title="Standort löschen" Height="200" Width="280"
ResizeMode="NoResize"
>
<Grid>
<StackPanel Orientation="Vertical" Margin="0,20,0,0">
<TextBlock FontSize="15" HorizontalAlignment="Center">Standort eingeben:</TextBlock>
...
...
Raumverwaltung_HMWK/DeleteRoomWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Raum löschen" Height="300" Width="300">
Title="Raum löschen" Height="300" Width="300"
ResizeMode="NoResize"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="75"></RowDefinition>
...
...
Raumverwaltung_HMWK/DeleteRoomWindow.xaml.cs
View file @
6f1f9ea5
...
...
@@ -57,11 +57,7 @@ namespace Raumverwaltung_HMWK
break
;
}
}
}
}
else
{
...
...
Raumverwaltung_HMWK/FloorWindow.xaml
View file @
6f1f9ea5
...
...
@@ -37,12 +37,12 @@
</StackPanel>
<Canvas Name="GUI" Grid.Row="1" Margin="10" PreviewMouseMove="GUI_OnPreviewMouseMove" PreviewMouseUp="GUI_OnPreviewMouseUp">
</Canvas>
<StackPanel Grid.Row="2"
Margin="10"
Orientation="Horizontal" Background="Lavender">
<StackPanel Grid.Row="2" Orientation="Horizontal" Background="Lavender">
<StackPanel Orientation="Vertical">
<TextBlock>Notizfeld:</TextBlock>
<TextBlock
FontSize="15" HorizontalAlignment="Center"
>Notizfeld:</TextBlock>
<TextBox Name="Notefield" Margin="10" Height="70" Width="850"></TextBox>
</StackPanel>
<StackPanel VerticalAlignment="
Bottom
" HorizontalAlignment="Center" Width="80" Height="50">
<StackPanel VerticalAlignment="
Center
" HorizontalAlignment="Center" Width="80" Height="50"
Margin="50,30,0,0"
>
<Button Content="Speichern" Click="SaveNote"></Button>
</StackPanel>
</StackPanel>
...
...
Raumverwaltung_HMWK/FloorWindow.xaml.cs
View file @
6f1f9ea5
...
...
@@ -70,7 +70,7 @@ namespace Raumverwaltung_HMWK
private
void
CreateButton
(
Room
room
)
{
Button
newBtn
=
new
Button
();
newBtn
.
Width
=
5
0
;
newBtn
.
Width
=
10
0
;
newBtn
.
Height
=
30
;
newBtn
.
Content
=
room
.
Name
;
newBtn
.
Name
=
"_"
+
room
.
Id
;
...
...
@@ -161,7 +161,8 @@ namespace Raumverwaltung_HMWK
private
void
DeleteRoom
(
object
sender
,
RoutedEventArgs
e
)
{
DeleteRoomWindow
window
=
new
DeleteRoomWindow
(
CurrentFloor
.
Id
);
window
.
Show
();
}
private
void
ChangeImage
(
object
sender
,
RoutedEventArgs
e
)
...
...
Raumverwaltung_HMWK/MainWindow.xaml
View file @
6f1f9ea5
...
...
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Raumverwaltung_HMWK"
mc:Ignorable="d"
Title="Raumverwaltung-HMWK" Height="500" Width="720">
Title="Raumverwaltung-HMWK" Height="500" Width="720"
SizeToContent="Height"
>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
...
...
@@ -41,22 +41,22 @@
<MenuItem Header="Hilfe" FontSize="15" BorderBrush="Black" Margin="10,0" Background="Thistle"></MenuItem>
</Menu>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" VerticalAlignment="
Center
">
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" VerticalAlignment="
Top
">
<TextBlock Text="Standorte:" HorizontalAlignment="Center" FontSize="15"></TextBlock>
<ComboBox Name="Standortauswahl" SelectionChanged="Standortauswahl_OnSelectionChanged" Height="30" Width="100"></ComboBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" VerticalAlignment="
Center
">
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" VerticalAlignment="
Top
">
<TextBlock Text="Stockwerke:" FontSize="15" HorizontalAlignment="Center"></TextBlock>
<ComboBox Name="Stockwerkauswahl" SelectionChanged="Stockwerkauswahl_OnSelectionChanged" Height="30" Width="100"></ComboBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" VerticalAlignment="
Center
">
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" VerticalAlignment="
Top
">
<TextBlock Text="Auswahl:" FontSize="15" HorizontalAlignment="Center"></TextBlock>
<TextBox Name="Result" Margin="0,10" Height="30" Width="100"></TextBox>
<Button Click="OpenFloor_OnClick" FontSize="15" IsEnabled="False" Name="OpenFloor" Content="Stockwerk öffnen" Height="30" Width="120"></Button>
</StackPanel>
<
StackPanel
Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
<
Grid
Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
VerticalAlignment="Top"
>
<TextBlock Text="Raumüberblick:" FontSize="15" HorizontalAlignment="Center"></TextBlock>
<ListBox
Height="260"
Name="RoomList" x:FieldModifier="public">
<ListBox Name="RoomList" x:FieldModifier="public"
Margin="0,20"
>
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
...
...
@@ -74,6 +74,6 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</
StackPanel
>
</
Grid
>
</Grid>
</Window>
Raumverwaltung_HMWK/Room.cs
View file @
6f1f9ea5
...
...
@@ -64,9 +64,11 @@
get
{
return
status
;
}
set
{
status
=
value
;
}
}
public
override
string
ToString
()
{
return
name
;
}
}
}
\ No newline at end of file
Raumverwaltung_HMWK/RoomWindow.xaml.cs
View file @
6f1f9ea5
...
...
@@ -117,7 +117,6 @@ namespace Raumverwaltung_HMWK
if
(
gesamt
==
0
)
{
myBtn
.
Background
=
Brushes
.
CornflowerBlue
;
SqLiteDataAccess
.
UpdateStatusForRoom
(
"../../Images.blau.png"
,
CurrentRoom
.
Id
);
}
else
{
...
...
@@ -126,19 +125,16 @@ namespace Raumverwaltung_HMWK
if
(
differenz
>
1
)
{
myBtn
.
Background
=
Brushes
.
SpringGreen
;
SqLiteDataAccess
.
UpdateStatusForRoom
(
"../../Images.grün.png"
,
CurrentRoom
.
Id
);
}
if
(
differenz
==
1
)
{
myBtn
.
Background
=
Brushes
.
Yellow
;
SqLiteDataAccess
.
UpdateStatusForRoom
(
"../../Images.gelb.png"
,
CurrentRoom
.
Id
);
}
if
(
differenz
<
1
)
{
myBtn
.
Background
=
Brushes
.
Red
;
SqLiteDataAccess
.
UpdateStatusForRoom
(
"../../Images.rot.png"
,
CurrentRoom
.
Id
);
}
}
...
...
Raumverwaltung_HMWK/SqLiteDataAccess.cs
View file @
6f1f9ea5
...
...
@@ -3,11 +3,8 @@ using System.Collections.Generic;
using
System.Collections.ObjectModel
;
using
System.Configuration
;
using
System.Data
;
using
System.Data.SqlClient
;
using
System.Data.SQLite
;
using
System.Linq
;
using
System.Net.WebSockets
;
using
System.Windows
;
using
Dapper
;
namespace
Raumverwaltung_HMWK
...
...
@@ -217,7 +214,7 @@ namespace Raumverwaltung_HMWK
return
Convert
.
ToInt32
(
cnn
.
ExecuteScalar
(
sql
));
}
}
/**
public static void UpdateStatusForRoom(string status, int roomId)
{
using (IDbConnection cnn = new SQLiteConnection(new SQLiteConnection(LoadConnectionString())))
...
...
@@ -229,7 +226,7 @@ namespace Raumverwaltung_HMWK
cnn.Execute(sql, dynamicParameters);
}
}
*/
public
static
void
SaveNote
(
int
floorId
,
string
text
)
{
using
(
IDbConnection
cnn
=
new
SQLiteConnection
(
new
SQLiteConnection
(
LoadConnectionString
())))
...
...
@@ -410,6 +407,19 @@ namespace Raumverwaltung_HMWK
{
using
(
IDbConnection
cnn
=
new
SQLiteConnection
(
new
SQLiteConnection
(
LoadConnectionString
())))
{
var
dynamicParameters
=
new
DynamicParameters
();
dynamicParameters
.
Add
(
"RoomId"
,
roomId
);
string
sql
=
"DELETE FROM Asset WHERE RId=@RoomId"
;
cnn
.
Execute
(
sql
,
dynamicParameters
);
string
sql2
=
"DELETE FROM Room_User WHERE RId=@RoomId"
;
cnn
.
Execute
(
sql2
,
dynamicParameters
);
string
sql3
=
"DELETE FROM Room WHERE Id=@RoomId"
;
cnn
.
Execute
(
sql3
,
dynamicParameters
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment