AddTeacher.axaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="TeacheresAndCourses.AddTeacher"
  7. xmlns:vm="using:TeacheresAndCourses.ViewModels"
  8. x:DataType="vm:AddTeacherViewModel"
  9. xmlns:conv="using:TeacheresAndCourses.Converter">
  10. <UserControl.Resources>
  11. <conv:DateConverter x:Key="myConverter"/>
  12. </UserControl.Resources>
  13. <Grid>
  14. <ScrollViewer>
  15. <StackPanel Classes="addTeacherSP">
  16. <TextBlock Classes="addingTextFont">Регистрация преподавателя в системе</TextBlock>
  17. <StackPanel Classes="oneLine2">
  18. <StackPanel Classes="inputTextSP">
  19. <TextBlock Classes="addingTextStyle" Text="Фамилия: "></TextBlock>
  20. <TextBlock Classes="addingTextStyle" Text="Имя: "></TextBlock>
  21. <TextBlock Classes="addingTextStyle" Text="Отчество: "></TextBlock>
  22. <TextBlock Classes="addingTextStyle" Text="Пол: "></TextBlock>
  23. <TextBlock Classes="addingTextStyle" Text="День рождения: "></TextBlock>
  24. <TextBlock Classes="addingTextStyle" Text="Опыт (в месяцах): "></TextBlock>
  25. <TextBlock Classes="addingTextStyle" Text="Электронная почта: "></TextBlock>
  26. <TextBlock Classes="addingTextStyle" Text="Номер телефона: "></TextBlock>
  27. <TextBlock Classes="addingTextStyle" Text="Предметы: "></TextBlock>
  28. <TextBlock Classes="addingTextStyle" Text="Курсы: "></TextBlock>
  29. </StackPanel>
  30. <StackPanel>
  31. <TextBox Text="{Binding NewTeacher.Lastname}" Classes="inputTB"></TextBox>
  32. <TextBox Text="{Binding NewTeacher.Firstname}" Classes="inputTB"></TextBox>
  33. <TextBox Text="{Binding NewTeacher.Patronymic}" Classes="inputTB"></TextBox>
  34. <ComboBox Classes="inputCB" ItemsSource="{Binding genderList}" SelectedItem="{Binding NewTeacher.GenderNavigation}">
  35. <ComboBox.ItemTemplate>
  36. <DataTemplate>
  37. <TextBlock Text="{Binding Title}"></TextBlock>
  38. </DataTemplate>
  39. </ComboBox.ItemTemplate>
  40. </ComboBox>
  41. <DatePicker SelectedDate="{Binding NewTeacher.Birthday, Converter={StaticResource myConverter}}" Classes="inputDP"></DatePicker>
  42. <TextBox Text="{Binding NewTeacher.ExperienceInMonth}" Classes="inputTB"></TextBox>
  43. <TextBox Text="{Binding NewTeacher.Email}" Classes="inputTB"></TextBox>
  44. <TextBox Text="{Binding NewTeacher.PhoneNumber}" Classes="inputTB"></TextBox>
  45. <ComboBox Classes="inputCB" ItemsSource="{Binding subjectList}" SelectedValue="{Binding NewSub}">
  46. <ComboBox.ItemTemplate>
  47. <DataTemplate>
  48. <TextBlock Text="{Binding Title}"></TextBlock>
  49. </DataTemplate>
  50. </ComboBox.ItemTemplate>
  51. </ComboBox>
  52. <ComboBox Classes="inputCB" ItemsSource="{Binding courseList}" SelectedValue="{Binding NewCou}">
  53. <ComboBox.ItemTemplate>
  54. <DataTemplate>
  55. <TextBlock Text="{Binding Title}"></TextBlock>
  56. </DataTemplate>
  57. </ComboBox.ItemTemplate>
  58. </ComboBox>
  59. <Button Command="{Binding ToAddCoursePage}" Classes="saveButton">Добавить курс</Button>
  60. </StackPanel>
  61. </StackPanel>
  62. <StackPanel>
  63. <TextBlock Classes="selectedTextStyle" Text="Выбранные курсы"></TextBlock>
  64. </StackPanel>
  65. <StackPanel Classes="coursesAndSubjects">
  66. <ListBox Classes="addLB" ItemsSource="{Binding TeacCoursesList}">
  67. <ListBox.ItemTemplate>
  68. <DataTemplate>
  69. <StackPanel>
  70. <TextBlock Text="{Binding Course.Title}"></TextBlock>
  71. <Button Command="{Binding $parent[UserControl].((vm:AddTeacherViewModel)DataContext).DeleteCou}" CommandParameter="{Binding}">Удалить</Button>
  72. </StackPanel>
  73. </DataTemplate>
  74. </ListBox.ItemTemplate>
  75. </ListBox>
  76. </StackPanel>
  77. <StackPanel Classes="coursesAndSubjects">
  78. <TextBlock Classes="selectedTextStyle" Text="Выбранные предметы"></TextBlock>
  79. </StackPanel>
  80. <StackPanel Classes="coursesAndSubjects">
  81. <ListBox Classes="addLB" ItemsSource="{Binding TeacSubjectsList}">
  82. <ListBox.ItemTemplate>
  83. <DataTemplate>
  84. <StackPanel>
  85. <TextBlock Text="{Binding Subject.Title}"></TextBlock>
  86. <Button Command="{Binding $parent[UserControl].((vm:AddTeacherViewModel)DataContext).DeleteSub}" CommandParameter="{Binding}">Удалить</Button>
  87. </StackPanel>
  88. </DataTemplate>
  89. </ListBox.ItemTemplate>
  90. </ListBox>
  91. </StackPanel>
  92. <Button Command="{Binding AddTeacher}" Classes="saveButton">
  93. <TextBlock Text="{Binding ButtonText}"></TextBlock>
  94. </Button>
  95. <Button Command="{Binding ToMainPage}" Classes="saveButton">На главную</Button>
  96. </StackPanel>
  97. </ScrollViewer>
  98. </Grid>
  99. </UserControl>