[chore:] added course edit functionality
This commit is contained in:
@@ -118,37 +118,37 @@
|
|||||||
</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*">
|
<Grid ColumnDefinitions="*,3*">
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||||
<Grid ColumnDefinitions="*,50">
|
<Grid ColumnDefinitions="*,50">
|
||||||
<ComboBox Height="35" HorizontalAlignment="Stretch" x:Name="CbAlternativCourse"></ComboBox>
|
<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">
|
<Button Grid.Column="1" Margin="0,10,0,0" x:Name="BtnAlternativeCourseAdd" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnAlternativeCourseAdd_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>
|
||||||
@@ -175,8 +175,8 @@
|
|||||||
<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">
|
||||||
<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="0,10,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>
|
||||||
|
|||||||
@@ -258,4 +258,79 @@ 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 = "";
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user