Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0eac4ae95 | |||
| 22e9377062 | |||
| 11e6aab8fd | |||
| 13f313d4a0 | |||
| 64951c579f | |||
| 4130c36335 | |||
| 7f2fc99d0b | |||
| eb640ff749 | |||
| 54a564df04 | |||
| 71dc63f2a2 | |||
| 68f673c8d7 | |||
| d5b7fd7af3 | |||
| 573e7c86e8 | |||
| a1bf573a07 | |||
| 525f3fb4ae | |||
| 9f298d8ce8 | |||
| 11d9c641a6 | |||
| c2f7adc1d0 | |||
| c19f96ea37 | |||
| 9bbde62d70 | |||
| a83f97828c | |||
| 44654dd784 | |||
| 410055c9f2 | |||
| ce75d8aa0b | |||
| be436f1b1c | |||
| 14c11b81b6 | |||
| dd38b91d68 | |||
| 987f27fcbc | |||
| 42ecde799c | |||
| ce70d86fd3 | |||
| ea280ea05d | |||
| c2e230ca48 | |||
| 30317dd1bb | |||
| 6753acc04f | |||
| 4468651373 | |||
| b6de508ea0 | |||
| d70770e2f0 | |||
| 2c2f2d2d94 | |||
| c5a234cea7 | |||
| c6f9994c25 | |||
| 6f1ffd40b6 | |||
| 8ab928be7c | |||
| 30c8b2ef92 | |||
| 24416dc345 | |||
| 8bfa22451e | |||
| 8be9a9a925 | |||
| d1f5444caf | |||
| aec57d7d9d | |||
| 2f18629e83 | |||
| 5f44e63129 | |||
| 0df27f7e50 | |||
| df282d1164 | |||
| af2ad3dab7 | |||
| 8672b09ff0 | |||
| d23c8870ed | |||
| 1bfd2f5219 | |||
| 77ca5aa1ff | |||
| b772e29084 | |||
| 8a8803395f |
+73
-42
@@ -4,7 +4,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="spplus.MainWindow" WindowState="Maximized"
|
x:Class="spplus.MainWindow" WindowState="Maximized"
|
||||||
Title="SP+">
|
Title="spplus">
|
||||||
<Border>
|
<Border>
|
||||||
<Grid RowDefinitions="30,*">
|
<Grid RowDefinitions="30,*">
|
||||||
<Menu Background="#50888888">
|
<Menu Background="#50888888">
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
<!-- <MenuItem Click="MnuSettings_OnClick" x:Name="MnuSettings" Header="Einstellungen" /> -->
|
<!-- <MenuItem Click="MnuSettings_OnClick" x:Name="MnuSettings" Header="Einstellungen" /> -->
|
||||||
<!-- <Separator /> -->
|
<!-- <Separator /> -->
|
||||||
<MenuItem x:Name="MnuExpSettings" Header="Einstellungen exportieren" Click="MnuExpSettings_OnClick" />
|
<MenuItem x:Name="MnuExpSettings" Header="Einstellungen exportieren" Click="MnuExpSettings_OnClick" />
|
||||||
|
<MenuItem x:Name="MnuImpResult" Header="Berechnung importieren" Click="MnuImpResult_OnClick" />
|
||||||
<MenuItem x:Name="MnuExit" Header="Beenden" Click="MnuExit_OnClick"/>
|
<MenuItem x:Name="MnuExit" Header="Beenden" Click="MnuExit_OnClick"/>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Hilfe">
|
<MenuItem Header="Hilfe">
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
<MenuItem Header="Über" x:Name="MnuAbout" Click="MnuAbout_OnClick" />
|
<MenuItem Header="Über" x:Name="MnuAbout" Click="MnuAbout_OnClick" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<TabControl x:Name="TclMainView" Grid.Row="1">
|
<TabControl x:Name="TclMainView" Grid.Row="1" TabStripPlacement="Left">
|
||||||
<TabItem>
|
<TabItem>
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<ListBox Grid.RowSpan="2" x:Name="LbStudentsImported" SelectionChanged="LbStudentsImported_OnSelectionChanged" Margin="0,70,0,70" Background="MintCream" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></ListBox>
|
<ListBox Grid.RowSpan="2" x:Name="LbStudentsImported" SelectionChanged="LbStudentsImported_OnSelectionChanged" Margin="0,70,0,70" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></ListBox>
|
||||||
|
|
||||||
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">
|
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
@@ -88,6 +89,11 @@
|
|||||||
<Label Content="Anzahl gewählte Kurse"></Label>
|
<Label Content="Anzahl gewählte Kurse"></Label>
|
||||||
<Label Grid.Column="1" x:Name="LblSelectedAmount"></Label>
|
<Label Grid.Column="1" x:Name="LblSelectedAmount"></Label>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<Grid ColumnDefinitions="*,3*">
|
||||||
|
<Label Content="Wahlzahlen"></Label>
|
||||||
|
<Label Grid.Column="1" x:Name="LblNumVoted"></Label>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|
||||||
@@ -101,16 +107,30 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<Grid ColumnDefinitions="*,2*">
|
<Grid ColumnDefinitions="*,2*">
|
||||||
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal">
|
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Spacing="10">
|
||||||
<Button Margin="0,10,0,0" x:Name="BtnImportDefaultCourses" VerticalAlignment="Top" Height="30" HorizontalAlignment="Stretch" Click="BtnImportDefaultCourses_OnClick" HorizontalContentAlignment="Center">
|
<Button Margin="0,10,0,0" x:Name="BtnImportDefaultCourses" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnImportDefaultCourses_OnClick" HorizontalContentAlignment="Center">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="Import" Width="24" Height="24" />
|
<LucideIcon Kind="Import" Width="24" Height="24" />
|
||||||
<Label Content="Standardkurse importieren..." VerticalContentAlignment="Center" FontSize="12"
|
<Label Content="Standardkurse importieren..." VerticalContentAlignment="Center" FontSize="12"
|
||||||
FontWeight="Bold" />
|
FontWeight="Bold" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Margin="0,10,0,0" x:Name="BtnDeleteSinleCourse" Background="#99963434" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnDeleteSinleCourse_OnClick" HorizontalContentAlignment="Center">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Trash2" Width="24" Height="24" />
|
||||||
|
<Label Content="Ausgewähltes entfernen" VerticalContentAlignment="Center" FontSize="12"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Margin="0,10,0,0" x:Name="BtnClearCourseList" Background="#99963434" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnClearCourseList_OnClick" HorizontalContentAlignment="Center">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Trash" Width="24" Height="24" />
|
||||||
|
<Label Content="Liste leeren" VerticalContentAlignment="Center" FontSize="12"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ListBox Grid.Column="0" x:Name="LbSportCourses" SelectionChanged="LbSportCourses_OnSelectionChanged" Margin="0,50,0,0" />
|
<ListBox Grid.Column="0" x:Name="LbSportCourses" SelectionChanged="LbSportCourses_OnSelectionChanged" Margin="0,55,0,0" />
|
||||||
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">
|
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="ID"></Label>
|
<Label Content="ID"></Label>
|
||||||
@@ -118,78 +138,67 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Name"></Label>
|
<Label Content="Name"></Label>
|
||||||
<TextBox Grid.Column="1" x:Name="TbSportName" TextChanged="TbStudentID_OnTextChanged"></TextBox>
|
<TextBox Grid.Column="1" x:Name="TbSportName" TextChanged="TbSportName_OnTextChanged"></TextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Maximale Schüler*innenanzahl"></Label>
|
<Label Content="Maximale Schüler*innenanzahl"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxStudents"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxStudents" ValueChanged="NudSportMaxStudents_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Minimale Schüler*innenanzahl"></Label>
|
<Label Content="Minimale Schüler*innenanzahl"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudSportMinStudents"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudSportMinStudents" ValueChanged="NudSportMinStudents_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Anzahl Angebote Semester 1"></Label>
|
<Label Content="Anzahl Angebote Semester 1"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem1"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem1" ValueChanged="NudAmountCoursesSem1_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Anzahl Angebote Semester 2"></Label>
|
<Label Content="Anzahl Angebote Semester 2"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem2"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem2" ValueChanged="NudAmountCoursesSem2_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Anzahl Angebote Semester 3"></Label>
|
<Label Content="Anzahl Angebote Semester 3"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem3"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem3" ValueChanged="NudAmountCoursesSem3_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Anzahl Angebote Semester 4"></Label>
|
<Label Content="Anzahl Angebote Semester 4"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem4"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudAmountCoursesSem4" ValueChanged="NudAmountCoursesSem4_OnValueChanged"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
|
||||||
<Label Content="Alternativkurse"></Label>
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
|
||||||
<Grid ColumnDefinitions="*,50">
|
|
||||||
<ComboBox Height="35" HorizontalAlignment="Stretch" x:Name="CbAlternativCourse"></ComboBox>
|
|
||||||
<Button Grid.Column="1" Margin="0,10,0,0" x:Name="BtnAlternativeCourseAdd" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnImportDefaultCourses_OnClick" HorizontalContentAlignment="Center">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<LucideIcon Kind="Plus" Width="24" Height="24" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
<ListBox x:Name="LbAlternativeCourses">
|
|
||||||
<ContextMenu>
|
|
||||||
<MenuItem x:Name="MnuAlternativeCoursesDelete" Header="Entfernen"></MenuItem>
|
|
||||||
</ContextMenu>
|
|
||||||
</ListBox>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,3*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
<Label Content="Alternativbezeichnungen"></Label>
|
<Label Content="Alternativbezeichnungen"></Label>
|
||||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||||
<Grid ColumnDefinitions="*,50">
|
<Grid ColumnDefinitions="*,50,50">
|
||||||
<TextBox Grid.Column="0" Height="35" HorizontalAlignment="Stretch" x:Name="TbSportAlternativeName" TextChanged="TbStudentID_OnTextChanged"></TextBox>
|
<TextBox Grid.Column="0" Height="35" HorizontalAlignment="Stretch" x:Name="TbSportAlternativeName"></TextBox>
|
||||||
<Button Grid.Column="1" Margin="0,10,0,0" x:Name="BtnAlternativeNameAdd" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnImportDefaultCourses_OnClick" HorizontalContentAlignment="Center">
|
<Button Grid.Column="1" Margin="5,0,0,0" x:Name="BtnAlternativeNameAdd" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnAlternativeNameAdd_OnClick" HorizontalContentAlignment="Center">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="Plus" Width="24" Height="24" />
|
<LucideIcon Kind="Plus" Width="24" Height="24" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Grid.Column="2" Margin="5,0,0,0" x:Name="BtnAlternativeNameRemove" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnAlternativeNameRemove_OnClick" HorizontalContentAlignment="Center">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Minus" Width="24" Height="24" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ListBox x:Name="LbAlternativeNames">
|
<ListBox Margin="0,5,0,0" x:Name="LbAlternativeNames">
|
||||||
<ContextMenu>
|
|
||||||
<MenuItem x:Name="MnuAlternativeNameDelete" Header="Entfernen"></MenuItem>
|
|
||||||
</ContextMenu>
|
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Line />
|
||||||
|
<Grid ColumnDefinitions="*,3*">
|
||||||
|
<Label Content="Maximale Sportkursanzahl pro Semester"></Label>
|
||||||
|
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester" ValueChanged="NudSportMaxPerSemester_OnValueChanged"></NumericUpDown>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -201,11 +210,33 @@
|
|||||||
<Label FontSize="20" Content="Ergebnisse" VerticalContentAlignment="Center" />
|
<Label FontSize="20" Content="Ergebnisse" VerticalContentAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<Grid ColumnDefinitions="*,*">
|
<Grid ColumnDefinitions="*,*" RowDefinitions="50,2*,*">
|
||||||
<ListBox x:Name="LbResult" Margin="10,10,10,10"></ListBox>
|
<ListBox Grid.RowSpan="2" x:Name="LbResult" Margin="0,10,10,10"></ListBox>
|
||||||
<ScrollViewer Grid.Column="1">
|
<Grid Grid.Row="0" Grid.Column="1" Grid.ColumnDefinitions="*,*">
|
||||||
|
<Button Grid.Column="0" Margin="0,10,0,0" x:Name="BtnExportCoursePDF" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCoursePDF_OnClick" HorizontalContentAlignment="Center">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="FileText" Width="24" Height="24" />
|
||||||
|
<Label Content="Export (PDF)..." VerticalContentAlignment="Center" FontSize="12"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Grid.Column="1" Margin="5,10,0,0" x:Name="BtnExportCourseCSV" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCourseCSV_OnClick" HorizontalContentAlignment="Center">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="FileJson" Width="24" Height="24" />
|
||||||
|
<Label Content="Export (CSV)..." VerticalContentAlignment="Center" FontSize="12"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<ScrollViewer Grid.Row="1" Grid.Column="1" Margin="0,5,0,10" Background="#44CCCCCC">
|
||||||
<TextBlock x:Name="TbResultStatistics"></TextBlock>
|
<TextBlock x:Name="TbResultStatistics"></TextBlock>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
<ScrollViewer Grid.Row="2" Grid.Column="1" Margin="0,0,0,10" Background="#44CCCCCC">
|
||||||
|
<TextBlock x:Name="TbResultTextout" FontFamily="Consolas"></TextBlock>
|
||||||
|
</ScrollViewer>
|
||||||
|
<ScrollViewer Grid.Row="2" Grid.Column="0" Margin="0,0,10,10" Background="#44CCCCCC">
|
||||||
|
<TextBlock x:Name="TbResultLog" FontFamily="Consolas"></TextBlock>
|
||||||
|
</ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|||||||
+214
-12
@@ -10,9 +10,18 @@ namespace spplus;
|
|||||||
|
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
public static MainWindow Instance { get; set; }
|
||||||
|
public static string ApplicationVersion = "v1.2.24";
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Settings.ImportInitial();
|
||||||
|
Instance = this;
|
||||||
|
RefreshCoursesList();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
NudSportMaxPerSemester.Value = Settings.Instance.NumCoursesPerSemester;
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MnuExpSettings_OnClick(object? sender, RoutedEventArgs e)
|
private void MnuExpSettings_OnClick(object? sender, RoutedEventArgs e)
|
||||||
@@ -32,7 +41,7 @@ public partial class MainWindow : Window
|
|||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = "https://git.mypapercloud.de/fierke/spplus/wiki",
|
FileName = "https://git.mypapercloud.de/fierke/spplus/wiki",
|
||||||
UseShellExecute = true // Wichtig für Plattformübergreifendes Öffnen
|
UseShellExecute = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -48,7 +57,7 @@ public partial class MainWindow : Window
|
|||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = "https://git.mypapercloud.de/fierke/spplus",
|
FileName = "https://git.mypapercloud.de/fierke/spplus",
|
||||||
UseShellExecute = true // Wichtig für Plattformübergreifendes Öffnen
|
UseShellExecute = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -67,7 +76,7 @@ public partial class MainWindow : Window
|
|||||||
Grid g = new();
|
Grid g = new();
|
||||||
TextBlock tb = new()
|
TextBlock tb = new()
|
||||||
{
|
{
|
||||||
Text = "spplus v1.0.0\n(c)2026 MyPapertown, Elias Fierke"
|
Text = $"spplus {MainWindow.ApplicationVersion}\n(c)2026 MyPapertown, Elias Fierke"
|
||||||
};
|
};
|
||||||
g.Children.Add(tb);
|
g.Children.Add(tb);
|
||||||
w.Content = g;
|
w.Content = g;
|
||||||
@@ -91,6 +100,7 @@ public partial class MainWindow : Window
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (file == null) return;
|
if (file == null) return;
|
||||||
|
if (file.Count == 0) return;
|
||||||
|
|
||||||
var imported_students = import.ImportStudentsFromFile(file[0].Path.LocalPath.ToString());
|
var imported_students = import.ImportStudentsFromFile(file[0].Path.LocalPath.ToString());
|
||||||
foreach (var s in imported_students)
|
foreach (var s in imported_students)
|
||||||
@@ -113,15 +123,40 @@ public partial class MainWindow : Window
|
|||||||
LblStudentAmount.Content = Settings.Instance.Students.Count.ToString();
|
LblStudentAmount.Content = Settings.Instance.Students.Count.ToString();
|
||||||
LblSelectedAmount.Content = count_selected.ToString();
|
LblSelectedAmount.Content = count_selected.ToString();
|
||||||
|
|
||||||
|
List<(Sport, List<string>)> initial_sportlist = new();
|
||||||
|
foreach (var sp in Settings.Instance.Sports)
|
||||||
|
{
|
||||||
|
initial_sportlist.Add((sp, new()));
|
||||||
|
}
|
||||||
|
foreach (Student s in Settings.Instance.Students)
|
||||||
|
{
|
||||||
|
foreach (var sp in s.SelectedCourseNames)
|
||||||
|
{
|
||||||
|
foreach (var item in initial_sportlist)
|
||||||
|
{
|
||||||
|
if (item.Item1.AlternativeNames.Contains(sp))
|
||||||
|
{
|
||||||
|
item.Item2.Add(s.ID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LblNumVoted.Content = "";
|
||||||
|
foreach (var s in initial_sportlist)
|
||||||
|
{
|
||||||
|
LblNumVoted.Content += $"{s.Item1.Name}: {s.Item2.Count}\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnCraftCourses_OnClick(object? sender, RoutedEventArgs e)
|
private void BtnCraftCourses_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// Craft courses here / call course-crafter
|
|
||||||
CourseCrafter.Craft();
|
CourseCrafter.Craft();
|
||||||
RefreshResultView();
|
RefreshResultView();
|
||||||
TbiResults.Focus();
|
TclMainView.SelectedIndex = 2;
|
||||||
|
//TbiResults.Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshResultView()
|
private void RefreshResultView()
|
||||||
@@ -131,7 +166,7 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for(int i = 0; i<s.Result.Count;i++)
|
for(int i = 0; i<s.Result.Length;i++)
|
||||||
{
|
{
|
||||||
LbResult.Items.Add($"{s.Name} ({s.ID}) - {i+1}. Semester: {s.Result[i]}");
|
LbResult.Items.Add($"{s.Name} ({s.ID}) - {i+1}. Semester: {s.Result[i]}");
|
||||||
}
|
}
|
||||||
@@ -206,7 +241,7 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
((Student)LbStudentsImported.SelectedItem).Name = TbStudentID.Text;
|
((Student)LbStudentsImported.SelectedItem).ID = TbStudentID.Text;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -244,11 +279,11 @@ public partial class MainWindow : Window
|
|||||||
NudAmountCoursesSem2.Value = item.Semester[1];
|
NudAmountCoursesSem2.Value = item.Semester[1];
|
||||||
NudAmountCoursesSem3.Value = item.Semester[2];
|
NudAmountCoursesSem3.Value = item.Semester[2];
|
||||||
NudAmountCoursesSem4.Value = item.Semester[3];
|
NudAmountCoursesSem4.Value = item.Semester[3];
|
||||||
LbAlternativeCourses.Items.Clear();
|
// LbAlternativeCourses.Items.Clear();
|
||||||
foreach (var alternative in item.AlternativeCourses)
|
// foreach (var alternative in item.AlternativeCourses)
|
||||||
{
|
// {
|
||||||
LbAlternativeCourses.Items.Add(Settings.GetSportNameFromID(alternative));
|
// LbAlternativeCourses.Items.Add(Settings.GetSportNameFromID(alternative));
|
||||||
}
|
// }
|
||||||
LbAlternativeNames.Items.Clear();
|
LbAlternativeNames.Items.Clear();
|
||||||
foreach (var alternative in item.AlternativeNames)
|
foreach (var alternative in item.AlternativeNames)
|
||||||
{
|
{
|
||||||
@@ -257,4 +292,171 @@ public partial class MainWindow : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TbSportName_OnTextChanged(object? sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).Name = TbSportName.Text;
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudSportMaxStudents_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).MaxStudents = Convert.ToInt32(NudSportMaxStudents.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudSportMinStudents_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).MinStudents = Convert.ToInt32(NudSportMinStudents.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudAmountCoursesSem1_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).Semester[0] = Convert.ToInt32(NudAmountCoursesSem1.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudAmountCoursesSem2_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).Semester[1] = Convert.ToInt32(NudAmountCoursesSem2.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudAmountCoursesSem3_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).Semester[2] = Convert.ToInt32(NudAmountCoursesSem3.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudAmountCoursesSem4_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).Semester[3] = Convert.ToInt32(NudAmountCoursesSem4.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAlternativeCourseAdd_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(TbSportAlternativeName.Text);
|
||||||
|
//TbSportAlternativeCourse.Text = "";
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAlternativeNameAdd_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(TbSportAlternativeName.Text);
|
||||||
|
LbAlternativeNames.Items.Add(TbSportAlternativeName.Text);
|
||||||
|
TbSportAlternativeName.Text = "";
|
||||||
|
|
||||||
|
int curr_selected = LbSportCourses.SelectedIndex;
|
||||||
|
RefreshCoursesList();
|
||||||
|
LbSportCourses.SelectedIndex = curr_selected;
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAlternativeNameRemove_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
LbAlternativeNames.Items.Remove(LbAlternativeNames.SelectedItem);
|
||||||
|
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Clear();
|
||||||
|
foreach (string s in LbAlternativeNames.Items)
|
||||||
|
{
|
||||||
|
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
int curr_selected = LbSportCourses.SelectedIndex;
|
||||||
|
RefreshCoursesList();
|
||||||
|
LbSportCourses.SelectedIndex = curr_selected;
|
||||||
|
//} catch (Exception ex) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void BtnClearCourseList_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var result = await MessageBox.Show(this,
|
||||||
|
"Möchten Sie wirklich alle Kurse löschen?\n Dies kann nicht rückgängig gemacht werden.",
|
||||||
|
"Wirklich fortfahren?", MessageBoxButton.YesNo);
|
||||||
|
if (result == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
Settings.Instance.Sports.Clear();
|
||||||
|
RefreshCoursesList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnDeleteSinleCourse_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Settings.Instance.Sports.Remove(LbSportCourses.SelectedItem as Sport);
|
||||||
|
RefreshCoursesList();
|
||||||
|
} catch (Exception ex){}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnExportCoursePDF_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Export as PDF
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudSportMaxPerSemester_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Settings.Instance.NumCoursesPerSemester = Convert.ToInt32(NudSportMaxPerSemester.Value);
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void BtnExportCourseCSV_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var topLevel = GetTopLevel(this);
|
||||||
|
var file = await topLevel!.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||||
|
{
|
||||||
|
Title = "CSV-Datei speichern",
|
||||||
|
SuggestedFileType = new FilePickerFileType(".csv-Datei")
|
||||||
|
{
|
||||||
|
Patterns = new[] { "*.csv" }
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (file == null) return;
|
||||||
|
|
||||||
|
ExportUtility.ExportToCSV(file.Path.AbsolutePath);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void MnuImpResult_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Hier importieren
|
||||||
|
var topLevel = GetTopLevel(this);
|
||||||
|
var file = await topLevel!.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = "CSV-Datei laden",
|
||||||
|
SuggestedFileType = new FilePickerFileType(".csv-Datei")
|
||||||
|
{
|
||||||
|
Patterns = new[] { "*.csv" }
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (file == null) return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" SizeToContent="WidthAndHeight"
|
mc:Ignorable="d" SizeToContent="WidthAndHeight"
|
||||||
x:Class="spplus.MessageBox"
|
x:Class="spplus.MessageBox" WindowStartupLocation="CenterScreen"
|
||||||
Title="MessageBox">
|
Title="MessageBox">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Name="Text" Margin="10" TextWrapping="Wrap" />
|
<TextBlock Name="Text" Margin="10" TextWrapping="Wrap" />
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
# SP+
|
# SP+
|
||||||
|
|
||||||
Interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch SuS.
|
Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch SuS.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* \+ Import von CSV-Dateien mit Kurswahl
|
* \+ Import von CSV-Dateien mit Kurswahl
|
||||||
* ~ Wahlansicht
|
* \+ Wahlansicht
|
||||||
* \+ Statistiken
|
* \+ Statistiken
|
||||||
* ~ Pflege von Sportkursen (inkl. Kürzel/ alternativen Bezeichnungen)
|
* \+ Pflege von Sportkursen (inkl. Kürzel/ alternativen Bezeichnungen)
|
||||||
|
* \+ CSV-Export
|
||||||
* ~ Fehleransicht für nicht-existente, aber gewählte Kurse
|
* ~ Fehleransicht für nicht-existente, aber gewählte Kurse
|
||||||
|
* ~ PDF-Export
|
||||||
|
|
||||||
\+ Vorhanden, ~ Pending
|
\+ Vorhanden, ~ Pending
|
||||||
|
|
||||||
@@ -19,3 +23,5 @@ Interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch
|
|||||||
* Suche `spplus` bzw. `spplus.exe` und führe aus
|
* Suche `spplus` bzw. `spplus.exe` und führe aus
|
||||||
* Linux/MacOS evl.: `chmod +x spplus`
|
* Linux/MacOS evl.: `chmod +x spplus`
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
+852
-173
File diff suppressed because it is too large
Load Diff
+19
@@ -0,0 +1,19 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace spplus;
|
||||||
|
|
||||||
|
public static class ExportUtility
|
||||||
|
{
|
||||||
|
public static void ExportToCSV(string filepath)
|
||||||
|
{
|
||||||
|
char separator = ',';
|
||||||
|
string header = $"SchuelerID{separator}Sem1{separator}Sem2{separator}Sem3{separator}Sem4";
|
||||||
|
string output = header + "\n";
|
||||||
|
foreach (var student in Settings.Instance.Students)
|
||||||
|
{
|
||||||
|
output += $"{student.ID}{separator}{student.Result[0]}{separator}{student.Result[1]}{separator}{student.Result[2]}{separator}{student.Result[3]}\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
File.WriteAllText(filepath, output);
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 194 KiB |
@@ -47,4 +47,45 @@ public static class import
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Student> ImportResultFromFile(string path)
|
||||||
|
{
|
||||||
|
var dict = new Dictionary<string, (string Name, List<string> Courses)>();
|
||||||
|
|
||||||
|
foreach (var line in File.ReadLines(path).Skip(1)) // Header überspringen
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(line))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var parts = line.Split(',');
|
||||||
|
if (parts.Length < 3)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string nameWithId = parts[0].Trim();
|
||||||
|
string course = parts[2].Replace("(2)", "").Replace("(3)", "").Replace("(4)", "").Trim();
|
||||||
|
|
||||||
|
int open = nameWithId.LastIndexOf('(');
|
||||||
|
int close = nameWithId.LastIndexOf(')');
|
||||||
|
if (open < 0 || close < 0 || close <= open)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string name = nameWithId[..open].Trim();
|
||||||
|
string id = nameWithId[(open + 1)..close].Trim();
|
||||||
|
|
||||||
|
if (!dict.ContainsKey(id))
|
||||||
|
dict[id] = (name, new List<string>());
|
||||||
|
|
||||||
|
dict[id].Courses.Add(course);
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = new List<Student>();
|
||||||
|
|
||||||
|
foreach (var (id, data) in dict)
|
||||||
|
{
|
||||||
|
var student = new Student(id, data.Name, data.Courses);
|
||||||
|
result.Add(student);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
+12
-12
@@ -12,7 +12,7 @@ public class Sport
|
|||||||
public int MinStudents { get; set; } = 5; // Minimale Anzahl an Schülern pro Kurs
|
public int MinStudents { get; set; } = 5; // Minimale Anzahl an Schülern pro Kurs
|
||||||
public int[] Semester { get; set; } = [2, 2, 2, 2]; // Maximale Anzahl an Angeboten in den jeweiligen Index-Semestern (0 => 1. Semester)
|
public int[] Semester { get; set; } = [2, 2, 2, 2]; // Maximale Anzahl an Angeboten in den jeweiligen Index-Semestern (0 => 1. Semester)
|
||||||
public List<string> AlternativeNames { get; set; } = new();
|
public List<string> AlternativeNames { get; set; } = new();
|
||||||
public List<int> AlternativeCourses { get; set; } = new();
|
//public List<int> AlternativeCourses { get; set; } = new();
|
||||||
|
|
||||||
protected Sport()
|
protected Sport()
|
||||||
{
|
{
|
||||||
@@ -33,15 +33,15 @@ public class Sport
|
|||||||
AlternativeNames = alternativeNames;
|
AlternativeNames = alternativeNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAlternativeSport(int id)
|
// public void AddAlternativeSport(int id)
|
||||||
{
|
// {
|
||||||
AlternativeCourses.Add(id);
|
// AlternativeCourses.Add(id);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void ClearAlternativeSport()
|
// public void ClearAlternativeSport()
|
||||||
{
|
// {
|
||||||
AlternativeCourses.Clear();
|
// AlternativeCourses.Clear();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ public class Student
|
|||||||
public string ID { get; set; } = ""; // ID des Schüler (z.B. NolteSeb)
|
public string ID { get; set; } = ""; // ID des Schüler (z.B. NolteSeb)
|
||||||
public string Name { get; set; } = ""; // Name des Schülers
|
public string Name { get; set; } = ""; // Name des Schülers
|
||||||
public List<string> SelectedCourseNames { get; set; } = new();
|
public List<string> SelectedCourseNames { get; set; } = new();
|
||||||
public List<string>? Result { get; set; } = null;
|
public string[] Result { get; set; } = new string[4];
|
||||||
|
|
||||||
public Student()
|
public Student()
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ public class Settings
|
|||||||
|
|
||||||
public List<Student> Students { get; set; } = [];
|
public List<Student> Students { get; set; } = [];
|
||||||
public List<Sport> Sports { get; set; } = [];
|
public List<Sport> Sports { get; set; } = [];
|
||||||
public int NumCoursesPerSemester { get; set; } = 10;
|
public int NumCoursesPerSemester { get; set; } = 10; // Exact Amount of courses, not a maximum
|
||||||
|
|
||||||
public Settings()
|
public Settings()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user