-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
225 lines (207 loc) · 7.83 KB
/
MainWindow.xaml
File metadata and controls
225 lines (207 loc) · 7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<Window x:Class="DatabaseExampleWPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Library Management System"
Height="550"
Width="700"
WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize">
<Window.Resources>
<!-- TextBlock style -->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Margin" Value="5"/>
</Style>
</Window.Resources>
<Grid Background="#F5F5F5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<!-- Title -->
<RowDefinition Height="Auto"/>
<!-- Database Setup -->
<RowDefinition Height="20"/>
<!-- Spacer -->
<RowDefinition Height="Auto"/>
<!-- Section Header -->
<RowDefinition Height="*"/>
<!-- Buttons -->
<RowDefinition Height="Auto"/>
<!-- Footer -->
</Grid.RowDefinitions>
<!-- Title Section -->
<Border Grid.Row="0"
Background="#1976D2"
Padding="20">
<StackPanel>
<TextBlock Text="Library Management System"
FontSize="24"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
Margin="0"/>
<TextBlock Text="AQA 7517 Computer Science NEA - Database Example Project"
FontSize="12"
Foreground="White"
HorizontalAlignment="Center"
Margin="0,5,0,0"/>
</StackPanel>
</Border>
<!-- Database Setup Section -->
<Border Grid.Row="1"
Background="White"
Margin="10"
Padding="15"
CornerRadius="5"
BorderBrush="#DDDDDD"
BorderThickness="1">
<StackPanel>
<TextBlock Text="Database Setup"
FontSize="16"
FontWeight="Bold"
Foreground="#1976D2"
Margin="0,0,0,10"/>
<TextBlock Text="Click the button below to create the database and tables if they don't exist yet."
TextWrapping="Wrap"
Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<Button x:Name="btnCreateDatabase"
Content="Create Database & Tables"
Click="BtnCreateDatabase_Click"
Width="200"
Height="35"
FontSize="14"
FontWeight="SemiBold"
Background="#2196F3"
Foreground="White"
BorderThickness="0"
Cursor="Hand"
Padding="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Margin="5"/>
<Button x:Name="btnPopulateSampleData"
Content="Add Sample Data"
Click="BtnPopulateSampleData_Click"
Width="200"
Height="35"
FontSize="14"
FontWeight="SemiBold"
Background="#4CAF50"
Foreground="White"
BorderThickness="0"
Cursor="Hand"
Padding="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Margin="5"/>
</StackPanel>
<TextBlock Text="Sample data includes: 10 books, 10 authors, 10 members, and 10 loans"
FontSize="10"
FontStyle="Italic"
Foreground="Gray"
HorizontalAlignment="Center"
Margin="0,5,0,0"/>
</StackPanel>
</Border>
<!-- Section Header -->
<TextBlock Grid.Row="3"
Text="Data Management"
FontSize="16"
FontWeight="Bold"
Foreground="#1976D2"
Margin="15,0,0,10"/>
<!-- Main Navigation Buttons -->
<Grid Grid.Row="4" Margin="15,0,15,15">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Books Button -->
<Button Grid.Row="0" Grid.Column="0"
x:Name="btnManageBooks"
Content="Manage Books"
Click="BtnManageBooks_Click"
FontSize="16"
FontWeight="Bold"
Background="#4CAF50"
Foreground="White"
BorderThickness="0"
Margin="5"
Cursor="Hand"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<!-- Authors Button -->
<Button Grid.Row="0" Grid.Column="1"
x:Name="btnManageAuthors"
Content="Manage Authors"
Click="BtnManageAuthors_Click"
FontSize="16"
FontWeight="Bold"
Background="#FF9800"
Foreground="White"
BorderThickness="0"
Margin="5"
Cursor="Hand"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<!-- Members Button -->
<Button Grid.Row="1" Grid.Column="0"
x:Name="btnManageMembers"
Content="Manage Members"
Click="BtnManageMembers_Click"
FontSize="16"
FontWeight="Bold"
Background="#9C27B0"
Foreground="White"
BorderThickness="0"
Margin="5"
Cursor="Hand"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<!-- Loans Button -->
<Button Grid.Row="1" Grid.Column="1"
x:Name="btnManageLoans"
Content="Manage Loans"
Click="BtnManageLoans_Click"
FontSize="16"
FontWeight="Bold"
Background="#2196F3"
Foreground="White"
BorderThickness="0"
Margin="5"
Cursor="Hand"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<!-- View All Loans Button - spans 2 columns -->
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
x:Name="btnViewLoansWithDetails"
Content="View All Loans (with Search)"
Click="BtnViewLoansWithDetails_Click"
FontSize="16"
FontWeight="Bold"
Background="#F44336"
Foreground="White"
BorderThickness="0"
Margin="5"
Cursor="Hand"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
</Grid>
<!-- Footer -->
<Border Grid.Row="5"
Background="#1976D2"
Padding="10">
<TextBlock Text="Demonstrates: SQLite Database, CRUD Operations, Joins, Many-to-Many Relationships"
Foreground="White"
FontSize="11"
HorizontalAlignment="Center"
Margin="0"/>
</Border>
</Grid>
</Window>