муха кирилл 3 lat temu
commit
cc844ec7b8
100 zmienionych plików z 9366 dodań i 0 usunięć
  1. 63 0
      KursachMukha692gr/.gitattributes
  2. 363 0
      KursachMukha692gr/.gitignore
  3. 30 0
      KursachMukha692gr/AddRaspisaniye.xaml
  4. 192 0
      KursachMukha692gr/AddRaspisaniye.xaml.cs
  5. 24 0
      KursachMukha692gr/AddTournment.xaml
  6. 160 0
      KursachMukha692gr/AddTournment.xaml.cs
  7. 31 0
      KursachMukha692gr/AddTrener.xaml
  8. 225 0
      KursachMukha692gr/AddTrener.xaml.cs
  9. 31 0
      KursachMukha692gr/AddUchenik.xaml
  10. 214 0
      KursachMukha692gr/AddUchenik.xaml.cs
  11. 23 0
      KursachMukha692gr/App.config
  12. 16 0
      KursachMukha692gr/App.xaml
  13. 17 0
      KursachMukha692gr/App.xaml.cs
  14. 34 0
      KursachMukha692gr/AppContext.cs
  15. 23 0
      KursachMukha692gr/Book.cs
  16. 25 0
      KursachMukha692gr/CatTrenerUpdate.xaml
  17. 104 0
      KursachMukha692gr/CatTrenerUpdate.xaml.cs
  18. 25 0
      KursachMukha692gr/DataUpdateTrener.xaml
  19. 109 0
      KursachMukha692gr/DataUpdateTrener.xaml.cs
  20. 25 0
      KursachMukha692gr/DataUpdateUchenik.xaml
  21. 109 0
      KursachMukha692gr/DataUpdateUchenik.xaml.cs
  22. 24 0
      KursachMukha692gr/DeleteRaspisaniye.xaml
  23. 68 0
      KursachMukha692gr/DeleteRaspisaniye.xaml.cs
  24. 24 0
      KursachMukha692gr/DeleteSpisokTrenerov.xaml
  25. 69 0
      KursachMukha692gr/DeleteSpisokTrenerov.xaml.cs
  26. 24 0
      KursachMukha692gr/DeleteSpisokUchenikov.xaml
  27. 69 0
      KursachMukha692gr/DeleteSpisokUchenikov.xaml.cs
  28. 24 0
      KursachMukha692gr/DeleteTournment.xaml
  29. 67 0
      KursachMukha692gr/DeleteTournment.xaml.cs
  30. 25 0
      KursachMukha692gr/DisUpdateTrener.xaml
  31. 104 0
      KursachMukha692gr/DisUpdateTrener.xaml.cs
  32. 25 0
      KursachMukha692gr/IdCorpusUpdateRaspisaniye.xaml
  33. 102 0
      KursachMukha692gr/IdCorpusUpdateRaspisaniye.xaml.cs
  34. 25 0
      KursachMukha692gr/IdDenUpdateRaspisaniye.xaml
  35. 102 0
      KursachMukha692gr/IdDenUpdateRaspisaniye.xaml.cs
  36. 25 0
      KursachMukha692gr/IdDisUpdateRaspisaniye.xaml
  37. 102 0
      KursachMukha692gr/IdDisUpdateRaspisaniye.xaml.cs
  38. 25 0
      KursachMukha692gr/IdDisUpdateUchenik.xaml
  39. 104 0
      KursachMukha692gr/IdDisUpdateUchenik.xaml.cs
  40. 25 0
      KursachMukha692gr/IdTrenerUpdateRaspisaniye.xaml
  41. 102 0
      KursachMukha692gr/IdTrenerUpdateRaspisaniye.xaml.cs
  42. 25 0
      KursachMukha692gr/IdVremyaUpdateRaspisaniye.xaml
  43. 102 0
      KursachMukha692gr/IdVremyaUpdateRaspisaniye.xaml.cs
  44. 25 0
      KursachMukha692gr/IdZalUpdateRaspisaniye.xaml
  45. 102 0
      KursachMukha692gr/IdZalUpdateRaspisaniye.xaml.cs
  46. 25 0
      KursachMukha692gr/KabinetAdmina.xaml
  47. 74 0
      KursachMukha692gr/KabinetAdmina.xaml.cs
  48. 611 0
      KursachMukha692gr/KursachMukha692gr.csproj
  49. 31 0
      KursachMukha692gr/KursachMukha692gr.sln
  50. 18 0
      KursachMukha692gr/MainWindow.xaml
  51. 43 0
      KursachMukha692gr/MainWindow.xaml.cs
  52. 43 0
      KursachMukha692gr/Model1.Context.cs
  53. 636 0
      KursachMukha692gr/Model1.Context.tt
  54. 10 0
      KursachMukha692gr/Model1.Designer.cs
  55. 9 0
      KursachMukha692gr/Model1.cs
  56. 1077 0
      KursachMukha692gr/Model1.edmx
  57. 42 0
      KursachMukha692gr/Model1.edmx.diagram
  58. 733 0
      KursachMukha692gr/Model1.tt
  59. 25 0
      KursachMukha692gr/NumberUpdateTrener.xaml
  60. 104 0
      KursachMukha692gr/NumberUpdateTrener.xaml.cs
  61. 25 0
      KursachMukha692gr/NumberUpdateUchenik.xaml
  62. 105 0
      KursachMukha692gr/NumberUpdateUchenik.xaml.cs
  63. 25 0
      KursachMukha692gr/PolUpdateTrener.xaml
  64. 104 0
      KursachMukha692gr/PolUpdateTrener.xaml.cs
  65. 55 0
      KursachMukha692gr/Properties/AssemblyInfo.cs
  66. 63 0
      KursachMukha692gr/Properties/Resources.Designer.cs
  67. 117 0
      KursachMukha692gr/Properties/Resources.resx
  68. 26 0
      KursachMukha692gr/Properties/Settings.Designer.cs
  69. 7 0
      KursachMukha692gr/Properties/Settings.settings
  70. 34 0
      KursachMukha692gr/RASPISANIYE.cs
  71. 23 0
      KursachMukha692gr/Raspisaniye.xaml
  72. 104 0
      KursachMukha692gr/Raspisaniye.xaml.cs
  73. 31 0
      KursachMukha692gr/RegUch.xaml
  74. 271 0
      KursachMukha692gr/RegUch.xaml.cs
  75. 23 0
      KursachMukha692gr/Registration.xaml
  76. 149 0
      KursachMukha692gr/Registration.xaml.cs
  77. 20 0
      KursachMukha692gr/RegistrationTEST.xaml
  78. 96 0
      KursachMukha692gr/RegistrationTEST.xaml.cs
  79. 21 0
      KursachMukha692gr/SmenaPassword.xaml
  80. 124 0
      KursachMukha692gr/SmenaPassword.xaml.cs
  81. 27 0
      KursachMukha692gr/SpisokTrenerov.xaml
  82. 105 0
      KursachMukha692gr/SpisokTrenerov.xaml.cs
  83. 27 0
      KursachMukha692gr/SpisokUchenikov.xaml
  84. 104 0
      KursachMukha692gr/SpisokUchenikov.xaml.cs
  85. 27 0
      KursachMukha692gr/Tournments.xaml
  86. 135 0
      KursachMukha692gr/Tournments.xaml.cs
  87. 25 0
      KursachMukha692gr/UpdateFamiliyaTrener.xaml
  88. 111 0
      KursachMukha692gr/UpdateFamiliyaTrener.xaml.cs
  89. 25 0
      KursachMukha692gr/UpdateFamiliyaUchenik.xaml
  90. 111 0
      KursachMukha692gr/UpdateFamiliyaUchenik.xaml.cs
  91. 25 0
      KursachMukha692gr/UpdateGruppaRaspisaniye.xaml
  92. 102 0
      KursachMukha692gr/UpdateGruppaRaspisaniye.xaml.cs
  93. 24 0
      KursachMukha692gr/UpdateGruppaTournment.xaml
  94. 102 0
      KursachMukha692gr/UpdateGruppaTournment.xaml.cs
  95. 25 0
      KursachMukha692gr/UpdateGruppaUchenik.xaml
  96. 102 0
      KursachMukha692gr/UpdateGruppaUchenik.xaml.cs
  97. 25 0
      KursachMukha692gr/UpdateIdDiscipliniTournment.xaml
  98. 103 0
      KursachMukha692gr/UpdateIdDiscipliniTournment.xaml.cs
  99. 25 0
      KursachMukha692gr/UpdateIdTrenerTournment.xaml
  100. 0 0
      KursachMukha692gr/UpdateIdTrenerTournment.xaml.cs

+ 63 - 0
KursachMukha692gr/.gitattributes

@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain

+ 363 - 0
KursachMukha692gr/.gitignore

@@ -0,0 +1,363 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Oo]ut/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd

+ 30 - 0
KursachMukha692gr/AddRaspisaniye.xaml

@@ -0,0 +1,30 @@
+<Window x:Class="KursachMukha692gr.AddRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Добавление занятия" Height="630" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Добавление занятия" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="den_id" materialDesign:HintAssist.Hint="Введите id дня недели" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="vremya_id" materialDesign:HintAssist.Hint="Введите id времени занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="gruppa" materialDesign:HintAssist.Hint="Введите номер группы" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="disciplina" materialDesign:HintAssist.Hint="Введите id дисциплины" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="zal" materialDesign:HintAssist.Hint="Введите id зала тренировки" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="trener_id" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="corpus" materialDesign:HintAssist.Hint="Введите id корпуса" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Height="36"/>
+                <Button Content="Добавить занятие" Margin="0 20" Background="#006363" Click="Button_Click_Add"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 192 - 0
KursachMukha692gr/AddRaspisaniye.xaml.cs

@@ -0,0 +1,192 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для AddRaspisaniye.xaml
+    /// </summary>
+    public partial class AddRaspisaniye : Window
+    {
+        public AddRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Add(object sender, RoutedEventArgs e)
+        {
+            if (den_id.Text != "" && vremya_id.Text != "" && gruppa.Text != "" && disciplina.Text != "" && zal.Text != "" && trener_id.Text !="" && corpus.Text !="")
+            {
+                bool den = false, time = false, dis = false, gr = false, trener = false,z = false, cor = false;
+                for (int i = 0; i < den_id.Text.Length; i++)
+                {
+                    if (den)
+                    {
+                        den = false;
+                    }
+                    if (den_id.Text[i] >= '1' && den_id.Text[i] <= '7')
+                    {
+                        den = true;
+                        break;
+                    }
+                    if (den == false)
+                    {
+                        MessageBox.Show("Поле день недели должно содержать id дня недели (1-понедельник , 2-вторник, 3-среда,4-четверг,5-пятница,6-суббота,7-воскресенье)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < vremya_id.Text.Length; i++)
+                {
+                    if (time)
+                    {
+                        time = false;
+                    }
+                    if (vremya_id.Text[i] >= '1' && vremya_id.Text[i] <= '7')
+                    {
+                        time = true;
+                        break;
+                    }
+                    if (time == false)
+                    {
+                        MessageBox.Show("Поле время занятия должно содержать id времени занятия (1-(06:00-08:00) , 2-(08:30-10:30), 3-(11:00-13:00), 4-(13:30-15:30), 5-(16:00-18:00), 6-(18:30-20:30), 7-(21:00-23:00))");
+                        break;
+                    }
+                }
+                for (int i = 0; i < gruppa.Text.Length; i++)
+                {
+                    if (gr)
+                    {
+                        gr = false;
+                    }
+                    if (gruppa.Text[i] >= '0' && gruppa.Text[i] <= '9' && gruppa.Text.Length == 3)
+                    {
+                        gr = true;
+                        break;
+                    }
+                    if (gr == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < disciplina.Text.Length; i++)
+                {
+                    if (dis)
+                    {
+                        dis = false;
+                    }
+                    if (disciplina.Text[i] >= '1' && disciplina.Text[i] <= '7' && disciplina.Text.Length == 1)
+                    {
+                        dis = true;
+                        break;
+                    }
+                    if (dis == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < zal.Text.Length; i++)
+                {
+                    if (z)
+                    {
+                        z = false;
+                    }
+                    if (zal.Text[i] >= '1' && zal.Text[i] <= '7' && disciplina.Text.Length == 1)
+                    {
+                        z = true;
+                        break;
+                    }
+                    if (z == false)
+                    {
+                        MessageBox.Show("Поле зал тренировки должно содержать id зала (1-хоккейная площадка,2-Зал волейбола,3-Футбольное поле,4-Зал баскетбола,5-Бассейн,6-Зал мини-футбола,7-Зал бокса)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < trener_id.Text.Length; i++)
+                {
+                    if (trener)
+                    {
+                        trener = false;
+                    }
+                    if (trener_id.Text[i] >= '0' && trener_id.Text[i] <= '9')
+                    {
+                        trener = true;
+                        break;
+                    }
+                    if (trener == false)
+                    {
+                        MessageBox.Show("Поле тренер должно содержать id тренера");
+                        break;
+                    }
+                }
+                for (int i = 0; i < corpus.Text.Length; i++)
+                {
+                    if (cor)
+                    {
+                        cor = false;
+                    }
+                    if (corpus.Text[i] >= '1' && corpus.Text[i] <= '3' && corpus.Text.Length == 1)
+                    {
+                        cor = true;
+                        break;
+                    }
+                    if (cor == false)
+                    {
+                        MessageBox.Show("Поле корпус должно содержать id корпуса (1-Ледовая арена,2-СОК Кристалл ,3-Футбольный стадион Олимп)");
+                        break;
+                    }
+                }
+                if (den && time && dis && gr && trener && z && cor)
+                {
+                    DataTable dt_raspisaniye = Insert("insert into [dbo].[raspisaniye] values " +
+                                                            "('" + den_id.Text + "','" + vremya_id.Text + "','" + gruppa.Text +
+                                                              "','" + disciplina.Text + "','" + zal.Text + "','" + trener_id.Text + "','" + corpus.Text + "')");
+                    MessageBox.Show("Занятие добавлено");
+                    Raspisaniye mainreg = new Raspisaniye();
+                    mainreg.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть заполнены!");
+            }
+        }
+        public DataTable Insert(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            Raspisaniye raspisaniye = new Raspisaniye();
+            raspisaniye.Show();
+            Close();
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/AddTournment.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.AddTournment"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Добавление соревнования" Height="550" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B" Margin="0,0,0,0">
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Добавление соревнования" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="namesorevi" materialDesign:HintAssist.Hint="Введите название турнира" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="mestoprovedeniya" materialDesign:HintAssist.Hint="Введите место проведения турнира" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="disciplina_id" materialDesign:HintAssist.Hint="Введитe id дисциплины" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="gruppa" materialDesign:HintAssist.Hint="Введите номер группы" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="infotrener_id" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Добавить соревнование" Margin="0 20" Background="#006363" Click="Button_Click_Add"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 160 - 0
KursachMukha692gr/AddTournment.xaml.cs

@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для AddTournment.xaml
+    /// </summary>
+    public partial class AddTournment : Window
+    {
+        public AddTournment()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Add(object sender, RoutedEventArgs e)
+        {
+            if(namesorevi.Text != "" && mestoprovedeniya.Text != "" && disciplina_id.Text != "" && gruppa.Text != "" && infotrener_id.Text != "")
+            {
+                bool name = false, mesto = false, dis = false, gr = false, trener = false;
+                for (int i = 0; i < namesorevi.Text.Length; i++)
+                {
+                    if (name)
+                    {
+                        name = false;
+                    }
+                    if (namesorevi.Text[i] >='А' && namesorevi.Text[i] <= 'Я' || namesorevi.Text[i] >= 'а' && namesorevi.Text[i] <= 'я' || namesorevi.Text[i] >= '"' || namesorevi.Text[i] <= ',')
+                    {
+                        name = true;
+                        break;
+                    }
+                    if (name == false)
+                    {
+                        MessageBox.Show("Поле название турнира может содержать только русские символы (и ковычки и  , )");
+                        break;
+                    }
+                }
+                for (int i = 0; i < mestoprovedeniya.Text.Length; i++)
+                {
+                    if (mesto)
+                    {
+                        mesto = false;
+                    }
+                    if (mestoprovedeniya.Text[i] >= 'А' && mestoprovedeniya.Text[i] <= 'Я' || mestoprovedeniya.Text[i] >= 'а' && mestoprovedeniya.Text[i] <= 'я' || mestoprovedeniya.Text[i] >= '"' || mestoprovedeniya.Text[i] <= ',')
+                    {
+                        mesto = true;
+                        break;
+                    }
+                    
+                    if (mesto == false)
+                    {
+                        MessageBox.Show("Поле место проведения может содержать только русские символы (и ковычки и  , )");
+                        break;
+                    }
+                }
+                for (int i = 0; i < disciplina_id.Text.Length; i++)
+                {
+                    if (dis)
+                    {
+                       dis = false;
+                    }
+                    if (disciplina_id.Text[i] >= '0' && disciplina_id.Text[i] <= '7' && disciplina_id.Text.Length == 1)
+                    {
+                        dis = true;
+                        break;
+                    }
+                    if (dis == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < gruppa.Text.Length; i++)
+                {
+                    if (gr)
+                    {
+                        gr = false;
+                    }
+                    if (gruppa.Text[i] >= '0' && gruppa.Text[i] <= '9' && gruppa.Text.Length == 3)
+                    {
+                        gr = true;
+                        break;
+                    }
+                    if (gr == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < infotrener_id.Text.Length; i++)
+                {
+                    if (trener)
+                    {
+                        trener = false;
+                    }
+                    if (infotrener_id.Text[i] >= '0' && infotrener_id.Text[i] <= '9')
+                    {
+                        trener = true;
+                        break;
+                    }
+                    if (trener == false)
+                    {
+                        MessageBox.Show("Поле тренер должно содержать id тренера");
+                        break;
+                    }
+                }
+                if (mesto && dis && trener && gr && name)
+                {
+                    DataTable dt_infotrener = Insert("insert into [dbo].[sorevnovaniya] values " +
+                                                            "('" + namesorevi.Text + "','" + mestoprovedeniya.Text + "','" + disciplina_id.Text +
+                                                              "','" + gruppa.Text + "','" + infotrener_id.Text + "')");
+                    MessageBox.Show("Соревнование добавлено");
+                    Tournments mainreg = new Tournments();
+                    mainreg.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть заполнены!");
+            }
+        }
+        public DataTable Insert(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            Tournments tournments = new Tournments();
+            tournments.Show();
+            Close();
+        }
+    }
+}

+ 31 - 0
KursachMukha692gr/AddTrener.xaml

@@ -0,0 +1,31 @@
+<Window x:Class="KursachMukha692gr.AddTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Добавление тренера" Height="630" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Добавление тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="familiyaTrener" materialDesign:HintAssist.Hint="Введите фамилию" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="imyaTrener" materialDesign:HintAssist.Hint="Введите имя" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="otchTrener" materialDesign:HintAssist.Hint="Введите отчество" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <DatePicker x:Name="dataTrener" materialDesign:HintAssist.Hint="Введите дату рождения" SelectedDateFormat="Short" Height="37"/>
+                <TextBox x:Name ="numberTrener" materialDesign:HintAssist.Hint="Введите номер телефона" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="sportspec" materialDesign:HintAssist.Hint="Введите id спортивной специальности" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="categoryTrener" materialDesign:HintAssist.Hint="Введите тренерскую категорию" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="pol_id" materialDesign:HintAssist.Hint="Введите id пола (1-м , 2-ж)" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Height="36"/>
+                <Button Content="Добавить тренера" Margin="0 20" Background="#006363" Click="Button_Click_Add"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 225 - 0
KursachMukha692gr/AddTrener.xaml.cs

@@ -0,0 +1,225 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для AddTrener.xaml
+    /// </summary>
+    public partial class AddTrener : Window
+    {
+        List<string> Alphabetrus = new List<string> {
+            "А", "а", "Б", "б", "В", "в", "Г", "г", "Д", "д", "Е", "е", "Ё", "ё", "Ж", "ж", "З", "з", "И", "и", "Й", "й",
+            "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "Ф", "ф",
+            "Х", "х", "Ц", "ц", "Ч", "ч", "Ш", "ш", "Щ", "щ", "Ъ", "ъ", "Ы", "ы", "Ь", "ь", "Э", "э", "Ю", "ю", "Я", "я" };
+        List<string> Date = new List<string> {
+            "0","1","2","3","4","5","6","7","8","9","."};
+        public AddTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Add(object sender, RoutedEventArgs e)
+        {
+            if (familiyaTrener.Text != "" && imyaTrener.Text != "" && otchTrener.Text != "" && dataTrener.Text != "" && numberTrener.Text != "" && sportspec.Text != "" && pol_id.Text != "" && categoryTrener.Text!="")
+            {
+                bool fam = false, imya = false, otch = false, data = false, num = false;
+                bool sport = false, pol = false,cat = false;
+                for (int i = 0; i < familiyaTrener.Text.Length; i++)//проверка фамилии
+                {
+                    if (fam)
+                    {
+                        fam = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(familiyaTrener.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            fam = true;
+                            break;
+                        }
+                    }
+                    if (fam == false)
+                    {
+                        MessageBox.Show("Поле фамилия должно содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < imyaTrener.Text.Length; i++)//проверка имени
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(imyaTrener.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле имя должно содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < otchTrener.Text.Length; i++)//проверка отчества
+                {
+                    if (otch)
+                    {
+                        otch = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(otchTrener.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            otch = true;
+                            break;
+                        }
+                    }
+                    if (otch == false)
+                    {
+                        MessageBox.Show("Поле отчество должно содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < dataTrener.Text.Length; i++)//проверка даты рождения
+                {
+                    if (data)
+                    {
+                        data = false;
+                    }
+                    for (int j = 0; j < Date.Count; j++)
+                    {
+                        if (Convert.ToString(dataTrener.Text[i]).Contains(Date[j]))
+                        {
+                            data = true;
+                            break;
+                        }
+                    }
+                    if (data == false)
+                    {
+                        MessageBox.Show("Поле дата рождения должно содержать только цифры и знак '.''");
+                        break;
+                    }
+                }
+                for (int i = 0; i < numberTrener.Text.Length; i++)//проверка номера телефона
+                {
+                    if (num)
+                    {
+                        num = false;
+                    }
+                    if (numberTrener.Text[i] >= '0' && numberTrener.Text[i] <= '9' && numberTrener.Text.Length == 11)
+                    {
+                        num = true;
+                        break;
+                    }
+                    if (num == false)
+                    {
+                        MessageBox.Show("Поле номер телефона  должно содержать только цифры (без знака + и 11 цифр)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < sportspec.Text.Length; i++)
+                {
+                    if (sport)
+                    {
+                        sport = false;
+                    }
+                    if (sportspec.Text[i] >='1' && sportspec.Text[i]<= '7' && sportspec.Text.Length == 1)
+                    {
+                        sport = true;
+                        break;
+                    }
+                    if (sport == false)
+                    {
+                        MessageBox.Show("Поле спортивная специальность должно содержать id специальности (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < pol_id.Text.Length; i++)
+                {
+                    if (pol)
+                    {
+                        pol = false;
+                    }
+                    if (pol_id.Text[i] == '1' || pol_id.Text[i] == '2' && pol_id.Text.Length == 1)
+                    {
+                        pol = true;
+                        break;
+                    }
+                    if (pol == false)
+                    {
+                        MessageBox.Show("Поле пол должно содержать только цифры 1 (мужской) и 2 (женский)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < categoryTrener.Text.Length; i++)
+                {
+                    if (cat)
+                    {
+                        cat = false;
+                    }
+                    if (categoryTrener.Text[i] >= '1' && categoryTrener.Text[i] <= '9' || categoryTrener.Text[i] >= 'A' && categoryTrener.Text[i] <= 'Z')
+                    {
+                        cat = true;
+                        break;
+                    }
+                    if (cat == false)
+                    {
+                        MessageBox.Show("Поле тренерская категория должно содержать только английские буквы и цифры");
+                        break;
+                    }
+                }
+                if (fam && imya && otch && data && num && sport && pol && cat)
+                {
+                    DataTable dt_infotrener = Insert("insert into [dbo].[infotrener] values " +
+                                                            "('" + familiyaTrener.Text + "','" + imyaTrener.Text + "','" + otchTrener.Text +
+                                                              "','" + dataTrener.Text + "','" + numberTrener.Text + "','" + sportspec.Text +
+                                                              "','" + categoryTrener.Text + "','" + pol_id.Text + "')");
+                    MessageBox.Show("Тренер добавлен");
+                    SpisokTrenerov mainreg = new SpisokTrenerov();
+                    mainreg.Show();
+                    Close();
+                }
+                else { MessageBox.Show("Неправильный формат"); }
+            }
+            else { MessageBox.Show("Все строки должны быть заполнены"); }
+
+
+        }
+        public DataTable Insert(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            SpisokTrenerov trenerov = new SpisokTrenerov();
+            trenerov.Show();
+            Close();
+        }
+    }
+}

+ 31 - 0
KursachMukha692gr/AddUchenik.xaml

@@ -0,0 +1,31 @@
+<Window x:Class="KursachMukha692gr.AddUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Добавление ученика" Height="630" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Добавление ученика" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="familiyauch" materialDesign:HintAssist.Hint="Введите фамилию" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="imyauch" materialDesign:HintAssist.Hint="Введите имя" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="otchuch" materialDesign:HintAssist.Hint="Введите отчество" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <DatePicker x:Name="datauch" materialDesign:HintAssist.Hint="Введите дату рождения" SelectedDateFormat="Short" Height="37"/>
+                <TextBox x:Name ="numberuch" materialDesign:HintAssist.Hint="Введите номер телефона" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="disciplina" materialDesign:HintAssist.Hint="Введите id дисциплины" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="gruppa" materialDesign:HintAssist.Hint="Введите номер группы" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="pol_id" materialDesign:HintAssist.Hint="Введите id пола (1-м , 2-ж)" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Height="36"/>
+                <Button Content="Добавить ученика" Margin="0 20" Background="#006363" Click="Button_Click_Add"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 214 - 0
KursachMukha692gr/AddUchenik.xaml.cs

@@ -0,0 +1,214 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для AddUchenik.xaml
+    /// </summary>
+    public partial class AddUchenik : Window
+    {
+        public AddUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Add(object sender, RoutedEventArgs e)
+        {
+
+            if (familiyauch.Text != "" && imyauch.Text != "" && otchuch.Text != "" && datauch.Text != "" && numberuch.Text != "" && disciplina.Text != "" && pol_id.Text != "" && gruppa.Text != "")
+            {
+                bool fam = false, imya = false, otch = false, data = false, num = false;
+                bool dis = false, pol = false, gr = false;
+                for (int i = 0; i < familiyauch.Text.Length; i++)
+                {
+                    if (fam)
+                    {
+                        fam = false;
+                    }
+                    if (familiyauch.Text[i] >= 'А' && familiyauch.Text[i] <= 'Я' || familiyauch.Text[i] >= 'а' && familiyauch.Text[i] <= 'я')
+                    {
+                        fam = true;
+                        break;
+                    }
+                    if (fam == false)
+                    {
+                        MessageBox.Show("Поле фамилия может содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < imyauch.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (imyauch.Text[i] >= 'А' && imyauch.Text[i] <= 'Я' || imyauch.Text[i] >= 'а' && imyauch.Text[i] <= 'я')
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле имя может содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < otchuch.Text.Length; i++)
+                {
+                    if (otch)
+                    {
+                        otch = false;
+                    }
+                    if (otchuch.Text[i] >= 'А' && otchuch.Text[i] <= 'Я' || otchuch.Text[i] >= 'а' && otchuch.Text[i] <= 'я')
+                    {
+                        otch = true;
+                        break;
+                    }
+                    if (otch == false)
+                    {
+                        MessageBox.Show("Поле отчество может содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < datauch.Text.Length; i++)
+                {
+                    if (data)
+                    {
+                        data = false;
+                    }
+                    if(datauch.Text.Length > 0)
+                    {
+                        data = true;
+                        break;
+                    }
+                    if (data == false)
+                    {
+                        MessageBox.Show("Поле дата рождения может содержать только цифры");
+                        break;
+                    }
+                }
+                for (int i = 0; i < numberuch.Text.Length; i++)//проверка номера телефона
+                {
+                    if (num)
+                    {
+                        num = false;
+                    }
+                    if (numberuch.Text[i] >= '0' && numberuch.Text[i] <= '9' && numberuch.Text.Length == 11)
+                    {
+                        num = true;
+                        break;
+                    }
+                    if (num == false)
+                    {
+                        MessageBox.Show("Поле номер телефона может содержать только цифры (без знака + и 11 цифр)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < disciplina.Text.Length; i++)
+                {
+                    if (dis)
+                    {
+                        dis = false;
+                    }
+                    if (disciplina.Text[i] >= '0' && disciplina.Text[i] <= '7' && disciplina.Text.Length == 1)
+                    {
+                        dis = true;
+                        break;
+                    }
+                    if (dis == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < gruppa.Text.Length; i++)
+                {
+                    if (gr)
+                    {
+                        gr = false;
+                    }
+                    if (gruppa.Text[i] >= '0' && gruppa.Text[i] <= '9' && gruppa.Text.Length == 3)
+                    {
+                        gr = true;
+                        break;
+                    }
+                    if (gr == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                        break;
+                    }
+                }
+                for (int i = 0; i < pol_id.Text.Length; i++)
+                {
+                    if (pol)
+                    {
+                        pol = false;
+                    }
+                    if (pol_id.Text[i] == '1' || pol_id.Text[i] == '2')
+                    {
+                        pol = true;
+                        break;
+                    }
+                    if (pol == false)
+                    {
+                        MessageBox.Show("Поле пол должно содержать только цифры 1 (мужской) и 2 (женский)");
+                        break;
+                    }
+                }
+                if(fam && imya && otch && data && num && dis && pol && gr)
+                {
+                    DataTable dt_infouchenik = Insert("insert into [dbo].[infouchenik] values " +
+                                                           "('" + familiyauch.Text + "','" + imyauch.Text + "','" + otchuch.Text +
+                                                             "','" + datauch.Text + "','" + disciplina.Text + "','" + gruppa.Text +
+                                                             "','" + pol_id.Text + "','" + numberuch.Text + "')");
+                    MessageBox.Show("Ученик добавлен");
+                    SpisokUchenikov mainreg = new SpisokUchenikov();
+                    mainreg.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все строки должны быть заполнены");
+            }
+
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            SpisokUchenikov spisok = new SpisokUchenikov();
+            spisok.Show();
+            Close();
+        }
+        public DataTable Insert(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+    }
+}

+ 23 - 0
KursachMukha692gr/App.config

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
+  </startup>
+  <connectionStrings>
+    <add name="KURSACH1Entities2" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=WIN-2CL665KE0ED;initial catalog=KURSACH1;integrated security=True;pooling=False;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="mssqllocaldb" />
+      </parameters>
+    </defaultConnectionFactory>
+    <providers>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+    </providers>
+  </entityFramework>
+</configuration>

+ 16 - 0
KursachMukha692gr/App.xaml

@@ -0,0 +1,16 @@
+<Application x:Class="KursachMukha692gr.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:KursachMukha692gr"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Application.Resources>
+</Application>

+ 17 - 0
KursachMukha692gr/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 34 - 0
KursachMukha692gr/AppContext.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Data.Entity;
+using MySql.Data.MySqlClient;
+
+namespace KursachMukha692gr
+{
+    /*class AppContext : DbContext
+    {
+        MySqlConnection connection = new MySqlConnection("Data Source=WIN-2CL665KE0ED;Initial Catalog=KURSACH1;Integrated Security=True;Pooling=False");
+
+        public void openConn()
+        {
+            if (connection.State == System.Data.ConnectionState.Closed)
+            {
+                connection.Open();
+            }
+        }
+        public void closeConn()
+        {
+            if (connection.State == System.Data.ConnectionState.Open)
+            {
+                connection.Close();
+            }
+        }
+        public MySqlConnection GetConnection()
+        {
+            return connection;
+        }
+    }*/
+}

+ 23 - 0
KursachMukha692gr/Book.cs

@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace KursachMukha692gr
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class Book
+    {
+        public int id { get; set; }
+        public string Name { get; set; }
+        public decimal Price { get; set; }
+        public string Category { get; set; }
+        public string Author { get; set; }
+    }
+}

+ 25 - 0
KursachMukha692gr/CatTrenerUpdate.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.CatTrenerUpdate"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение тренерской категории тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение категории тренера" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новую категорию тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/CatTrenerUpdate.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для CatTrenerUpdate.xaml
+    /// </summary>
+    public partial class CatTrenerUpdate : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public CatTrenerUpdate()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '9' || Name.Text[i] >= 'A' && Name.Text[i] <= 'Z')
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле тренерская категория должно содержать только английские буквы и цифры");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set categoryTrener = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле тренерская категория для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/DataUpdateTrener.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.DataUpdateTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение даты рождения тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение даты рождения тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <DatePicker x:Name="Name" materialDesign:HintAssist.Hint="Введите новую дату рождения тренера" SelectedDateFormat="Short" Height="37"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 109 - 0
KursachMukha692gr/DataUpdateTrener.xaml.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DataUpdateTrener.xaml
+    /// </summary>
+    public partial class DataUpdateTrener : Window
+    {
+        List<string> Date = new List<string> {
+            "0","1","2","3","4","5","6","7","8","9","."};
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public DataUpdateTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Date.Count; j++)
+                    {
+                        if (Convert.ToString(Name.Text[i]).Contains(Date[j]))
+                        {
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле дата рождения должно содержать только цифры и знак '.''");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set dataTrener = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле дата рождения для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/DataUpdateUchenik.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.DataUpdateUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение даты рождения ученика" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение даты рождения ученика" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <DatePicker x:Name="Name" materialDesign:HintAssist.Hint="Введите новую дату рождения ученика" SelectedDateFormat="Short" Height="37"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 109 - 0
KursachMukha692gr/DataUpdateUchenik.xaml.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DataUpdateUchenik.xaml
+    /// </summary>
+    public partial class DataUpdateUchenik : Window
+    {
+        List<string> Date = new List<string> {
+            "0","1","2","3","4","5","6","7","8","9","."};
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public DataUpdateUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id ученика должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Date.Count; j++)
+                    {
+                        if (Convert.ToString(Name.Text[i]).Contains(Date[j]))
+                        {
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле дата рождения должно содержать только цифры и знак '.''");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infouchenik] set dataUchenik = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле дата рождения для id " + id_turik.Text + " успешно изменено");
+                    ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+                    viborUchenikUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+            viborUchenikUpdate.Show();
+            Close();
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/DeleteRaspisaniye.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.DeleteRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Удаление занятия" Height="350" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Удаление занятия" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_raspisaniye" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Удалить занятие" Margin="0 20" Background="#006363" Click="Button_Click_Delete"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 68 - 0
KursachMukha692gr/DeleteRaspisaniye.xaml.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DeleteRaspisaniye.xaml
+    /// </summary>
+    public partial class DeleteRaspisaniye : Window
+    {
+        public DeleteRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Delete(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите удалить данные ", "Удаление", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                for(int i = 0; i< id_raspisaniye.Text.Length;i++)
+                {
+                    if (id_raspisaniye.Text.Length > 0 && id_raspisaniye.Text[i] >= '0' && id_raspisaniye.Text[i] <='9')
+                    {
+                        DataTable dt_raspisaniye = Delete("delete from [dbo].[raspisaniye] where [id] = " + id_raspisaniye.Text);
+                        Raspisaniye a = new Raspisaniye();
+                        a.Show();
+                        Close();
+                    }
+                    else
+                    {
+                        MessageBox.Show("Поле id не заполнено или введено не корректно");
+                    }
+                }
+            }
+        }
+        public DataTable Delete(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            Raspisaniye ras = new Raspisaniye();
+            ras.Show();
+            Close();
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/DeleteSpisokTrenerov.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.DeleteSpisokTrenerov"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Удаление тренера" Height="350" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Удаление тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_trener" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Удалить тренера" Margin="0 20" Background="#006363" Click="Button_Click_Delete"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 69 - 0
KursachMukha692gr/DeleteSpisokTrenerov.xaml.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DeleteSpisokTrenerov.xaml
+    /// </summary>
+    public partial class DeleteSpisokTrenerov : Window
+    {
+        public DeleteSpisokTrenerov()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Delete(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите удалить данные ", "Удаление", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                for(int i = 0; i < id_trener.Text.Length; i++)
+                {
+                    if (id_trener.Text.Length > 0 && id_trener.Text[i] >='0' && id_trener.Text[i] <='9')
+                    {
+                        DataTable dt_uch = Delete("delete from [dbo].[infotrener] where [id] = " + id_trener.Text);
+                        SpisokTrenerov uch = new SpisokTrenerov();
+                        uch.Show();
+                        Close();
+                    }
+                    else
+                    {
+                        MessageBox.Show("Поле id не заполнено или введено не корректно");
+                    }
+                }
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            SpisokTrenerov trenerov = new SpisokTrenerov();
+            trenerov.Show();
+            Close();
+        }
+        public DataTable Delete(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/DeleteSpisokUchenikov.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.DeleteSpisokUchenikov"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Удаление ученика" Height="350" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Удаление ученика" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_uch" materialDesign:HintAssist.Hint="Введите id ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Удалить ученика" Margin="0 20" Background="#006363" Click="Button_Click_Delete"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 69 - 0
KursachMukha692gr/DeleteSpisokUchenikov.xaml.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DeleteSpisokUchenikov.xaml
+    /// </summary>
+    public partial class DeleteSpisokUchenikov : Window
+    {
+        public DeleteSpisokUchenikov()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Delete(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите удалить данные ", "Удаление", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                for(int i = 0; i < id_uch.Text.Length; i++)
+                {
+                    if (id_uch.Text.Length > 0 && id_uch.Text[i] >='0' && id_uch.Text[i] <='9')
+                    {
+                        DataTable dt_uch = Delete("delete from [dbo].[infouchenik] where [id] = " + id_uch.Text);
+                        SpisokUchenikov uch = new SpisokUchenikov();
+                        uch.Show();
+                        Close();
+                    }
+                    else
+                    {
+                        MessageBox.Show("Поле id не заполнено или введено не корректно");
+                    }
+                }
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            SpisokUchenikov spisok = new SpisokUchenikov();
+            spisok.Show();
+            Close();
+        }
+        public DataTable Delete(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/DeleteTournment.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.DeleteTournment"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Удаление соревнования" Height="350" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Удаление соревнования" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_sorevi" materialDesign:HintAssist.Hint="Введите id соревнования" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Удалить соревнование" Margin="0 20" Background="#006363" Click="Button_Click_Delete"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 67 - 0
KursachMukha692gr/DeleteTournment.xaml.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DeleteTournment.xaml
+    /// </summary>
+    public partial class DeleteTournment : Window
+    {
+        public DeleteTournment()
+        {
+            InitializeComponent();
+        }
+        private void Button_Click_Delete(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите удалить данные ", "Удаление", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                for(int i = 0; i < id_sorevi.Text.Length;i++)
+                {
+                    if (id_sorevi.Text.Length > 0 && id_sorevi.Text[i] >='0' && id_sorevi.Text[i] <='9')
+                    {
+                        DataTable dt_tournments = Delete("delete from [dbo].[sorevnovaniya] where [id] = " + id_sorevi.Text);
+                        Tournments tournments = new Tournments();
+                        tournments.Show();
+                        Close();
+                    }
+                    else
+                    {
+                        MessageBox.Show("Поле id не заполнено");
+                    }
+                }
+            }
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            Tournments tournments = new Tournments();
+            tournments.Show();
+            Close();
+        }
+        public DataTable Delete(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/DisUpdateTrener.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.DisUpdateTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение спортивной специальности тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение специальности тренера" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новую специальность тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/DisUpdateTrener.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для DisUpdateTrener.xaml
+    /// </summary>
+    public partial class DisUpdateTrener : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public DisUpdateTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле спортивная специальность должно содержать id специальности (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set fk_disciplina_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле спортивная специальность для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdCorpusUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdCorpusUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение корпуса занятия" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id корпуса" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id корпуса" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdCorpusUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdCorpusUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdCorpusUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdCorpusUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '3' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле корпус должно содержать id корпуса (1-Ледовая арена,2-СОК Кристалл ,3-Футбольный стадион Олимп)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_corpus_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id корпуса для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdDenUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdDenUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение день недели" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id дня недели" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id дня недели" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdDenUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdDenUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdDenUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdDenUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7')
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле день недели должно содержать id дня недели (1-понедельник , 2-вторник, 3-среда, 4-четверг, 5-пятница, 6-суббота, 7-воскресенье)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_den_nedeli_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id дня недели для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdDisUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdDisUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение id дисциплины" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id дисциплины" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id дисциплины" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdDisUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdDisUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdDisUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdDisUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_disciplina_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id дисциплины для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdDisUpdateUchenik.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdDisUpdateUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение дисциплины ученика" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение дисциплины ученика" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новую специальность ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/IdDisUpdateUchenik.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdDisUpdateUchenik.xaml
+    /// </summary>
+    public partial class IdDisUpdateUchenik : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdDisUpdateUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id ученика должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infouchenik] set fk_disciplina_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле дисциплина для id " + id_turik.Text + " успешно изменено");
+                    ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+                    viborUchenikUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+            viborUchenikUpdate.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdTrenerUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdTrenerUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+          xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение id тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdTrenerUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdTrenerUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdTrenerUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdTrenerUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '9')
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле тренер должно содержать id тренера");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_trener_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id тренера для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdVremyaUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdVremyaUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение времени зантия" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id времени занятия" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id времени занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdVremyaUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdVremyaUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdVremyaUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdVremyaUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7')
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле время занятия должно содержать id времени занятия (1-(06:00-08:00) , 2-(08:30-10:30), 3-(11:00-13:00), 4-(13:30-15:30), 5-(16:00-18:00), 6-(18:30-20:30), 7-(21:00-23:00))");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_vremya_zanyatiya_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id время занятия для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/IdZalUpdateRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.IdZalUpdateRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+         xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение id зала" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id зала занятия" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id зала занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/IdZalUpdateRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для IdZalUpdateRaspisaniye.xaml
+    /// </summary>
+    public partial class IdZalUpdateRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public IdZalUpdateRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '1' && Name.Text[i] <= '7' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле зал тренировки должно содержать id зала (1-хоккейная площадка,2-Зал волейбола,3-Футбольное поле,4-Зал баскетбола,5-Бассейн,6-Зал мини-футбола,7-Зал бокса)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_zal_trenirovki_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле id зала занятия для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/KabinetAdmina.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.KabinetAdmina"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        xmlns:sys="clr-namespace:System;assembly=mscorlib"
+        mc:Ignorable="d"
+        Title="KabinetAdmina" Height="435" Width="350" WindowStartupLocation="CenterScreen" VerticalAlignment="Center" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid  Background="#028E9B">
+
+        <Border Background="#35C0CD" MinWidth="300" MaxWidth="300" Margin="21,12,21,10" VerticalAlignment="Center" HorizontalAlignment="Center"  Padding="30" Height="382">
+            <StackPanel >
+
+                <TextBlock Text="Кабинет администратора" HorizontalAlignment="Center" FontSize="17"/>
+                <Button Content="Расписание занятий" Margin="20,20,20,20" Background="#006363" Click="Button_Click_raspisaniye"  Width="auto" />
+                <Button Content="Список тренеров" Background="#006363"  Click="Button_Click_spisok_trenerov" RenderTransformOrigin="0.496,0.453" Height="31"  Margin="20,0,20,20"/>
+                <Button Content="Список учеников"  Background="#006363" Click="Button_Click_spisok_grupp" Width="auto" Margin="20,0,20,20" Height="Auto" />
+                <Button Content="Соревнования" Background="#006363" Height="Auto" Margin="20,0,20,20" Click="Button_Click_sorevi" VerticalAlignment="Center"/>
+                <Button Content="Сменить пользователя" Background="#006363" Height="Auto" Margin="20,0,20,20"  VerticalAlignment="Center" Click="Button_Click"/>
+                <Button Content="Выход из приложения" Background="#006363" Margin="20,0,20,20" Height="Auto" Click="close_Click" VerticalAlignment="Center"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 74 - 0
KursachMukha692gr/KabinetAdmina.xaml.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для KabinetAdmina.xaml
+    /// </summary>
+    public partial class KabinetAdmina : Window
+    {
+        public KabinetAdmina()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_raspisaniye(object sender, RoutedEventArgs e)
+        {
+            Raspisaniye ras = new Raspisaniye();
+            ras.Show();
+            Close();
+        }
+
+        private void Button_Click_spisok_trenerov(object sender, RoutedEventArgs e)
+        {
+            SpisokTrenerov a = new SpisokTrenerov();
+            a.Show();
+            Close();
+        }
+
+        private void Button_Click_spisok_grupp(object sender, RoutedEventArgs e)
+        {
+            SpisokUchenikov uchenikov = new SpisokUchenikov();
+            uchenikov.Show();
+            Close();
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите сменить пользователя ?", "", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                Registration reg = new Registration();
+                reg.Show();
+                Close();
+            }
+           
+        }
+
+        private void Button_Click_sorevi(object sender, RoutedEventArgs e)
+        {
+            Tournments tournments = new Tournments();
+            tournments.Show();
+            Close();
+        }
+
+        private void close_Click(object sender, RoutedEventArgs e)
+        {
+            if (MessageBox.Show("Вы действительно хотите выйти ?", "Выход", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+            {
+                Application.Current.Shutdown();
+            }
+        }
+    }
+}

+ 611 - 0
KursachMukha692gr/KursachMukha692gr.csproj

@@ -0,0 +1,611 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{29A8E664-BE83-4920-B461-BAC2C08E0150}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>KursachMukha692gr</RootNamespace>
+    <AssemblyName>KursachMukha692gr</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
+    <Reference Include="MaterialDesignColors, Version=2.0.3.2, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>packages\MaterialDesignColors.2.0.3\lib\net452\MaterialDesignColors.dll</HintPath>
+    </Reference>
+    <Reference Include="MaterialDesignThemes.Wpf, Version=4.2.1.2, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>packages\MaterialDesignThemes.4.2.1\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
+    </Reference>
+    <Reference Include="MySql.Data, Version=8.0.27.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\Program Files (x86)\MySQL\MySQL Connector Net 8.0.27\Assemblies\v4.5.2\MySql.Data.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>packages\System.Configuration.ConfigurationManager.5.0.0\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Data.OracleClient" />
+    <Reference Include="System.Data.SQLite, Version=1.0.115.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
+      <HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\lib\net46\System.Data.SQLite.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Data.SQLite.EF6, Version=1.0.115.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
+      <HintPath>packages\System.Data.SQLite.EF6.1.0.115.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Data.SQLite.Linq, Version=1.0.115.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
+      <HintPath>packages\System.Data.SQLite.Linq.1.0.115.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
+    <Reference Include="System.Security.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Permissions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>packages\System.Security.Permissions.5.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
+    </Reference>
+    <Reference Include="System.ServiceProcess" />
+    <Reference Include="System.Transactions" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Compile Include="AddRaspisaniye.xaml.cs">
+      <DependentUpon>AddRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AddTournment.xaml.cs">
+      <DependentUpon>AddTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AddTrener.xaml.cs">
+      <DependentUpon>AddTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AddUchenik.xaml.cs">
+      <DependentUpon>AddUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AppContext.cs" />
+    <Compile Include="Book.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="CatTrenerUpdate.xaml.cs">
+      <DependentUpon>CatTrenerUpdate.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="corpus.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DataUpdateTrener.xaml.cs">
+      <DependentUpon>DataUpdateTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DataUpdateUchenik.xaml.cs">
+      <DependentUpon>DataUpdateUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DeleteRaspisaniye.xaml.cs">
+      <DependentUpon>DeleteRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DeleteSpisokTrenerov.xaml.cs">
+      <DependentUpon>DeleteSpisokTrenerov.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DeleteSpisokUchenikov.xaml.cs">
+      <DependentUpon>DeleteSpisokUchenikov.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DeleteTournment.xaml.cs">
+      <DependentUpon>DeleteTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="den_nedeli.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="disciplina.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DisUpdateTrener.xaml.cs">
+      <DependentUpon>DisUpdateTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="gruppa.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="IdCorpusUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdCorpusUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdDenUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdDenUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdDisUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdDisUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdDisUpdateUchenik.xaml.cs">
+      <DependentUpon>IdDisUpdateUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdTrenerUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdTrenerUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdVremyaUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdVremyaUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IdZalUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>IdZalUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="infoadmin.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="infotrener.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="infouchenik.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="KabinetAdmina.xaml.cs">
+      <DependentUpon>KabinetAdmina.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Model1.Context.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Model1.Context.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Model1.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Model1.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Model1.edmx</DependentUpon>
+    </Compile>
+    <Compile Include="NumberUpdateTrener.xaml.cs">
+      <DependentUpon>NumberUpdateTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="NumberUpdateUchenik.xaml.cs">
+      <DependentUpon>NumberUpdateUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="pol.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="PolUpdateTrener.xaml.cs">
+      <DependentUpon>PolUpdateTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RASPISANIYE.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Raspisaniye.xaml.cs">
+      <DependentUpon>Raspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Registration.xaml.cs">
+      <DependentUpon>Registration.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RegistrationTEST.xaml.cs">
+      <DependentUpon>RegistrationTEST.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RegUch.xaml.cs">
+      <DependentUpon>RegUch.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="SmenaPassword.xaml.cs">
+      <DependentUpon>SmenaPassword.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="sorevnovaniya.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="SpisokTrenerov.xaml.cs">
+      <DependentUpon>SpisokTrenerov.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="SpisokUchenikov.xaml.cs">
+      <DependentUpon>SpisokUchenikov.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="sysdiagram.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Tournments.xaml.cs">
+      <DependentUpon>Tournments.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateFamiliyaTrener.xaml.cs">
+      <DependentUpon>UpdateFamiliyaTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateFamiliyaUchenik.xaml.cs">
+      <DependentUpon>UpdateFamiliyaUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateGruppaRaspisaniye.xaml.cs">
+      <DependentUpon>UpdateGruppaRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateGruppaTournment.xaml.cs">
+      <DependentUpon>UpdateGruppaTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateGruppaUchenik.xaml.cs">
+      <DependentUpon>UpdateGruppaUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateIdDiscipliniTournment.xaml.cs">
+      <DependentUpon>UpdateIdDiscipliniTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateIdTrenerTournment.xaml.cs">
+      <DependentUpon>UpdateIdTrenerTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateImyaTrener.xaml.cs">
+      <DependentUpon>UpdateImyaTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateImyaUchenik.xaml.cs">
+      <DependentUpon>UpdateImyaUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateMestoTournment.xaml.cs">
+      <DependentUpon>UpdateMestoTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateNameTournment.xaml.cs">
+      <DependentUpon>UpdateNameTournment.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateOtchTrener.xaml.cs">
+      <DependentUpon>UpdateOtchTrener.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdateOtchUchenik.xaml.cs">
+      <DependentUpon>UpdateOtchUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UpdatePolUchenik.xaml.cs">
+      <DependentUpon>UpdatePolUchenik.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ViborTrenerUpdate.xaml.cs">
+      <DependentUpon>ViborTrenerUpdate.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ViborUchenikUpdate.xaml.cs">
+      <DependentUpon>ViborUchenikUpdate.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ViborUpdateRaspisaniye.xaml.cs">
+      <DependentUpon>ViborUpdateRaspisaniye.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ViborUpdateTournments.xaml.cs">
+      <DependentUpon>ViborUpdateTournments.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="vremya_zanyatiya.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Compile Include="zal_trenerovki.cs">
+      <DependentUpon>Model1.tt</DependentUpon>
+    </Compile>
+    <Page Include="AddRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="AddTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="AddTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="AddUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="CatTrenerUpdate.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DataUpdateTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DataUpdateUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DeleteRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DeleteSpisokTrenerov.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DeleteSpisokUchenikov.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DeleteTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="DisUpdateTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdCorpusUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdDenUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdDisUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdDisUpdateUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdTrenerUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdVremyaUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="IdZalUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="KabinetAdmina.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="NumberUpdateTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="NumberUpdateUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="PolUpdateTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Raspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Registration.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="RegistrationTEST.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="RegUch.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="SmenaPassword.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="SpisokTrenerov.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="SpisokUchenikov.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Tournments.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateFamiliyaTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateFamiliyaUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateGruppaRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateGruppaTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateGruppaUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateIdDiscipliniTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateIdTrenerTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateImyaTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateImyaUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateMestoTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateNameTournment.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateOtchTrener.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdateOtchUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="UpdatePolUchenik.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ViborTrenerUpdate.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ViborUchenikUpdate.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ViborUpdateRaspisaniye.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ViborUpdateTournments.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EntityDeploy Include="Model1.edmx">
+      <Generator>EntityModelCodeGenerator</Generator>
+      <LastGenOutput>Model1.Designer.cs</LastGenOutput>
+    </EntityDeploy>
+    <None Include="Model1.edmx.diagram">
+      <DependentUpon>Model1.edmx</DependentUpon>
+    </None>
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.7.2 %28x86 и x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Model1.Context.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>Model1.edmx</DependentUpon>
+      <LastGenOutput>Model1.Context.cs</LastGenOutput>
+    </Content>
+    <Content Include="Model1.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>Model1.edmx</DependentUpon>
+      <LastGenOutput>Model1.cs</LastGenOutput>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="packages\MaterialDesignThemes.4.2.1\build\MaterialDesignThemes.targets" Condition="Exists('packages\MaterialDesignThemes.4.2.1\build\MaterialDesignThemes.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('packages\MaterialDesignThemes.4.2.1\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\MaterialDesignThemes.4.2.1\build\MaterialDesignThemes.targets'))" />
+    <Error Condition="!Exists('packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
+    <Error Condition="!Exists('packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
+    <Error Condition="!Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
+  </Target>
+  <Import Project="packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
+  <Import Project="packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
+</Project>

+ 31 - 0
KursachMukha692gr/KursachMukha692gr.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31729.503
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KursachMukha692gr", "KursachMukha692gr.csproj", "{29A8E664-BE83-4920-B461-BAC2C08E0150}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestirovaniyeKursachMukha", "..\TestirovaniyeKursachMukha\TestirovaniyeKursachMukha.csproj", "{4633731C-ECD5-4866-8B39-E6D0A337FD05}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{29A8E664-BE83-4920-B461-BAC2C08E0150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{29A8E664-BE83-4920-B461-BAC2C08E0150}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{29A8E664-BE83-4920-B461-BAC2C08E0150}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{29A8E664-BE83-4920-B461-BAC2C08E0150}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4633731C-ECD5-4866-8B39-E6D0A337FD05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4633731C-ECD5-4866-8B39-E6D0A337FD05}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4633731C-ECD5-4866-8B39-E6D0A337FD05}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4633731C-ECD5-4866-8B39-E6D0A337FD05}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {1364DC5E-9A39-43D0-919B-8B1C80A0DEE6}
+	EndGlobalSection
+EndGlobal

+ 18 - 0
KursachMukha692gr/MainWindow.xaml

@@ -0,0 +1,18 @@
+<Window x:Class="KursachMukha692gr.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        mc:Ignorable="d" 
+        Title="Выбор авторизации" Height="350" Width="472" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Border MinWidth="400" MaxWidth="400" Margin="15" Background="#35C0CD" VerticalAlignment="Center" Padding="30">
+            <StackPanel>
+                <Button  Margin="0 20" Content="Регистрация" Background="#006363	" Click="Button_Click_2"/>
+                <Button VerticalAlignment="Center" Margin="0 20" Content="Войти как администратор" Click="Button_Click" Background="#006363	" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 43 - 0
KursachMukha692gr/MainWindow.xaml.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            Registration registration = new Registration();
+            registration.Show();
+            Close();
+        }
+        private void Button_Click_2(object sender, RoutedEventArgs e)
+        {
+            RegUch mainRegistration = new RegUch();
+            mainRegistration.Show();
+            Close();
+        }
+
+       
+    }
+}

+ 43 - 0
KursachMukha692gr/Model1.Context.cs

@@ -0,0 +1,43 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace KursachMukha692gr
+{
+    using System;
+    using System.Data.Entity;
+    using System.Data.Entity.Infrastructure;
+    
+    public partial class KURSACH1Entities2 : DbContext
+    {
+        public KURSACH1Entities2()
+            : base("name=KURSACH1Entities2")
+        {
+        }
+    
+        protected override void OnModelCreating(DbModelBuilder modelBuilder)
+        {
+            throw new UnintentionalCodeFirstException();
+        }
+    
+        public virtual DbSet<Book> Books { get; set; }
+        public virtual DbSet<corpus> corpora { get; set; }
+        public virtual DbSet<den_nedeli> den_nedeli { get; set; }
+        public virtual DbSet<disciplina> disciplinas { get; set; }
+        public virtual DbSet<gruppa> gruppas { get; set; }
+        public virtual DbSet<infoadmin> infoadmins { get; set; }
+        public virtual DbSet<infotrener> infotreners { get; set; }
+        public virtual DbSet<infouchenik> infoucheniks { get; set; }
+        public virtual DbSet<pol> pols { get; set; }
+        public virtual DbSet<RASPISANIYE> RASPISANIYEs { get; set; }
+        public virtual DbSet<sorevnovaniya> sorevnovaniyas { get; set; }
+        public virtual DbSet<sysdiagram> sysdiagrams { get; set; }
+        public virtual DbSet<vremya_zanyatiya> vremya_zanyatiya { get; set; }
+        public virtual DbSet<zal_trenerovki> zal_trenerovki { get; set; }
+    }
+}

+ 636 - 0
KursachMukha692gr/Model1.Context.tt

@@ -0,0 +1,636 @@
+<#@ template language="C#" debug="false" hostspecific="true"#>
+<#@ include file="EF6.Utility.CS.ttinclude"#><#@
+ output extension=".cs"#><#
+
+const string inputFile = @"Model1.edmx";
+var textTransform = DynamicTextTransformation.Create(this);
+var code = new CodeGenerationTools(this);
+var ef = new MetadataTools(this);
+var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
+var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
+var itemCollection = loader.CreateEdmItemCollection(inputFile);
+var modelNamespace = loader.GetModelNamespace(inputFile);
+var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
+
+var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
+if (container == null)
+{
+    return string.Empty;
+}
+#>
+//------------------------------------------------------------------------------
+// <auto-generated>
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
+//
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+<#
+
+var codeNamespace = code.VsNamespaceSuggestion();
+if (!String.IsNullOrEmpty(codeNamespace))
+{
+#>
+namespace <#=code.EscapeNamespace(codeNamespace)#>
+{
+<#
+    PushIndent("    ");
+}
+
+#>
+using System;
+using System.Data.Entity;
+using System.Data.Entity.Infrastructure;
+<#
+if (container.FunctionImports.Any())
+{
+#>
+using System.Data.Entity.Core.Objects;
+using System.Linq;
+<#
+}
+#>
+
+<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
+{
+    public <#=code.Escape(container)#>()
+        : base("name=<#=container.Name#>")
+    {
+<#
+if (!loader.IsLazyLoadingEnabled(container))
+{
+#>
+        this.Configuration.LazyLoadingEnabled = false;
+<#
+}
+
+foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
+{
+    // Note: the DbSet members are defined below such that the getter and
+    // setter always have the same accessibility as the DbSet definition
+    if (Accessibility.ForReadOnlyProperty(entitySet) != "public")
+    {
+#>
+        <#=codeStringGenerator.DbSetInitializer(entitySet)#>
+<#
+    }
+}
+#>
+    }
+
+    protected override void OnModelCreating(DbModelBuilder modelBuilder)
+    {
+        throw new UnintentionalCodeFirstException();
+    }
+
+<#
+    foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
+    {
+#>
+    <#=codeStringGenerator.DbSet(entitySet)#>
+<#
+    }
+
+    foreach (var edmFunction in container.FunctionImports)
+    {
+        WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
+    }
+#>
+}
+<#
+
+if (!String.IsNullOrEmpty(codeNamespace))
+{
+    PopIndent();
+#>
+}
+<#
+}
+#>
+<#+
+
+private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+{
+    if (typeMapper.IsComposable(edmFunction))
+    {
+#>
+
+    [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
+    <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
+    {
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
+#>
+        <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
+    }
+<#+
+    }
+    else
+    {
+#>
+
+    <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
+    {
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
+#>
+        <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
+    }
+<#+
+        if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
+        {
+            WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
+        }
+    }
+}
+
+public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
+{
+#>
+        var <#=name#> = <#=isNotNull#> ?
+            <#=notNullInit#> :
+            <#=nullInit#>;
+
+<#+
+}
+
+public const string TemplateId = "CSharp_DbContext_Context_EF6";
+
+public class CodeStringGenerator
+{
+    private readonly CodeGenerationTools _code;
+    private readonly TypeMapper _typeMapper;
+    private readonly MetadataTools _ef;
+
+    public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(typeMapper, "typeMapper");
+        ArgumentNotNull(ef, "ef");
+
+        _code = code;
+        _typeMapper = typeMapper;
+        _ef = ef;
+    }
+
+    public string Property(EdmProperty edmProperty)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            Accessibility.ForProperty(edmProperty),
+            _typeMapper.GetTypeName(edmProperty.TypeUsage),
+            _code.Escape(edmProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
+    }
+
+    public string NavigationProperty(NavigationProperty navProp)
+    {
+        var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
+            navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
+            _code.Escape(navProp),
+            _code.SpaceAfter(Accessibility.ForGetter(navProp)),
+            _code.SpaceAfter(Accessibility.ForSetter(navProp)));
+    }
+    
+    public string AccessibilityAndVirtual(string accessibility)
+    {
+        return accessibility + (accessibility != "private" ? " virtual" : "");
+    }
+    
+    public string EntityClassOpening(EntityType entity)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1}partial class {2}{3}",
+            Accessibility.ForType(entity),
+            _code.SpaceAfter(_code.AbstractOption(entity)),
+            _code.Escape(entity),
+            _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
+    }
+    
+    public string EnumOpening(SimpleType enumType)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} enum {1} : {2}",
+            Accessibility.ForType(enumType),
+            _code.Escape(enumType),
+            _code.Escape(_typeMapper.UnderlyingClrType(enumType)));
+        }
+    
+    public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
+    {
+        var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+        foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
+        {
+            var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
+            var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
+            var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
+            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
+        }
+    }
+    
+    public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} IQueryable<{1}> {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            _code.Escape(edmFunction),
+            string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
+    }
+    
+    public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            edmFunction.NamespaceName,
+            edmFunction.Name,
+            string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
+            _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
+    }
+    
+    public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
+        if (includeMergeOption)
+        {
+            paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
+        }
+
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            _code.Escape(edmFunction),
+            paramList);
+    }
+    
+    public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
+        if (includeMergeOption)
+        {
+            callParams = ", mergeOption" + callParams;
+        }
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
+            returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            edmFunction.Name,
+            callParams);
+    }
+    
+    public string DbSet(EntitySet entitySet)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} virtual DbSet<{1}> {2} {{ get; set; }}",
+            Accessibility.ForReadOnlyProperty(entitySet),
+            _typeMapper.GetTypeName(entitySet.ElementType),
+            _code.Escape(entitySet));
+    }
+
+    public string DbSetInitializer(EntitySet entitySet)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} = Set<{1}>();",
+            _code.Escape(entitySet),
+            _typeMapper.GetTypeName(entitySet.ElementType));
+    }
+
+    public string UsingDirectives(bool inHeader, bool includeCollections = true)
+    {
+        return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
+            ? string.Format(
+                CultureInfo.InvariantCulture,
+                "{0}using System;{1}" +
+                "{2}",
+                inHeader ? Environment.NewLine : "",
+                includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
+                inHeader ? "" : Environment.NewLine)
+            : "";
+    }
+}
+
+public class TypeMapper
+{
+    private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
+
+    private readonly System.Collections.IList _errors;
+    private readonly CodeGenerationTools _code;
+    private readonly MetadataTools _ef;
+
+    public static string FixNamespaces(string typeName)
+    {
+        return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
+    }
+
+    public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(ef, "ef");
+        ArgumentNotNull(errors, "errors");
+
+        _code = code;
+        _ef = ef;
+        _errors = errors;
+    }
+
+    public string GetTypeName(TypeUsage typeUsage)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
+    }
+
+    public string GetTypeName(EdmType edmType)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: null);
+    }
+
+    public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, string modelNamespace)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
+    {
+        if (edmType == null)
+        {
+            return null;
+        }
+
+        var collectionType = edmType as CollectionType;
+        if (collectionType != null)
+        {
+            return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
+        }
+
+        var typeName = _code.Escape(edmType.MetadataProperties
+                                .Where(p => p.Name == ExternalTypeNameAttributeName)
+                                .Select(p => (string)p.Value)
+                                .FirstOrDefault())
+            ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
+                _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
+                _code.Escape(edmType));
+
+        if (edmType is StructuralType)
+        {
+            return typeName;
+        }
+
+        if (edmType is SimpleType)
+        {
+            var clrType = UnderlyingClrType(edmType);
+            if (!IsEnumType(edmType))
+            {
+                typeName = _code.Escape(clrType);
+            }
+
+            typeName = FixNamespaces(typeName);
+
+            return clrType.IsValueType && isNullable == true ?
+                String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
+                typeName;
+        }
+
+        throw new ArgumentException("edmType");
+    }
+    
+    public Type UnderlyingClrType(EdmType edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        var primitiveType = edmType as PrimitiveType;
+        if (primitiveType != null)
+        {
+            return primitiveType.ClrEquivalentType;
+        }
+
+        if (IsEnumType(edmType))
+        {
+            return GetEnumUnderlyingType(edmType).ClrEquivalentType;
+        }
+
+        return typeof(object);
+    }
+    
+    public object GetEnumMemberValue(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var valueProperty = enumMember.GetType().GetProperty("Value");
+        return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
+    }
+    
+    public string GetEnumMemberName(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var nameProperty = enumMember.GetType().GetProperty("Name");
+        return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
+    }
+
+    public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        var membersProperty = enumType.GetType().GetProperty("Members");
+        return membersProperty != null 
+            ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
+            : Enumerable.Empty<MetadataItem>();
+    }
+    
+    public bool EnumIsFlags(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+        
+        var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
+        return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
+    }
+
+    public bool IsEnumType(GlobalItem edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        return edmType.GetType().Name == "EnumType";
+    }
+
+    public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
+    }
+
+    public string CreateLiteral(object value)
+    {
+        if (value == null || value.GetType() != typeof(TimeSpan))
+        {
+            return _code.CreateLiteral(value);
+        }
+
+        return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
+    }
+    
+    public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
+    {
+        ArgumentNotNull(types, "types");
+        ArgumentNotNull(sourceFile, "sourceFile");
+        
+        var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
+        if (types.Any(item => !hash.Add(item)))
+        {
+            _errors.Add(
+                new CompilerError(sourceFile, -1, -1, "6023",
+                    String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
+            return false;
+        }
+        return true;
+    }
+    
+    public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
+    {
+        return GetItemsToGenerate<SimpleType>(itemCollection)
+            .Where(e => IsEnumType(e));
+    }
+    
+    public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
+    {
+        return itemCollection
+            .OfType<T>()
+            .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
+            .OrderBy(i => i.Name);
+    }
+
+    public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
+    {
+        return itemCollection
+            .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
+            .Select(g => GetGlobalItemName(g));
+    }
+
+    public string GetGlobalItemName(GlobalItem item)
+    {
+        if (item is EdmType)
+        {
+            return ((EdmType)item).Name;
+        }
+        else
+        {
+            return ((EntityContainer)item).Name;
+        }
+    }
+
+    public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+    
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+
+    public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type);
+    }
+    
+    public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
+    }
+    
+    public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
+        return returnParamsProperty == null
+            ? edmFunction.ReturnParameter
+            : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
+    }
+
+    public bool IsComposable(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
+        return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
+    }
+
+    public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
+    {
+        return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+    }
+
+    public TypeUsage GetReturnType(EdmFunction edmFunction)
+    {
+        var returnParam = GetReturnParameter(edmFunction);
+        return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
+    }
+    
+    public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
+    {
+        var returnType = GetReturnType(edmFunction);
+        return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
+    }
+}
+
+public static void ArgumentNotNull<T>(T arg, string name) where T : class
+{
+    if (arg == null)
+    {
+        throw new ArgumentNullException(name);
+    }
+}
+#>

+ 10 - 0
KursachMukha692gr/Model1.Designer.cs

@@ -0,0 +1,10 @@
+// Создание кода T4 для модели "C:\Users\КиряМухаКексМашина\Desktop\курсач\KursachMukha692gr\Model1.edmx" включено. 
+// Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
+// на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
+// открыта в конструкторе.
+
+// Если не сформированы контекст и классы сущности, возможная причина в том, что вы создали пустую модель, но
+// еще не выбрали версию Entity Framework для использования. Чтобы сформировать класс контекста и классы сущностей
+// для своей модели, откройте модель в конструкторе, щелкните правой кнопкой область конструктора и
+// выберите "Обновить модель из базы данных", "Сформировать базу данных из модели" или "Добавить элемент формирования
+// кода...".

+ 9 - 0
KursachMukha692gr/Model1.cs

@@ -0,0 +1,9 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+

Plik diff jest za duży
+ 1077 - 0
KursachMukha692gr/Model1.edmx


+ 42 - 0
KursachMukha692gr/Model1.edmx.diagram

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
+ <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
+  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
+    <!-- Diagram content (shape and connector positions) -->
+    <edmx:Diagrams>
+      <Diagram DiagramId="bde5b278db8d48b58db6076b79396534" Name="Diagram1">
+        <EntityTypeShape EntityType="KURSACH1Model.Book" Width="1.5" PointX="7.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.corpus" Width="1.5" PointX="6" PointY="10.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.den_nedeli" Width="1.5" PointX="6" PointY="13.125" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.disciplina" Width="1.5" PointX="0.75" PointY="6.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.gruppa" Width="1.5" PointX="3" PointY="2.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.infoadmin" Width="1.5" PointX="9.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.infotrener" Width="1.5" PointX="3" PointY="5.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.infouchenik" Width="1.5" PointX="6" PointY="5.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.pol" Width="1.5" PointX="0.75" PointY="3.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.RASPISANIYE" Width="1.5" PointX="8.25" PointY="5.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.sorevnovaniya" Width="1.5" PointX="5.25" PointY="2" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.sysdiagram" Width="1.5" PointX="0.75" PointY="10.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.vremya_zanyatiya" Width="1.5" PointX="6" PointY="15.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="KURSACH1Model.zal_trenerovki" Width="1.5" PointX="6" PointY="18.25" IsExpanded="true" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_co__47A6A41B" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_de__489AC854" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infotrene__fk_di__3864608B" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infouchen__fk_di__2A164134" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_di__498EEC8D" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__sorevnova__fk_di__51300E55" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infouchen__fk_gr__282DF8C2" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infouchen__fk_gr__2BFE89A6" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_gr__4A8310C6" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__sorevnova__fk_gr__5224328E" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infotrene__fk_po__367C1819" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_tr__4D5F7D71" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__sorevnova__fk_in__531856C7" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infouchen__fk_po__29221CFB" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__infouchen__fk_po__2B0A656D" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_vr__4B7734FF" ManuallyRouted="false" />
+        <AssociationConnector Association="KURSACH1Model.FK__RASPISANI__fk_za__4C6B5938" ManuallyRouted="false" />
+      </Diagram>
+    </edmx:Diagrams>
+  </edmx:Designer>
+</edmx:Edmx>

+ 733 - 0
KursachMukha692gr/Model1.tt

@@ -0,0 +1,733 @@
+<#@ template language="C#" debug="false" hostspecific="true"#>
+<#@ include file="EF6.Utility.CS.ttinclude"#><#@ 
+ output extension=".cs"#><#
+
+const string inputFile = @"Model1.edmx";
+var textTransform = DynamicTextTransformation.Create(this);
+var code = new CodeGenerationTools(this);
+var ef = new MetadataTools(this);
+var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
+var	fileManager = EntityFrameworkTemplateFileManager.Create(this);
+var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile);
+var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
+
+if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile))
+{
+    return string.Empty;
+}
+
+WriteHeader(codeStringGenerator, fileManager);
+
+foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
+{
+    fileManager.StartNewFile(entity.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false)#>
+<#=codeStringGenerator.EntityClassOpening(entity)#>
+{
+<#
+    var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity);
+    var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity);
+    var complexProperties = typeMapper.GetComplexProperties(entity);
+
+    if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any())
+    {
+#>
+    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+    public <#=code.Escape(entity)#>()
+    {
+<#
+        foreach (var edmProperty in propertiesWithDefaultValues)
+        {
+#>
+        this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
+<#
+        }
+
+        foreach (var navigationProperty in collectionNavigationProperties)
+        {
+#>
+        this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>();
+<#
+        }
+
+        foreach (var complexProperty in complexProperties)
+        {
+#>
+        this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
+<#
+        }
+#>
+    }
+
+<#
+    }
+
+    var simpleProperties = typeMapper.GetSimpleProperties(entity);
+    if (simpleProperties.Any())
+    {
+        foreach (var edmProperty in simpleProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+
+    if (complexProperties.Any())
+    {
+#>
+
+<#
+        foreach(var complexProperty in complexProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(complexProperty)#>
+<#
+        }
+    }
+
+    var navigationProperties = typeMapper.GetNavigationProperties(entity);
+    if (navigationProperties.Any())
+    {
+#>
+
+<#
+        foreach (var navigationProperty in navigationProperties)
+        {
+            if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
+            {
+#>
+    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+<#
+            }
+#>
+    <#=codeStringGenerator.NavigationProperty(navigationProperty)#>
+<#
+        }
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection))
+{
+    fileManager.StartNewFile(complex.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
+<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#>
+{
+<#
+    var complexProperties = typeMapper.GetComplexProperties(complex);
+    var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex);
+
+    if (propertiesWithDefaultValues.Any() || complexProperties.Any())
+    {
+#>
+    public <#=code.Escape(complex)#>()
+    {
+<#
+        foreach (var edmProperty in propertiesWithDefaultValues)
+        {
+#>
+        this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
+<#
+        }
+
+        foreach (var complexProperty in complexProperties)
+        {
+#>
+        this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
+<#
+        }
+#>
+    }
+
+<#
+    }
+
+    var simpleProperties = typeMapper.GetSimpleProperties(complex);
+    if (simpleProperties.Any())
+    {
+        foreach(var edmProperty in simpleProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+
+    if (complexProperties.Any())
+    {
+#>
+
+<#
+        foreach(var edmProperty in complexProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection))
+{
+    fileManager.StartNewFile(enumType.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
+<#
+    if (typeMapper.EnumIsFlags(enumType))
+    {
+#>
+[Flags]
+<#
+    }
+#>
+<#=codeStringGenerator.EnumOpening(enumType)#>
+{
+<#
+    var foundOne = false;
+    
+    foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType))
+    {
+        foundOne = true;
+#>
+    <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>,
+<#
+    }
+
+    if (foundOne)
+    {
+        this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1);
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+fileManager.Process();
+
+#>
+<#+
+
+public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager)
+{
+    fileManager.StartHeader();
+#>
+//------------------------------------------------------------------------------
+// <auto-generated>
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
+//
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
+// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
+// </auto-generated>
+//------------------------------------------------------------------------------
+<#=codeStringGenerator.UsingDirectives(inHeader: true)#>
+<#+
+    fileManager.EndBlock();
+}
+
+public void BeginNamespace(CodeGenerationTools code)
+{
+    var codeNamespace = code.VsNamespaceSuggestion();
+    if (!String.IsNullOrEmpty(codeNamespace))
+    {
+#>
+namespace <#=code.EscapeNamespace(codeNamespace)#>
+{
+<#+
+        PushIndent("    ");
+    }
+}
+
+public void EndNamespace(CodeGenerationTools code)
+{
+    if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion()))
+    {
+        PopIndent();
+#>
+}
+<#+
+    }
+}
+
+public const string TemplateId = "CSharp_DbContext_Types_EF6";
+
+public class CodeStringGenerator
+{
+    private readonly CodeGenerationTools _code;
+    private readonly TypeMapper _typeMapper;
+    private readonly MetadataTools _ef;
+
+    public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(typeMapper, "typeMapper");
+        ArgumentNotNull(ef, "ef");
+
+        _code = code;
+        _typeMapper = typeMapper;
+        _ef = ef;
+    }
+
+    public string Property(EdmProperty edmProperty)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            Accessibility.ForProperty(edmProperty),
+            _typeMapper.GetTypeName(edmProperty.TypeUsage),
+            _code.Escape(edmProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
+    }
+
+    public string NavigationProperty(NavigationProperty navProp)
+    {
+        var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
+            navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
+            _code.Escape(navProp),
+            _code.SpaceAfter(Accessibility.ForGetter(navProp)),
+            _code.SpaceAfter(Accessibility.ForSetter(navProp)));
+    }
+    
+    public string AccessibilityAndVirtual(string accessibility)
+    {
+        return accessibility + (accessibility != "private" ? " virtual" : "");
+    }
+    
+    public string EntityClassOpening(EntityType entity)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1}partial class {2}{3}",
+            Accessibility.ForType(entity),
+            _code.SpaceAfter(_code.AbstractOption(entity)),
+            _code.Escape(entity),
+            _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
+    }
+    
+    public string EnumOpening(SimpleType enumType)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} enum {1} : {2}",
+            Accessibility.ForType(enumType),
+            _code.Escape(enumType),
+            _code.Escape(_typeMapper.UnderlyingClrType(enumType)));
+        }
+    
+    public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
+    {
+        var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+        foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
+        {
+            var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
+            var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
+            var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
+            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
+        }
+    }
+    
+    public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} IQueryable<{1}> {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            _code.Escape(edmFunction),
+            string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
+    }
+    
+    public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            edmFunction.NamespaceName,
+            edmFunction.Name,
+            string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
+            _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
+    }
+    
+    public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
+        if (includeMergeOption)
+        {
+            paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
+        }
+
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            _code.Escape(edmFunction),
+            paramList);
+    }
+    
+    public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
+        if (includeMergeOption)
+        {
+            callParams = ", mergeOption" + callParams;
+        }
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
+            returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            edmFunction.Name,
+            callParams);
+    }
+    
+    public string DbSet(EntitySet entitySet)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} virtual DbSet<{1}> {2} {{ get; set; }}",
+            Accessibility.ForReadOnlyProperty(entitySet),
+            _typeMapper.GetTypeName(entitySet.ElementType),
+            _code.Escape(entitySet));
+    }
+
+    public string UsingDirectives(bool inHeader, bool includeCollections = true)
+    {
+        return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
+            ? string.Format(
+                CultureInfo.InvariantCulture,
+                "{0}using System;{1}" +
+                "{2}",
+                inHeader ? Environment.NewLine : "",
+                includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
+                inHeader ? "" : Environment.NewLine)
+            : "";
+    }
+}
+
+public class TypeMapper
+{
+    private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
+
+    private readonly System.Collections.IList _errors;
+    private readonly CodeGenerationTools _code;
+    private readonly MetadataTools _ef;
+
+    public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(ef, "ef");
+        ArgumentNotNull(errors, "errors");
+
+        _code = code;
+        _ef = ef;
+        _errors = errors;
+    }
+
+    public static string FixNamespaces(string typeName)
+    {
+        return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
+    }
+
+    public string GetTypeName(TypeUsage typeUsage)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
+    }
+
+    public string GetTypeName(EdmType edmType)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: null);
+    }
+
+    public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, string modelNamespace)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
+    {
+        if (edmType == null)
+        {
+            return null;
+        }
+
+        var collectionType = edmType as CollectionType;
+        if (collectionType != null)
+        {
+            return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
+        }
+
+        var typeName = _code.Escape(edmType.MetadataProperties
+                                .Where(p => p.Name == ExternalTypeNameAttributeName)
+                                .Select(p => (string)p.Value)
+                                .FirstOrDefault())
+            ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
+                _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
+                _code.Escape(edmType));
+
+        if (edmType is StructuralType)
+        {
+            return typeName;
+        }
+
+        if (edmType is SimpleType)
+        {
+            var clrType = UnderlyingClrType(edmType);
+            if (!IsEnumType(edmType))
+            {
+                typeName = _code.Escape(clrType);
+            }
+
+            typeName = FixNamespaces(typeName);
+
+            return clrType.IsValueType && isNullable == true ?
+                String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
+                typeName;
+        }
+
+        throw new ArgumentException("edmType");
+    }
+    
+    public Type UnderlyingClrType(EdmType edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        var primitiveType = edmType as PrimitiveType;
+        if (primitiveType != null)
+        {
+            return primitiveType.ClrEquivalentType;
+        }
+
+        if (IsEnumType(edmType))
+        {
+            return GetEnumUnderlyingType(edmType).ClrEquivalentType;
+        }
+
+        return typeof(object);
+    }
+    
+    public object GetEnumMemberValue(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var valueProperty = enumMember.GetType().GetProperty("Value");
+        return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
+    }
+    
+    public string GetEnumMemberName(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var nameProperty = enumMember.GetType().GetProperty("Name");
+        return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
+    }
+
+    public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        var membersProperty = enumType.GetType().GetProperty("Members");
+        return membersProperty != null 
+            ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
+            : Enumerable.Empty<MetadataItem>();
+    }
+    
+    public bool EnumIsFlags(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+        
+        var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
+        return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
+    }
+
+    public bool IsEnumType(GlobalItem edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        return edmType.GetType().Name == "EnumType";
+    }
+
+    public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
+    }
+
+    public string CreateLiteral(object value)
+    {
+        if (value == null || value.GetType() != typeof(TimeSpan))
+        {
+            return _code.CreateLiteral(value);
+        }
+
+        return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
+    }
+    
+    public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
+    {
+        ArgumentNotNull(types, "types");
+        ArgumentNotNull(sourceFile, "sourceFile");
+        
+        var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
+        if (types.Any(item => !hash.Add(item)))
+        {
+            _errors.Add(
+                new CompilerError(sourceFile, -1, -1, "6023",
+                    String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
+            return false;
+        }
+        return true;
+    }
+    
+    public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
+    {
+        return GetItemsToGenerate<SimpleType>(itemCollection)
+            .Where(e => IsEnumType(e));
+    }
+    
+    public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
+    {
+        return itemCollection
+            .OfType<T>()
+            .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
+            .OrderBy(i => i.Name);
+    }
+
+    public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
+    {
+        return itemCollection
+            .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
+            .Select(g => GetGlobalItemName(g));
+    }
+
+    public string GetGlobalItemName(GlobalItem item)
+    {
+        if (item is EdmType)
+        {
+            return ((EdmType)item).Name;
+        }
+        else
+        {
+            return ((EntityContainer)item).Name;
+        }
+    }
+
+    public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+    
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+
+    public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type);
+    }
+    
+    public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
+    }
+    
+    public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
+        return returnParamsProperty == null
+            ? edmFunction.ReturnParameter
+            : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
+    }
+
+    public bool IsComposable(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
+        return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
+    }
+
+    public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
+    {
+        return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+    }
+
+    public TypeUsage GetReturnType(EdmFunction edmFunction)
+    {
+        var returnParam = GetReturnParameter(edmFunction);
+        return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
+    }
+    
+    public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
+    {
+        var returnType = GetReturnType(edmFunction);
+        return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
+    }
+}
+
+public static void ArgumentNotNull<T>(T arg, string name) where T : class
+{
+    if (arg == null)
+    {
+        throw new ArgumentNullException(name);
+    }
+}
+#>

+ 25 - 0
KursachMukha692gr/NumberUpdateTrener.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.NumberUpdateTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение номера телефона тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение номера телефона тренера" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новый номер телефона тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/NumberUpdateTrener.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для NumberUpdateTrener.xaml
+    /// </summary>
+    public partial class NumberUpdateTrener : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public NumberUpdateTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if(Name.Text[i] >= '0' && Name.Text[i] <='9' && Name.Text.Length == 11)
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле номер телефона  должно содержать только цифры (без знака + и 11 цифр)");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set telephonenumTrener = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле номер телефона для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/NumberUpdateUchenik.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.NumberUpdateUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение номера телефона ученика" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение номера телефона ученика" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новый номер телефона ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 105 - 0
KursachMukha692gr/NumberUpdateUchenik.xaml.cs

@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для NumberUpdateUchenik.xaml
+    /// </summary>
+    public partial class NumberUpdateUchenik : Window
+    {
+
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public NumberUpdateUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id ученика должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '9' && Name.Text.Length == 11)
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле номер телефона должно содержать только цифры (без знака + и 11 цифр)");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infouchenik] set telephonenumUchenik = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле номер телефона для id " + id_turik.Text + " успешно изменено");
+                    ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+                    viborUchenikUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+            viborUchenikUpdate.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/PolUpdateTrener.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.PolUpdateTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение пола тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение пола тренера" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите пол тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/PolUpdateTrener.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для PolUpdateTrener.xaml
+    /// </summary>
+    public partial class PolUpdateTrener : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public PolUpdateTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] == '1' || Name.Text[i] == '2' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                        break;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле пол должно содержать только цифры 1 (мужской) и 2 (женский)");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set fk_pol_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле поле для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+    }
+}

+ 55 - 0
KursachMukha692gr/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("KursachMukha692gr")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("KursachMukha692gr")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// из модели COM, установите атрибут ComVisible для этого типа в значение true.
+[assembly: ComVisible(false)]
+
+//Чтобы начать создание локализуемых приложений, задайте
+//<UICulture>CultureYouAreCodingWith</UICulture> в файле .csproj
+//в <PropertyGroup>. Например, при использовании английского (США)
+//в своих исходных файлах установите <UICulture> в en-US.  Затем отмените преобразование в комментарий
+//атрибута NeutralResourceLanguage ниже.  Обновите "en-US" в
+//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
+                                     //(используется, если ресурс не найден на странице,
+                                     // или в словарях ресурсов приложения)
+    ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
+                                              //(используется, если ресурс не найден на странице,
+                                              // в приложении или в каких-либо словарях ресурсов для конкретной темы)
+)]
+
+
+// Сведения о версии для сборки включают четыре следующих значения:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Номер редакции
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
KursachMukha692gr/Properties/Resources.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace KursachMukha692gr.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
+    /// </summary>
+    // Этот класс создан автоматически классом StronglyTypedResourceBuilder
+    // с помощью такого средства, как ResGen или Visual Studio.
+    // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
+    // с параметром /str или перестройте свой проект VS.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KursachMukha692gr.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Перезаписывает свойство CurrentUICulture текущего потока для всех
+        ///   обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
KursachMukha692gr/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 0
KursachMukha692gr/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace KursachMukha692gr.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
KursachMukha692gr/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 34 - 0
KursachMukha692gr/RASPISANIYE.cs

@@ -0,0 +1,34 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace KursachMukha692gr
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class RASPISANIYE
+    {
+        public int id { get; set; }
+        public int fk_den_nedeli_id { get; set; }
+        public int fk_vremya_zanyatiya_id { get; set; }
+        public int fk_gruppi_id { get; set; }
+        public int fk_disciplina_id { get; set; }
+        public int fk_zal_trenirovki_id { get; set; }
+        public int fk_trener_id { get; set; }
+        public int fk_corpus_id { get; set; }
+    
+        public virtual corpus corpus { get; set; }
+        public virtual den_nedeli den_nedeli { get; set; }
+        public virtual disciplina disciplina { get; set; }
+        public virtual gruppa gruppa { get; set; }
+        public virtual infotrener infotrener { get; set; }
+        public virtual vremya_zanyatiya vremya_zanyatiya { get; set; }
+        public virtual zal_trenerovki zal_trenerovki { get; set; }
+    }
+}

+ 23 - 0
KursachMukha692gr/Raspisaniye.xaml

@@ -0,0 +1,23 @@
+<Window x:Class="KursachMukha692gr.Raspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:sys="clr-namespace:System;assembly=mscorlib"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        Title="Расписание занятий" Height="460" Width="1500" WindowStartupLocation="CenterScreen">
+    <Grid Background="#028E9B" Margin="0,0,2,0">
+        <DataGrid Height="400" Margin="279,10,10,0" VerticalAlignment="Top" AutoGenerateColumns="True" Name="raspisaniyegrid"/>
+        <Border  MinWidth="1070" MaxWidth="200" Margin="0,0,10,0">
+            <StackPanel Margin="-205,0,997,0">
+                <TextBox x:Name="search" Background="White"  Margin="60,15,60,15" TextChanged="search_TextChanged"/>
+                <Button Content="Поиск" Click="Button_Click_Search" Margin="40,0,40,40"/>
+            <Button Content="Добавить занятие" Click="Button_Click_add" Margin="40,0,40,40"/>
+            <Button Content="Изменить данные" Click="Button_Click_update" Margin="40,0,40,40"/>
+            <Button Content="Удалить занятие" Click="Button_Click_delete" Margin="40,0,40,40"/>
+            <Button Content="Назад" Click="Button_Click_Back" Margin="40,0,40,0" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/Raspisaniye.xaml.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using System.Windows.Navigation;
+using System.Data.SqlClient;
+using System.Data;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для Raspisaniye.xaml
+    /// </summary>
+    public partial class Raspisaniye : Window
+    {
+        public Raspisaniye()
+        {
+            InitializeComponent();
+            SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            connection.Open();
+            string cmd = "select id,fk_den_nedeli_id as 'id дня недели', fk_vremya_zanyatiya_id as 'id время занятия', fk_gruppi_id as 'id группы', fk_disciplina_id as 'id дисциплины',fk_zal_trenirovki_id as 'id зала тренировки',fk_trener_id as 'id тренера',fk_corpus_id as 'id корпуса' from RASPISANIYE";
+            SqlCommand createcommand = new SqlCommand(cmd, connection);
+            createcommand.ExecuteNonQuery();
+            
+            SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+            DataTable dt = new DataTable("raspisaniyes");
+            sql.Fill(dt);
+            raspisaniyegrid.ItemsSource = dt.DefaultView;
+            connection.Close();
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            KabinetAdmina kab = new KabinetAdmina();
+            kab.Show();
+            Close();
+        }
+
+        private void Button_Click_delete(object sender, RoutedEventArgs e)
+        {
+            DeleteRaspisaniye delete = new DeleteRaspisaniye();
+            delete.Show();
+            Close();
+        }
+
+        private void Button_Click_add(object sender, RoutedEventArgs e)
+        {
+            AddRaspisaniye raspisaniye = new AddRaspisaniye();
+            raspisaniye.Show();
+            Close();
+        }
+
+        private void Button_Click_update(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+
+        private void Button_Click_Search(object sender, RoutedEventArgs e)
+        {
+            if (search.Text.Length > 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,fk_den_nedeli_id as 'id дня недели', fk_vremya_zanyatiya_id as 'id время занятия', fk_gruppi_id as 'Номер группы', fk_disciplina_id as 'id дисциплины',fk_zal_trenirovki_id as 'id зала тренировки',fk_trener_id as 'id тренера',fk_corpus_id as 'id корпуса' from RASPISANIYE" +
+                    " where id like '%" + search.Text + "%' or fk_den_nedeli_id like '%" + search.Text + "%' or fk_vremya_zanyatiya_id like '%" + search.Text + "%' or fk_gruppi_id like '%" + search.Text + "%' or fk_disciplina_id like '%" + search.Text + "%' or fk_zal_trenirovki_id like '%" + search.Text + "%' or fk_trener_id like '%" + search.Text + "%' or fk_trener_id like '%" + search.Text + "%'";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                raspisaniyegrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+            else if (search.Text.Length == 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,fk_den_nedeli_id as 'id дня недели', fk_vremya_zanyatiya_id as 'id время занятия', fk_gruppi_id as 'id группы', fk_disciplina_id as 'id дисциплины',fk_zal_trenirovki_id as 'id зала тренировки',fk_trener_id as 'id тренера',fk_corpus_id as 'id корпуса' from RASPISANIYE";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                raspisaniyegrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+        }
+
+        private void search_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+    } 
+}

+ 31 - 0
KursachMukha692gr/RegUch.xaml

@@ -0,0 +1,31 @@
+<Window x:Class="KursachMukha692gr.RegUch"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        Title="Авторизация" Height="616" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="10" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2" Height="565">
+            <StackPanel>
+                <TextBlock Text="Регистрация администратора" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="familiyaAdmin" materialDesign:HintAssist.Hint="Введите фамилию" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="imyaAdmin" materialDesign:HintAssist.Hint="Введите имя" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="otchAdmin" materialDesign:HintAssist.Hint="Введите отчество" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <DatePicker x:Name="dataAdmin" materialDesign:HintAssist.Hint="Введите дату рождения" SelectedDateFormat="Short" Height="37"/>
+                <TextBox x:Name ="numberAdmin" materialDesign:HintAssist.Hint="Введите номер телефона" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="emailAdmin" materialDesign:HintAssist.Hint="Введите электронную почту" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="LoginAdmin" materialDesign:HintAssist.Hint="Введите логин" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <PasswordBox x:Name ="pass1Admin" materialDesign:HintAssist.Hint="Введите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
+                <PasswordBox x:Name ="pass2Admin" materialDesign:HintAssist.Hint="Повторите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
+                <Button Content="Зарегистировать администратора" Margin="0 20" Background="#006363" Click="Button_Click"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 271 - 0
KursachMukha692gr/RegUch.xaml.cs

@@ -0,0 +1,271 @@
+using MySql.Data.MySqlClient;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using System.Windows.Navigation;
+using System.Data.SqlClient;
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для RegUch.xaml
+    /// </summary>
+    public partial class RegUch : Window
+    {
+        List<string> Alphabetrus = new List<string> {
+            "А", "а", "Б", "б", "В", "в", "Г", "г", "Д", "д", "Е", "е", "Ё", "ё", "Ж", "ж", "З", "з", "И", "и", "Й", "й",
+            "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "Ф", "ф",
+            "Х", "х", "Ц", "ц", "Ч", "ч", "Ш", "ш", "Щ", "щ", "Ъ", "ъ", "Ы", "ы", "Ь", "ь", "Э", "э", "Ю", "ю", "Я", "я" };
+        List<string> Date = new List<string> {
+            "0","1","2","3","4","5","6","7","8","9","."};
+        //KURSACH1Entities db;
+        public RegUch()
+        {
+           
+            InitializeComponent();
+            //db = new KURSACH1Entities();
+            //List<infoadmin> infoadmins = db.infoadmins.ToList();
+            //string str = "";
+            //foreach (infoadmin flag in infoadmins)
+            //{
+            //  str += "Login: " + flag.LoginAdmin + " | ";
+            //}
+            //exampleText.Text = str;
+        }
+        /*public bool Reg(string fam)
+        {
+            if(string.IsNullOrEmpty(fam))
+            {
+                return false;
+            }
+            using(var db = new KURSACH1Entities2())
+            {
+                var uch = db.infoadmins
+                    .AsNoTracking()
+                    .FirstOrDefault(item => item.familiyaAdmin == familiyaAdmin.Text);
+                if(uch == null)
+                {
+                    return false;
+                }
+                return true;
+            }
+        }*/
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            if (familiyaAdmin.Text != "" && imyaAdmin.Text != "" && otchAdmin.Text != "" && dataAdmin.Text != "" && numberAdmin.Text != "" && emailAdmin.Text != "" && LoginAdmin.Text != "" && pass1Admin.Password != "" && pass2Admin.Password != "")
+            {
+                bool fam = false, imya = false, otch = false, data = false, num = false;
+                bool email = false , login = false , pas1 = false, pas2 = false;
+                for (int i = 0; i < familiyaAdmin.Text.Length; i++)//проверка фамилии
+                {
+                    if (fam)
+                    {
+                        fam = false;
+                    }
+                    for(int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if(Convert.ToString(familiyaAdmin.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            fam = true;
+                            break;
+                        }
+                    }
+                    if (fam == false)
+                    {
+                        MessageBox.Show("Поле фамилия должно содержать только русские символы"); 
+                        break;
+                    }
+                }
+                for (int i = 0; i < imyaAdmin.Text.Length; i++)//проверка имени
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(imyaAdmin.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле имя должно содержать только русские символы");
+                        break;
+                    }
+                }
+                for (int i = 0; i < otchAdmin.Text.Length; i++)//проверка отчества
+                {
+                    if (otch)
+                    {
+                        otch = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(otchAdmin.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            otch = true;
+                            break;
+                        }
+                    }
+                    if (otch == false)
+                    {
+                        MessageBox.Show("Поле отчество должно содержать только русские символы");
+                        break;
+                    } 
+                }
+                for (int i = 0; i < dataAdmin.Text.Length; i++)//проверка даты рождения
+                {
+                    if(data)
+                    {
+                        data = false;
+                    }
+                    for(int j = 0; j <Date.Count; j++)
+                    { 
+                        if(Convert.ToString(dataAdmin.Text[i]).Contains(Date[j]))
+                        {
+                            data = true;
+                            break;
+                        }
+                    }
+                    if (data == false)
+                    {
+                        MessageBox.Show("Поле дата рождения должно содержать только цифры и знак '.''");
+                        break;
+                    }
+                }
+                for (int i = 0; i < numberAdmin.Text.Length; i++)//проверка номера телефона
+                {
+                    if (num)
+                    {
+                        num = false;
+                    }
+                    if (numberAdmin.Text[i] >= '0' && numberAdmin.Text[i] <= '9' && numberAdmin.Text.Length == 11)
+                    {
+                        num = true;
+                        break;
+                    }
+                    if (num == false)
+                    {
+                        MessageBox.Show("Поле номер телефона  должно содержать только цифры (без знака + и 11 цифр)");
+                        break;
+                    } 
+                }
+                for (int i = 0; i < emailAdmin.Text.Length; i++)//проверка почту
+                {
+                    if (email)
+                    {
+                        email = false;
+                    }
+                    if (emailAdmin.Text[i] >= 'A' && emailAdmin.Text[i] <= 'Z' || emailAdmin.Text[i] >= 'a' && emailAdmin.Text[i] <= 'z' || emailAdmin.Text.Contains("@") || emailAdmin.Text.Contains("."))
+                    {
+                        email = true;
+                        break;
+                    }
+                    if (email == false)
+                    {
+                        MessageBox.Show("Поле электронная почта должно содержать только английские символы и знаки '@' и '.'");
+                        break;
+                    } 
+                }
+                for (int i = 0; i < LoginAdmin.Text.Length; i++)//проверка логина
+                {
+                    if (login)
+                    {
+                        login = false;
+                    }
+                    if (LoginAdmin.Text[i] >= 'A' && LoginAdmin.Text[i] <= 'Z' || LoginAdmin.Text[i] >= 'a' && LoginAdmin.Text[i] <= 'z')
+                    {
+                        login = true;
+                        break;
+                    }
+                    if (login == false)
+                    {
+                        MessageBox.Show("Поле логин должно содержать только английские символы");
+                        break;
+                    } 
+                }
+                for (int i = 0; i < pass1Admin.Password.Length; i++)//проверка пароля(англ символы)
+                {
+                    if (pas1)
+                    {
+                        pas1 = false;
+                    }
+                    if (pass1Admin.Password[i] >= 'a' && pass1Admin.Password[i] <= 'z' || pass1Admin.Password[i] >= 'A' && pass1Admin.Password[i] <= 'Z' || pass1Admin.Password[i] >= '0' && pass1Admin.Password[i] <= '9')
+                    {
+                        pas1 = true;
+                        break;
+                    }
+                    if (pas1 == false)
+                    {
+                        MessageBox.Show("Поле пароль должно содержать только английские символы и цифры");
+                        break;
+                    }
+                }
+                for (int i = 0; i < pass2Admin.Password.Length; i++)//проверка подтверждения пароля
+                {
+                    if (pas2)
+                    {
+                        pas2 = false;
+                    }
+                    if (pass2Admin.Password[i] == pass1Admin.Password[i])
+                    {
+                        pas2 = true;
+                        break;
+                    } 
+                    if (pas2 == false)
+                    {
+                        MessageBox.Show("Пароль не совпадает или вы не ввели его");
+                        break;
+                    } 
+                }
+                if(fam && imya && otch && data && num && email && login && pas1 && pas2)
+                {
+                    DataTable dt_infoadmin = Insert("insert into [dbo].[infoadmin] values " +
+                                                            "('" + imyaAdmin.Text + "','" + familiyaAdmin.Text + "','" + dataAdmin.Text +
+                                                              "','" + otchAdmin.Text + "','" + numberAdmin.Text + "','" + emailAdmin.Text +
+                                                              "','" + LoginAdmin.Text + "','" + pass1Admin.Password + "')");
+                    MessageBox.Show("Пользователь зарегистирован");
+                    Registration mainreg = new Registration();
+                    mainreg.Show();
+                    Close();
+                }
+                else { MessageBox.Show("Неправильный формат"); }
+            }
+            else { MessageBox.Show("Все строки должны быть заполнены"); }
+          
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            MainWindow mainreg = new MainWindow();
+            mainreg.Show();
+            Close();
+        }
+        public DataTable Insert(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+
+        
+    }
+}

+ 23 - 0
KursachMukha692gr/Registration.xaml

@@ -0,0 +1,23 @@
+<Window x:Class="KursachMukha692gr.Registration"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        Title="Авторизация" Height="370" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Border MinWidth="400" MaxWidth="400" Margin="15,0,15,10" Background="#35C0CD" VerticalAlignment="Bottom" Padding="30" Height="319">
+            <StackPanel>
+                <TextBlock Text="Авторизация администратора" HorizontalAlignment="Center"  FontSize="20" Margin="32,0,31,-5"/>
+                <Grid Margin="0 0 0 20"/>
+                <TextBox x:Name ="Login" materialDesign:HintAssist.Hint="Введите логин" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <PasswordBox x:Name ="pass1" materialDesign:HintAssist.Hint="Введите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
+                <Button Content="Войти" Margin="0,10" Background="#006363"  Click="Button_Click" Height="30"/>
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" Height="30" Margin="0,10" />
+                <Button Content="Сменить пароль" Background="#006363"  Click="Button_Click_Smena" Height="30" Margin="0,10"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 149 - 0
KursachMukha692gr/Registration.xaml.cs

@@ -0,0 +1,149 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using System.Data.SqlClient;
+using System.Data;
+using System.Configuration;
+using MySql.Data.MySqlClient;
+namespace KursachMukha692gr
+{
+
+    /// <summary>
+    /// Логика взаимодействия для Registration.xaml
+    /// </summary>
+    public partial class Registration : Window
+    {
+        public Registration()
+        {
+            InitializeComponent();
+
+            /*DataTable dt_infoadmins = Select("select * from [dbo].[infoadmin]");//получаем данные из таблицы
+            for(int i =0; i< dt_infoadmins.Rows.Count;i++)//перебираем данные
+            {
+                MessageBox.Show(dt_infoadmins.Rows[i][7] + " " + dt_infoadmins.Rows[i][8]);
+            }*/
+        }
+        /*public bool Reg(string log,string pas)
+        {
+            if (string.IsNullOrEmpty(log) || string.IsNullOrEmpty(pas))
+            {
+                return false;
+            }
+            using (var db = new KURSACH1Entities2())
+            {
+                var uch = db.infoadmins
+                    .AsNoTracking()
+                    .FirstOrDefault(item => item.loginAdmin == Login.Text && item.passAdmin == pass1.Password);
+                if (uch == null)
+                {
+                    return false;
+                }
+                return true;
+            }
+        }*/
+        /*public bool Reg(string log,string pas)
+        {
+            log = Login.Text;
+            pas = pass1.Password;
+            if (log.Length > 0)
+            {
+                if (pas.Length > 0)
+                {
+                    DataTable dt_infoadmins = Select("select * from [dbo].[infoadmin] where [loginAdmin] = '" + Login.Text + "' and [passAdmin] = '" + pass1.Password + "'");
+                    if (dt_infoadmins.Rows.Count > 0)
+                    {
+                        MessageBox.Show("Авторизация пройдена успешно");
+                        KabinetAdmina kabinetAdmina = new KabinetAdmina();
+                        kabinetAdmina.Show();
+                        Close();
+                        return true;
+                    }
+                    else
+                    {
+
+                        MessageBox.Show("Пользователь не найден");
+                        return false;
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("Введите пароль");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Введите логин");
+            }
+        }*/
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            if(Login.Text.Length > 0)
+            {
+                if(pass1.Password.Length > 0)
+                { 
+                   DataTable dt_infoadmins = Select("select * from [dbo].[infoadmin] where [loginAdmin] = '" + Login.Text + "' and [passAdmin] = '" + pass1.Password + "'");
+                   if (dt_infoadmins.Rows.Count > 0)
+                    {
+                       
+                       MessageBox.Show("Авторизация пройдена успешно");
+                       KabinetAdmina kabinetAdmina = new KabinetAdmina();
+                       kabinetAdmina.Show();
+                       Close();
+                    }
+                   else
+                   {
+                       
+                        MessageBox.Show("Пользователь не найден");
+                   }    
+                }
+                else 
+                {
+                    
+                    MessageBox.Show("Введите пароль");
+                    
+                }
+            }
+            else
+            {
+                
+                MessageBox.Show("Введите логин");
+                
+            }
+        }
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            MainWindow main = new MainWindow();
+            main.Show();
+            Close();
+        }
+        public DataTable Select(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+
+        private void Button_Click_Smena(object sender, RoutedEventArgs e)
+        {
+            SmenaPassword smenaPassword = new SmenaPassword();
+            smenaPassword.Show();
+            Close();
+        }
+    }
+}

+ 20 - 0
KursachMukha692gr/RegistrationTEST.xaml

@@ -0,0 +1,20 @@
+<Window x:Class="KursachMukha692gr.RegistrationTEST"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+         Title="Авторизация" Height="370" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Border MinWidth="400" MaxWidth="400" Margin="15,0,15,10" Background="#35C0CD" VerticalAlignment="Bottom" Padding="30" Height="319">
+            <StackPanel>
+                <TextBlock Text="Авторизация администратора" HorizontalAlignment="Center"  FontSize="20" Margin="32,0,31,-5"/>
+                <Grid Margin="0 0 0 20"/>
+                <TextBox x:Name ="Login" Text="Введите логин"/>
+                <PasswordBox x:Name ="pass1" />
+                <Button Content="Войти" Margin="0,10" Background="#006363"  Click="Button_Click" Height="30"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 96 - 0
KursachMukha692gr/RegistrationTEST.xaml.cs

@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для RegistrationTEST.xaml
+    /// </summary>
+    public partial class RegistrationTEST : Window
+    {
+        public RegistrationTEST()
+        {
+            InitializeComponent();
+        }
+
+        public bool Reg(string log, string pas)
+        {
+            if (string.IsNullOrEmpty(log) || string.IsNullOrEmpty(pas))
+            {
+                return false;
+            }
+            using (var db = new KURSACH1Entities2())
+            {
+                var uch = db.infoadmins
+                    .AsNoTracking()
+                    .FirstOrDefault(item => item.loginAdmin == Login.Text && item.passAdmin == pass1.Password);
+                if (uch == null)
+                {
+                    return false;
+                }
+                return true;
+            }
+        }
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            if (Login.Text.Length > 0)
+            {
+                if (pass1.Password.Length > 0)
+                {
+                    DataTable dt_infoadmins = Select("select * from [dbo].[infoadmin] where [loginAdmin] = '" + Login.Text + "' and [passAdmin] = '" + pass1.Password + "'");
+                    if (dt_infoadmins.Rows.Count > 0)
+                    {
+
+                        MessageBox.Show("Авторизация пройдена успешно");
+                        KabinetAdmina kabinetAdmina = new KabinetAdmina();
+                        kabinetAdmina.Show();
+                        Close();
+                    }
+                    else
+                    {
+
+                        MessageBox.Show("Пользователь не найден");
+                    }
+                }
+                else
+                {
+
+                    MessageBox.Show("Введите пароль");
+
+                }
+            }
+            else
+            {
+
+                MessageBox.Show("Введите логин");
+
+            }
+        }
+        public DataTable Select(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+
+    }
+}

+ 21 - 0
KursachMukha692gr/SmenaPassword.xaml

@@ -0,0 +1,21 @@
+<Window x:Class="KursachMukha692gr.SmenaPassword"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+         xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        Title="Смена пароля" Height="360" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Border MinWidth="400" MaxWidth="400" Margin="15,10" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Height="309">
+            <StackPanel>
+                <TextBlock Text="Смена пароля" HorizontalAlignment="Center"  FontSize="20" Margin="32,0,31,-5"/>
+                <Grid Margin="0 0 0 20"/>
+                <TextBox x:Name ="Login" materialDesign:HintAssist.Hint="Введите логин" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <PasswordBox x:Name ="pass1" materialDesign:HintAssist.Hint="Введите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
+                <PasswordBox x:Name ="pass2" materialDesign:HintAssist.Hint="Введите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
+                <Button Content="Сменить пароль" Margin="0,10" Background="#006363"  Click="Button_Click" Height="30"/>
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" Height="30" Margin="0,10" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 124 - 0
KursachMukha692gr/SmenaPassword.xaml.cs

@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для SmenaPassword.xaml
+    /// </summary>
+    public partial class SmenaPassword : Window
+    {
+        public DataTable Select(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public SmenaPassword()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            Registration registration = new Registration();
+            registration.Show();
+            Close();
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            if(Login.Text.Length > 0 && pass1.Password.Length > 0 && pass2.Password.Length > 0)
+            {
+                bool log = false, pas1 = false, pas2 = false ;
+                DataTable dt_infoadmins = Select("select * from [dbo].[infoadmin] where [loginAdmin] = '" + Login.Text + "'");
+                if (dt_infoadmins.Rows.Count > 0)
+                {
+                    log = true;
+                }
+                else { log = false; MessageBox.Show("Такого логина нет в системе"); }
+                for(int i = 0; i < pass1.Password.Length; i++)
+                {
+                    if(pas1)
+                    {
+                        pas1 = false;
+                    }
+                    if (pass1.Password[i] >= 'a' && pass1.Password[i] <= 'z' || pass1.Password[i] >= 'A' && pass1.Password[i] <= 'Z' || pass1.Password[i] >= '0' && pass1.Password[i] <= '9')
+                    {
+                        pas1 = true;
+                        break;
+                    }
+                    if (pas1 == false)
+                    {
+                        MessageBox.Show("Поле пароль должно содержать только английские символы и цифры");
+                        break;
+                    }
+                }
+                for (int i = 0; i < pass2.Password.Length; i++)//проверка подтверждения пароля
+                {
+                    if (pas2)
+                    {
+                        pas2 = false;
+                    }
+                    if (pass2.Password[i] == pass1.Password[i])
+                    {
+                        pas2 = true;
+                        break;
+                    }
+                    if (pas2 == false)
+                    {
+                        MessageBox.Show("Пароль не совпадает или вы не ввели его");
+                        break;
+                    }
+                }
+                if(log && pas1 && pas2)
+                {
+                    DataTable uppass = Update("update [dbo].[infoadmin] set passAdmin = '" + pass1.Password + "' where loginAdmin = '" + Login.Text + "'");
+                    MessageBox.Show("Смена пароля выполнена для пользователя " + Login.Text);
+                    Registration reg = new Registration();
+                    reg.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть заполнены");
+            }
+        }
+    }
+}

+ 27 - 0
KursachMukha692gr/SpisokTrenerov.xaml

@@ -0,0 +1,27 @@
+<Window x:Class="KursachMukha692gr.SpisokTrenerov"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:sys="clr-namespace:System;assembly=mscorlib"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+       Title="Список тренеров" Height="460" Width="1500" WindowStartupLocation="CenterScreen">
+    <Grid Background="#028E9B" Margin="0,0,2,0">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="151*"/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <DataGrid Height="400" Margin="279,15,10,0" VerticalAlignment="Top" AutoGenerateColumns="True" Name="infotrenergrid"/>
+        <Border  MinWidth="1170" MaxWidth="300">
+            <StackPanel Margin="-155,0,1049,0">
+                <TextBox x:Name="search" Background="White"  Margin="60,15,60,15" TextChanged="search_TextChanged"/>
+                <Button Content="Поиск" Click="Button_Click_Search" Margin="40,0,40,40" />
+                <Button Content="Добавить тренера" Click="Button_Click_add" Margin="40,0,40,40" />
+                <Button Content="Изменить данные" Click="Button_Click_update" Margin="40,0,40,40"/>
+                <Button Content="Удалить тренера" Click="Button_Click_delete" Margin="40,0,40,40"/>
+                <Button Content="Назад" Click="Button_Click_Back" Margin="40,0,40,0" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 105 - 0
KursachMukha692gr/SpisokTrenerov.xaml.cs

@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для SpisokTrenerov.xaml
+    /// </summary>
+    public partial class SpisokTrenerov : Window
+    {
+        public SpisokTrenerov()
+        {
+            InitializeComponent();
+            InitializeComponent();
+            SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            connection.Open();
+            string cmd = "select id,familiyaTrener as 'Фамилия',imyaTrener as 'Имя', otchestvoTrener as 'Отчество', dataTrener as 'Дата рождения', telephonenumTrener as 'Номер телефона',fk_disciplina_id as 'Спортивная специальность',categoryTrener as 'Тренерская категория', fk_pol_id as 'Пол' from infotrener";
+            SqlCommand createcommand = new SqlCommand(cmd, connection);
+            createcommand.ExecuteNonQuery();
+
+            SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+            DataTable dt = new DataTable("infotrener");
+            sql.Fill(dt);
+            infotrenergrid.ItemsSource = dt.DefaultView;
+            connection.Close();
+        }
+
+        private void Button_Click_add(object sender, RoutedEventArgs e)
+        {
+            AddTrener trener = new AddTrener();
+            trener.Show();
+            Close();
+        }
+
+        private void Button_Click_delete(object sender, RoutedEventArgs e)
+        {
+            DeleteSpisokTrenerov trenerov = new DeleteSpisokTrenerov();
+            trenerov.Show();
+            Close();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            KabinetAdmina kabinet = new KabinetAdmina();
+            kabinet.Show();
+            Close();
+        }
+
+        private void Button_Click_update(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate trenerUpdate = new ViborTrenerUpdate();
+            trenerUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Search(object sender, RoutedEventArgs e)
+        {
+            if (search.Text.Length > 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,familiyaTrener as 'Фамилия',imyaTrener as 'Имя', otchestvoTrener as 'Отчество', otchestvoTrener as 'Дата рождения', telephonenumTrener as 'Номер телефона',fk_disciplina_id as 'Спортивная специальность',categoryTrener as 'Тренерская категория', fk_pol_id as 'Пол' from infotrener" +
+                    " where id like '%" + search.Text + "%' or familiyaTrener like '%" + search.Text + "%' or imyaTrener like '%" + search.Text + "%' or otchestvoTrener like '%" + search.Text + "%' or otchestvoTrener like '%" + search.Text + "%' or telephonenumTrener like '%" + search.Text + "%' or fk_disciplina_id like '%" + search.Text + "%' or categoryTrener like '%" + search.Text + "%' or fk_pol_id like '%" + search.Text + "%'";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                infotrenergrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+            else if (search.Text.Length == 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,familiyaTrener as 'Фамилия',imyaTrener as 'Имя', otchestvoTrener as 'Отчество', dataTrener as 'Дата рождения', telephonenumTrener as 'Номер телефона',fk_disciplina_id as 'Спортивная специальность',categoryTrener as 'Тренерская категория', fk_pol_id as 'Пол' from infotrener";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                infotrenergrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+        }
+
+        private void search_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 27 - 0
KursachMukha692gr/SpisokUchenikov.xaml

@@ -0,0 +1,27 @@
+<Window x:Class="KursachMukha692gr.SpisokUchenikov"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:sys="clr-namespace:System;assembly=mscorlib"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+            Title="Список учеников" Height="460" Width="1500" WindowStartupLocation="CenterScreen">
+    <Grid Background="#028E9B" Margin="0,0,2,0">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="151*"/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <DataGrid Height="400" Margin="279,15,10,0" VerticalAlignment="Top" AutoGenerateColumns="True" Name="uchenikigrid"/>
+        <Border  MinWidth="1170" MaxWidth="300">
+            <StackPanel Margin="-155,0,1049,10" >
+                <TextBox x:Name="search" Background="White"  Margin="60,15,60,15" TextChanged="search_TextChanged"/>
+                <Button Content="Поиск" Click="Button_Click_Search" Margin="40,0,40,40" />
+                <Button Content="Добавить ученика" Click="Button_Click_add" Margin="40,0,40,40" />
+                <Button Content="Изменить данные" Click="Button_Click_update" Margin="40,0,40,40"/>
+                <Button Content="Удалить ученика" Click="Button_Click_delete" Margin="40,0,40,40"/>
+                <Button Content="Назад" Click="Button_Click_Back" Margin="40,0,40,0" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 104 - 0
KursachMukha692gr/SpisokUchenikov.xaml.cs

@@ -0,0 +1,104 @@
+ using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для SpisokUchenikov.xaml
+    /// </summary>
+    public partial class SpisokUchenikov : Window
+    {
+        public SpisokUchenikov()
+        {
+            InitializeComponent();
+            SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            connection.Open();
+            string cmd = "select id,familiya as 'Фамилия', imya as 'Имя', otchestvo as 'Отчество' , dataUchenik as 'Дата рождения',fk_disciplina_id as 'id дисциплины', fk_gruppa_id as 'Номер группы',fk_pol_id as 'id пола', telephonenumUchenik as 'Номер телефона' from infouchenik";
+            SqlCommand createcommand = new SqlCommand(cmd, connection);
+            createcommand.ExecuteNonQuery();
+
+            SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+            DataTable dt = new DataTable("ucheniki");
+            sql.Fill(dt);
+            uchenikigrid.ItemsSource = dt.DefaultView;
+            connection.Close();
+        }
+
+        private void Button_Click_add(object sender, RoutedEventArgs e)
+        {
+            AddUchenik uchenik = new AddUchenik();
+            uchenik.Show();
+            Close();
+        }
+
+        private void Button_Click_delete(object sender, RoutedEventArgs e)
+        {
+            DeleteSpisokUchenikov spisokUchenikov = new DeleteSpisokUchenikov();
+            spisokUchenikov.Show();
+            Close();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            KabinetAdmina kabinet = new KabinetAdmina();
+            kabinet.Show();
+            Close();
+        }
+
+        private void Button_Click_update(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate uchenikUpdate = new ViborUchenikUpdate();
+            uchenikUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Search(object sender, RoutedEventArgs e)
+        {
+            if (search.Text.Length > 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,familiya as 'Фамилия', imya as 'Имя', otchestvo as 'Отчество' , dataUchenik as 'Дата рождения',fk_disciplina_id as 'id дисциплины', fk_gruppa_id as 'Номер группы',fk_pol_id as 'id пола', telephonenumUchenik as 'Номер телефона' from infouchenik" +
+                    " where id like '%" + search.Text + "%' or familiya like '%" + search.Text + "%' or otchestvo like '%" + search.Text + "%' or dataUchenik like '%" + search.Text + "%' or fk_disciplina_id like '%" + search.Text + "%' or fk_gruppa_id like '%" + search.Text + "%' or fk_pol_id like '%" + search.Text + "%' or telephonenumUchenik like '%" + search.Text + "%'" ;
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                uchenikigrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+            else if (search.Text.Length == 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,familiya as 'Фамилия', imya as 'Имя', otchestvo as 'Отчество' , dataUchenik as 'Дата рождения',fk_disciplina_id as 'id дисциплины', fk_gruppa_id as 'Номер группы',fk_pol_id as 'id пола', telephonenumUchenik as 'Номер телефона' from infouchenik";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                uchenikigrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+        }
+
+        private void search_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 27 - 0
KursachMukha692gr/Tournments.xaml

@@ -0,0 +1,27 @@
+<Window x:Class="KursachMukha692gr.Tournments"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:sys="clr-namespace:System;assembly=mscorlib"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+        mc:Ignorable="d"
+         Title="Список соревнований" Height="460" Width="1500" WindowStartupLocation="CenterScreen">
+    <Grid Background="#028E9B" Margin="0,0,2,0">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="151*"/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <DataGrid Height="400" Margin="279,10,10,0" VerticalAlignment="Top" AutoGenerateColumns="True" Name="sorevigrid" />
+        <Border  MinWidth="1170" MaxWidth="300">
+            <StackPanel Margin="-155,0,1048,0">
+                <TextBox x:Name="search" Background="White"  Margin="60,15,60,15" TextChanged="search_TextChanged"/>
+                <Button Content="Поиск" Click="Button_Click_Search" Margin="40,0,40,40" />
+                <Button Content="Добавить соревнование" Click="Button_Click_add" Margin="40,0,40,40" />
+                <Button Content="Изменить данные" Click="Button_Click_update" Margin="40,0,40,40"/>
+                <Button Content="Удалить соревнование" Click="Button_Click_delete" Margin="40,0,40,40"/>
+                <Button Content="Назад" Click="Button_Click_Back" Margin="40,0,40,0" />
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 135 - 0
KursachMukha692gr/Tournments.xaml.cs

@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для Tournments.xaml
+    /// </summary>
+    public partial class Tournments : Window
+    {
+        public Tournments()
+        {
+            InitializeComponent();
+            SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            connection.Open();
+            string cmd = "select id,name_tournment as 'Название турнира', mesto_provedeniya as 'Место проведения', fk_disciplina_id as 'id дисциплины',fk_gruppa_id as 'Номер группы, принимающей участие', fk_infotrener_id as 'id тренера' from sorevnovaniya";
+            SqlCommand createcommand = new SqlCommand(cmd, connection);
+            createcommand.ExecuteNonQuery();
+            SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+            DataTable dt = new DataTable("sorevi");
+            sql.Fill(dt);
+            sorevigrid.ItemsSource = dt.DefaultView;
+            connection.Close();
+        }
+
+        private void Button_Click_add(object sender, RoutedEventArgs e)
+        {
+            AddTournment tournment = new AddTournment();
+            tournment.Show();
+            Close();
+        }
+
+        private void Button_Click_delete(object sender, RoutedEventArgs e)
+        {
+            DeleteTournment tournment = new DeleteTournment();
+            tournment.Show();
+            Close();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            KabinetAdmina kabinet = new KabinetAdmina();
+            kabinet.Show();
+            Close();
+        }
+
+        private void Button_Click_update(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateTournments tournments = new ViborUpdateTournments();
+            tournments.Show();
+            Close();
+        }
+
+        private void Button_Click_Search(object sender, RoutedEventArgs e)
+        {
+            /*ViborSearchTournment searchTournment = new ViborSearchTournment();
+            searchTournment.Show();
+            Close();*/
+            /*SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            connection.Open();
+            string cmd = "select id,name_tournment as 'Название турнира', mesto_provedeniya as 'Место проведения', fk_disciplina_id as 'id дисциплины',fk_gruppa_id as 'Номер группы, принимающей участие', fk_infotrener_id as 'id тренера' from sorevnovaniya";
+            SqlCommand createcommand = new SqlCommand(cmd, connection);
+            SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+            DataTable dt = new DataTable("sorevi");
+            if(dt.Rows.Count > 0)
+            {
+                dt.DefaultView.RowFilter = string.Format("id like '%{0}%'", search.Text);
+                sorevigrid.ItemsSource = dt.DefaultView;
+            }
+            */
+            if(search.Text.Length > 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,name_tournment as 'Название турнира', mesto_provedeniya as 'Место проведения', fk_disciplina_id as 'id дисциплины',fk_gruppa_id as 'Номер группы, принимающей участие', fk_infotrener_id as 'id тренера' from sorevnovaniya where id like '%" + search.Text + "%' or mesto_provedeniya like '%" + search.Text + "%'" +
+                    " or fk_disciplina_id like '%" + search.Text + "%' or fk_gruppa_id like '%" + search.Text + "%' or  fk_infotrener_id like '%" + search.Text + "%'";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                sorevigrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+            else if (search.Text.Length == 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,name_tournment as 'Название турнира', mesto_provedeniya as 'Место проведения', fk_disciplina_id as 'id дисциплины',fk_gruppa_id as 'Номер группы, принимающей участие', fk_infotrener_id as 'id тренера' from sorevnovaniya";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                createcommand.ExecuteNonQuery();
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                DataTable dt = new DataTable("sorevi");
+                sql.Fill(dt);
+                sorevigrid.ItemsSource = dt.DefaultView;
+                connection.Close();
+            }
+        }
+
+        private void search_TextChanged(object sender, TextChangedEventArgs e)
+        {
+           
+            /*if (search.Text.Length > 0)
+            {
+                SqlConnection connection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+                connection.Open();
+                string cmd = "select id,name_tournment as 'Название турнира', mesto_provedeniya as 'Место проведения', fk_disciplina_id as 'id дисциплины',fk_gruppa_id as 'Номер группы, принимающей участие', fk_infotrener_id as 'id тренера' from sorevnovaniya";
+                SqlCommand createcommand = new SqlCommand(cmd, connection);
+                SqlDataAdapter sql = new SqlDataAdapter(createcommand);
+                if(connection.State == ConnectionState.Open)
+                {
+                    DataTable dt = new DataTable("sorevi");
+                    sql.Fill(dt);
+                    sorevigrid.ItemsSource = dt.DefaultView;
+                    connection.Close();
+                }
+                //sorevigrid.ItemsSource = dataSet.Tables[o]
+            }
+            */
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateFamiliyaTrener.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateFamiliyaTrener"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение фамилии тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение фамилии тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новую фамилию тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 111 - 0
KursachMukha692gr/UpdateFamiliyaTrener.xaml.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateFamiliyaTrener.xaml
+    /// </summary>
+    public partial class UpdateFamiliyaTrener : Window
+    {
+        List<string> Alphabetrus = new List<string> {
+            "А", "а", "Б", "б", "В", "в", "Г", "г", "Д", "д", "Е", "е", "Ё", "ё", "Ж", "ж", "З", "з", "И", "и", "Й", "й",
+            "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "Ф", "ф",
+            "Х", "х", "Ц", "ц", "Ч", "ч", "Ш", "ш", "Щ", "щ", "Ъ", "ъ", "Ы", "ы", "Ь", "ь", "Э", "э", "Ю", "ю", "Я", "я" };
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public UpdateFamiliyaTrener()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborTrenerUpdate viborTrenerUpdate = new ViborTrenerUpdate();
+            viborTrenerUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id тренера должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(Name.Text[i]).Contains(Alphabetrus[j]))
+                        { 
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле фамилия должно содержать только русские символы");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infotrener] set familiyaTrener = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле фамилия для id " + id_turik.Text + " успешно изменено");
+                    ViborTrenerUpdate updateFamiliyaTrener = new ViborTrenerUpdate();
+                    updateFamiliyaTrener.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateFamiliyaUchenik.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateFamiliyaUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение фамилии ученика" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение фамилии ученика" FontSize="19" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите фамилию ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 111 - 0
KursachMukha692gr/UpdateFamiliyaUchenik.xaml.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateFamiliyaUchenik.xaml
+    /// </summary>
+    public partial class UpdateFamiliyaUchenik : Window
+    {
+        List<string> Alphabetrus = new List<string> {
+            "А", "а", "Б", "б", "В", "в", "Г", "г", "Д", "д", "Е", "е", "Ё", "ё", "Ж", "ж", "З", "з", "И", "и", "Й", "й",
+            "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "Ф", "ф",
+            "Х", "х", "Ц", "ц", "Ч", "ч", "Ш", "ш", "Щ", "щ", "Ъ", "ъ", "Ы", "ы", "Ь", "ь", "Э", "э", "Ю", "ю", "Я", "я" };
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public UpdateFamiliyaUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id ученика должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)//проверка фамилии
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    for (int j = 0; j < Alphabetrus.Count; j++)
+                    {
+                        if (Convert.ToString(Name.Text[i]).Contains(Alphabetrus[j]))
+                        {
+                            imya = true;
+                            break;
+                        }
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле фамилия должно содержать только русские символы");
+                        break;
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infouchenik] set familiya = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле фамилия для id " + id_turik.Text + " успешно изменено");
+                    ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+                    viborUchenikUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+            viborUchenikUpdate.Show();
+            Close();
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateGruppaRaspisaniye.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateGruppaRaspisaniye"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение группы" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение номера группы" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id занятия" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новый номер группы" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/UpdateGruppaRaspisaniye.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateGruppaRaspisaniye.xaml
+    /// </summary>
+    public partial class UpdateGruppaRaspisaniye : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public UpdateGruppaRaspisaniye()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+            updateRaspisaniye.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id занятия должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '9' && Name.Text.Length == 3)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[RASPISANIYE] set fk_gruppi_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле номер группы для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateRaspisaniye updateRaspisaniye = new ViborUpdateRaspisaniye();
+                    updateRaspisaniye.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 24 - 0
KursachMukha692gr/UpdateGruppaTournment.xaml

@@ -0,0 +1,24 @@
+<Window x:Class="KursachMukha692gr.UpdateGruppaTournment"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+       xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        mc:Ignorable="d"
+        Title="Изменение группы" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение группы" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id соревнования" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новую группу, участвующую в турнире" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Delete"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/UpdateGruppaTournment.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateGruppaTournment.xaml
+    /// </summary>
+    public partial class UpdateGruppaTournment : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public UpdateGruppaTournment()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateTournments tournments = new ViborUpdateTournments();
+            tournments.Show();
+            Close();
+        }
+
+        private void Button_Click_Delete(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id соревнования должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '9' && Name.Text.Length == 3)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[sorevnovaniya] set fk_gruppa_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле группа для id " + id_turik.Text + " успешно изменено");
+                    ViborUpdateTournments viborUpdate = new ViborUpdateTournments();
+                    viborUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateGruppaUchenik.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateGruppaUchenik"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение группы" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение номера группы" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id ученика" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новый номер группы" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 102 - 0
KursachMukha692gr/UpdateGruppaUchenik.xaml.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateGruppaUchenik.xaml
+    /// </summary>
+    public partial class UpdateGruppaUchenik : Window
+    {
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+        public UpdateGruppaUchenik()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+            viborUchenikUpdate.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_turik.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_turik.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_turik.Text[i] >= '1' && id_turik.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id ученика должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '9' && Name.Text.Length == 3)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле группа должно содержать цифры (3 цифры)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[infouchenik] set fk_gruppa_id = '" + Name.Text + "' where id = " + id_turik.Text);
+                    MessageBox.Show("Поле номер группы для id " + id_turik.Text + " успешно изменено");
+                    ViborUchenikUpdate viborUchenikUpdate = new ViborUchenikUpdate();
+                    viborUchenikUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateIdDiscipliniTournment.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateIdDiscipliniTournment"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+         xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение id дисциплины" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id дисциплины" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_dis" materialDesign:HintAssist.Hint="Введите id соревнования" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id дисциплины" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 103 - 0
KursachMukha692gr/UpdateIdDiscipliniTournment.xaml.cs

@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace KursachMukha692gr
+{
+    /// <summary>
+    /// Логика взаимодействия для UpdateIdDiscipliniTournment.xaml
+    /// </summary>
+    public partial class UpdateIdDiscipliniTournment : Window
+    {
+        public UpdateIdDiscipliniTournment()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click_Back(object sender, RoutedEventArgs e)
+        {
+            ViborUpdateTournments tournments = new ViborUpdateTournments();
+            tournments.Show();
+            Close();
+        }
+
+        private void Button_Click_Up(object sender, RoutedEventArgs e)
+        {
+            if (id_dis.Text.Length != 0 && Name.Text.Length != 0)
+            {
+                bool turik = false, imya = false;
+                for (int i = 0; i < id_dis.Text.Length; i++)
+                {
+                    if (turik)
+                    {
+                        turik = false;
+                    }
+                    if (id_dis.Text[i] >= '1' && id_dis.Text[i] <= '9')
+                    {
+                        turik = true;
+                    }
+                    if (turik == false)
+                    {
+                        MessageBox.Show("Поле id соревнования должно содержать только цифры");
+                    }
+                }
+                for (int i = 0; i < Name.Text.Length; i++)
+                {
+                    if (imya)
+                    {
+                        imya = false;
+                    }
+                    if (Name.Text[i] >= '0' && Name.Text[i] <= '7' && Name.Text.Length == 1)
+                    {
+                        imya = true;
+                    }
+                    if (imya == false)
+                    {
+                        MessageBox.Show("Поле дисциплина должно содержать id дисциплины (1-хоккей,2-Волейбол,3-Футбол,4-Баскетбол,5-Плавание,6-Мини-футбол,7-Бокс)");
+                    }
+                }
+                if (turik && imya)
+                {
+                    DataTable upname = Update("update [dbo].[sorevnovaniya] set fk_disciplina_id = '" + Name.Text + "' where id = " + id_dis.Text);
+                    MessageBox.Show("Поле id дисциплины для id " + id_dis.Text + " успешно изменено");
+                    ViborUpdateTournments viborUpdate = new ViborUpdateTournments();
+                    viborUpdate.Show();
+                    Close();
+                }
+                else
+                {
+                    MessageBox.Show("Неправильный формат");
+                }
+            }
+            else
+            {
+                MessageBox.Show("Все поля должны быть введены");
+            }
+        }
+
+        public DataTable Update(string selectSQL)
+        {
+            DataTable dataTable = new DataTable("dataBase");
+            SqlConnection sqlConnection = new SqlConnection("server=WIN-2CL665KE0ED; Trusted_Connection=YES;DataBase=KURSACH1;");
+            sqlConnection.Open();
+            SqlCommand sqlCommand = sqlConnection.CreateCommand();
+            sqlCommand.CommandText = selectSQL;
+            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
+            sqlDataAdapter.Fill(dataTable);
+            sqlConnection.Close();
+            return dataTable;
+        }
+    }
+}

+ 25 - 0
KursachMukha692gr/UpdateIdTrenerTournment.xaml

@@ -0,0 +1,25 @@
+<Window x:Class="KursachMukha692gr.UpdateIdTrenerTournment"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:KursachMukha692gr"
+         mc:Ignorable="d"
+        Title="Изменение id тренера" Height="400" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+    <Grid Background="#028E9B">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="77*"/>
+            <RowDefinition Height="493*"/>
+        </Grid.RowDefinitions>
+        <Border MinWidth="400" MaxWidth="400" Margin="15,32,15,31" Background="#35C0CD" VerticalAlignment="Center" Padding="30" Grid.RowSpan="2">
+            <StackPanel>
+                <TextBlock Text="Изменение id тренера" FontSize="20" Margin="0 0 0 20" HorizontalAlignment="Center"/>
+                <TextBox x:Name ="id_turik" materialDesign:HintAssist.Hint="Введите id соревнования" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <TextBox x:Name ="Name" materialDesign:HintAssist.Hint="Введите новое id тренера" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
+                <Button Content="Применить изменения" Margin="0 20" Background="#006363" Click="Button_Click_Up"  />
+                <Button Content="Назад" Background="#006363"  Click="Button_Click_Back" RenderTransformOrigin="0.496,0.453" Height="31"/>
+            </StackPanel>
+        </Border>
+    </Grid>
+</Window>

+ 0 - 0
KursachMukha692gr/UpdateIdTrenerTournment.xaml.cs


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików