Ver código fonte

Добавьте файлы проекта.

gr672_nvn 5 anos atrás
pai
commit
80a7e7abc4
54 arquivos alterados com 4674 adições e 0 exclusões
  1. 31 0
      DailyPlanner.sln
  2. 51 0
      DailyPlanner/AddTaskPage.xaml
  3. 145 0
      DailyPlanner/AddTaskPage.xaml.cs
  4. 6 0
      DailyPlanner/App.config
  5. 753 0
      DailyPlanner/App.xaml
  6. 17 0
      DailyPlanner/App.xaml.cs
  7. 33 0
      DailyPlanner/AuthorizationPage.xaml
  8. 64 0
      DailyPlanner/AuthorizationPage.xaml.cs
  9. 46 0
      DailyPlanner/CalendarPage.xaml
  10. 98 0
      DailyPlanner/CalendarPage.xaml.cs
  11. 20 0
      DailyPlanner/ConvertImageToByte.cs
  12. 14 0
      DailyPlanner/DB.cs
  13. 31 0
      DailyPlanner/DailyPlanner.Context.cs
  14. 636 0
      DailyPlanner/DailyPlanner.Context.tt
  15. 10 0
      DailyPlanner/DailyPlanner.Designer.cs
  16. 9 0
      DailyPlanner/DailyPlanner.cs
  17. 226 0
      DailyPlanner/DailyPlanner.csproj
  18. 192 0
      DailyPlanner/DailyPlanner.edmx
  19. 15 0
      DailyPlanner/DailyPlanner.edmx.diagram
  20. 733 0
      DailyPlanner/DailyPlanner.tt
  21. 60 0
      DailyPlanner/EditUserPage.xaml
  22. 145 0
      DailyPlanner/EditUserPage.xaml.cs
  23. 14 0
      DailyPlanner/EditUserPanelPage.xaml
  24. 36 0
      DailyPlanner/EditUserPanelPage.xaml.cs
  25. 17 0
      DailyPlanner/MainWindow.xaml
  26. 32 0
      DailyPlanner/MainWindow.xaml.cs
  27. 16 0
      DailyPlanner/ManagerFrame.cs
  28. 15 0
      DailyPlanner/Month.cs
  29. 31 0
      DailyPlanner/PanelPage.xaml
  30. 62 0
      DailyPlanner/PanelPage.xaml.cs
  31. 55 0
      DailyPlanner/Properties/AssemblyInfo.cs
  32. 83 0
      DailyPlanner/Properties/Resources.Designer.cs
  33. 127 0
      DailyPlanner/Properties/Resources.resx
  34. 30 0
      DailyPlanner/Properties/Settings.Designer.cs
  35. 7 0
      DailyPlanner/Properties/Settings.settings
  36. 45 0
      DailyPlanner/RegistrationPage.xaml
  37. 103 0
      DailyPlanner/RegistrationPage.xaml.cs
  38. 14 0
      DailyPlanner/RegistrationPanelPage.xaml
  39. 34 0
      DailyPlanner/RegistrationPanelPage.xaml.cs
  40. BIN
      DailyPlanner/Resources/DefaultImage.jpg
  41. BIN
      DailyPlanner/Resources/notepad-vector-icon.png
  42. 88 0
      DailyPlanner/ShowTaskPage.xaml
  43. 205 0
      DailyPlanner/ShowTaskPage.xaml.cs
  44. 15 0
      DailyPlanner/StringFormatState.cs
  45. 38 0
      DailyPlanner/Task.cs
  46. 62 0
      DailyPlanner/TaskPartial.cs
  47. 32 0
      DailyPlanner/User.cs
  48. 28 0
      DailyPlanner/UserPartial.cs
  49. 5 0
      DailyPlanner/packages.config
  50. 6 0
      UnitTestDailyPlanner/App.Config
  51. 20 0
      UnitTestDailyPlanner/DailyPlannerTest.cs
  52. 20 0
      UnitTestDailyPlanner/Properties/AssemblyInfo.cs
  53. 92 0
      UnitTestDailyPlanner/UnitTestDailyPlanner.csproj
  54. 7 0
      UnitTestDailyPlanner/packages.config

+ 31 - 0
DailyPlanner.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29503.13
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DailyPlanner", "DailyPlanner\DailyPlanner.csproj", "{1F251EB0-649B-4DB4-9278-041FBD839301}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestDailyPlanner", "UnitTestDailyPlanner\UnitTestDailyPlanner.csproj", "{7E001747-2167-48ED-88F6-74F97506B484}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1F251EB0-649B-4DB4-9278-041FBD839301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1F251EB0-649B-4DB4-9278-041FBD839301}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1F251EB0-649B-4DB4-9278-041FBD839301}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1F251EB0-649B-4DB4-9278-041FBD839301}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7E001747-2167-48ED-88F6-74F97506B484}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7E001747-2167-48ED-88F6-74F97506B484}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7E001747-2167-48ED-88F6-74F97506B484}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7E001747-2167-48ED-88F6-74F97506B484}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {4FEF1608-8607-46B9-A9B4-C6B347EE7410}
+	EndGlobalSection
+EndGlobal

+ 51 - 0
DailyPlanner/AddTaskPage.xaml

@@ -0,0 +1,51 @@
+<Page x:Class="DailyPlanner.AddTaskPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Добавление задачи">
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,20,0,0">
+            <CheckBox x:Name="SubTask" HorizontalAlignment="Center" VerticalAlignment="Center" VerticalContentAlignment="Center" Checked="SubTask_Checked" Unchecked="SubTask_Unchecked" Margin="0,0,0,10">
+                <TextBlock Text="Подзадача"></TextBlock>
+            </CheckBox>
+            <StackPanel Orientation="Horizontal" Name="MainTask" Visibility="Collapsed" Margin="0,0,0,10">
+                <TextBlock Text="Главная задача"></TextBlock>
+                <ComboBox Name="CmbMainTask" Width="300" Margin="30,0,0,0" Style="{StaticResource ComboBoxMainStyle}"></ComboBox>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
+                <TextBlock Text="Название задачи"></TextBlock>
+                <TextBox FontSize="25" Margin="9,0,0,0" Name="TxtName" Width="300"></TextBox>
+            </StackPanel>
+            <TextBlock Text="Описание" HorizontalAlignment="Center"></TextBlock>
+            <TextBox x:Name="TxtDescription" BorderThickness="1" Width="400" Height="300" HorizontalAlignment="Center"></TextBox>
+        </StackPanel>
+        <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top"  Margin="0,20,0,0">
+            <StackPanel Orientation="Horizontal"  Margin="0,0,0,10">
+                <TextBlock Text="Дата выполнения: " Margin="0,0,10,0"></TextBlock>
+                <DatePicker Name="DaPDateOfTask"></DatePicker>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
+                <TextBlock Text="Время выполнения: "></TextBlock>
+                <TextBox Name="TxtTimeOfTask" ></TextBox>
+            </StackPanel>
+            <TextBlock Text="Изображение" HorizontalAlignment="Center" ></TextBlock>
+            <Grid x:Name="ImageGrid" MouseDown="ImageGrid_MouseDown">
+                <Button Name="BtnDeletePhoto" Content="✗" Height="50" Width="50" HorizontalAlignment="Right" Click="BtnDeletePhoto_Click" VerticalAlignment="Top" Grid.Column="1" Panel.ZIndex="1"></Button>
+                <Border BorderBrush="#BFEE8756" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="2" Background="Transparent" Panel.ZIndex="1" Height="300" Width="350">
+                    <Image x:Name="PhotoOfClent" Height="350" Width="350"></Image>
+                </Border>
+                <TextBlock Text="Добавить изображение" x:Name="TxtAddImage" HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="0"></TextBlock>
+            </Grid>
+        </StackPanel>
+        <Button x:Name="BtnAddTask" Content="Добавить" VerticalAlignment="Bottom" Margin="0,0,0,30" Click="BtnAddTask_Click" Grid.ColumnSpan="2"></Button>
+    </Grid>
+</Page>

+ 145 - 0
DailyPlanner/AddTaskPage.xaml.cs

@@ -0,0 +1,145 @@
+using Microsoft.Win32;
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для AddTaskPage.xaml
+    /// </summary>
+    public partial class AddTaskPage : Page
+    {
+        public int UserID { get; set; }
+        string FilePath = string.Empty;
+        public AddTaskPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+            CmbMainTask.ItemsSource = DB.db.Task.Where(item => item.IDUser == UserID && item.IDMainTask == null).ToList();
+            CmbMainTask.DisplayMemberPath = "NameTask";
+            CmbMainTask.SelectedValuePath = "TaskID";
+            CmbMainTask.SelectedIndex = 0;
+        }
+
+        private void SubTask_Checked(object sender, RoutedEventArgs e)
+        {
+            MainTask.Visibility = Visibility.Visible;
+        }
+
+        private void SubTask_Unchecked(object sender, RoutedEventArgs e)
+        {
+            MainTask.Visibility = Visibility.Collapsed;
+        }
+
+        private void ImageGrid_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            if (openFileDialog.ShowDialog() == true)
+            {
+                FilePath = openFileDialog.FileName;
+                string uriString = $"{FilePath}";
+                TxtAddImage.Visibility = Visibility.Hidden;
+                PhotoOfClent.Source = new BitmapImage(new Uri(@uriString));
+            }
+            else
+            {
+                FilePath = string.Empty;
+            }
+        }
+
+        private void BtnDeletePhoto_Click(object sender, RoutedEventArgs e)
+        {
+            PhotoOfClent.Source = null;
+            TxtAddImage.Visibility = Visibility.Visible;
+            FilePath = string.Empty;
+        }
+
+        public bool AddTask(string NameTask, int IDUser, int? IDMainTask, DateTime? DateOfTask, TimeSpan? TimeOfTask, string Description, byte[] Image)
+        {
+            if (NameTask == string.Empty)
+            {
+                MessageBox.Show("Задача должна содержать как минимум название");
+                return false;
+            }
+            else
+            {
+                try
+                {
+                    Task NewTask = new Task();
+                    NewTask.NameTask = NameTask;
+                    NewTask.IDUser = IDUser;
+                    NewTask.IDMainTask = IDMainTask;
+                    NewTask.DateOfTask = DateOfTask;
+                    NewTask.TimeOfTask = TimeOfTask;
+                    NewTask.Description = Description;
+                    NewTask.Image = Image;
+                    DB.db.Task.Add(NewTask);
+                    DB.db.SaveChanges();
+                    MessageBox.Show("Добавлено");
+                    CmbMainTask.ItemsSource = DB.db.Task.Where(item => item.IDUser == UserID && item.IDMainTask == null).ToList();
+                    CmbMainTask.DisplayMemberPath = "NameTask";
+                    CmbMainTask.SelectedValuePath = "TaskID";
+                    CmbMainTask.SelectedIndex = 0;
+                    return true;
+                }
+                catch
+                {
+                    MessageBox.Show("Не корректные данные");
+                    return false;
+                }
+
+            }
+        }
+        private void BtnAddTask_Click(object sender, RoutedEventArgs e)
+        {
+            int? IDMainTask = null;
+            if (SubTask.IsChecked == true)
+            {
+                IDMainTask =Convert.ToInt32(CmbMainTask.SelectedValue.ToString());
+            }
+            string Description = null;
+            if (TxtDescription.Text != string.Empty)
+            {
+                Description = TxtDescription.Text;
+            }
+            byte[] Image = null;
+            if (FilePath != string.Empty)
+            {
+                Image = ConvertImageToByte.ImageToByte(FilePath);
+            }
+            TimeSpan? TimeOfTask = null;
+            TimeSpan TempTime;
+            if(TxtTimeOfTask.Text != string.Empty)
+            {
+                if (TimeSpan.TryParse(TxtTimeOfTask.Text, out TempTime) == false)
+                {
+                    MessageBox.Show("Некорректно задано время");
+                }
+                else
+                {
+                    TimeOfTask = TempTime;
+                    AddTask(TxtName.Text, UserID, IDMainTask, DaPDateOfTask.SelectedDate.GetValueOrDefault(), TimeOfTask, Description, Image);
+                }
+            }
+            else
+            {
+                AddTask(TxtName.Text, UserID, IDMainTask, DaPDateOfTask.SelectedDate.GetValueOrDefault(), TimeOfTask, Description, Image);
+            }
+            
+
+
+        }
+    }
+}

+ 6 - 0
DailyPlanner/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
+    </startup>
+<connectionStrings><add name="DailyPlannerEntities" connectionString="metadata=res://*/DailyPlanner.csdl|res://*/DailyPlanner.ssdl|res://*/DailyPlanner.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DESKTOP-340BQJQ\SQLEXPRESS2;initial catalog=DailyPlanner;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>

Diferenças do arquivo suprimidas por serem muito extensas
+ 753 - 0
DailyPlanner/App.xaml


+ 17 - 0
DailyPlanner/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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 33 - 0
DailyPlanner/AuthorizationPage.xaml

@@ -0,0 +1,33 @@
+<Page x:Class="DailyPlanner.AuthorizationPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Авторизация">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+
+        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom">
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Логин" Margin="0,0,36,0" FontSize="50"></TextBlock>
+                <TextBox BorderThickness="0,0,0,1" Text="Test" Name="TxtLogin"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Пароль" Margin="0,0,10,0" FontSize="50"></TextBlock>
+                <PasswordBox BorderThickness="0,0,0,1" Password="QWEasd123" Name="PxbPassword"></PasswordBox>
+            </StackPanel>
+        </StackPanel>
+        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top">
+            <Button Name="Enter" Click="Enter_Click" Content="Вход" Margin="0,15,0,0"></Button>
+            <Button Name="Registration" Click="Registration_Click" Content="Регистрация" Margin="10,15,0,0"></Button>
+        </StackPanel>
+
+    </Grid>
+</Page>

+ 64 - 0
DailyPlanner/AuthorizationPage.xaml.cs

@@ -0,0 +1,64 @@
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для AuthorizationPage.xaml
+    /// </summary>
+    public partial class AuthorizationPage : Page
+    {
+        public AuthorizationPage()
+        {
+            InitializeComponent();
+        }
+        //Метод для авторизации
+        public bool Autorization(string login, string password)
+        {
+            if (login == string.Empty || password == string.Empty)
+            {
+                MessageBox.Show("Ключевые поля не заполнены");
+                return false;
+            }
+            //Поиск пользователя в БД
+            var SelectUser = DB.db.User.SingleOrDefault(item => item.Login == login && item.Password == password);
+            if (SelectUser != null)
+            {
+                ManagerFrame.PanelFrame.Visibility = Visibility.Visible;
+                ManagerFrame.PanelFrame.Navigate(new PanelPage(SelectUser.UserID));
+                ManagerFrame.MainFrame.Navigate(new ShowTaskPage(SelectUser.UserID));
+                MessageBox.Show("Здравствуйте " + SelectUser.RealName);
+                return true;
+            }
+            else
+            {
+                MessageBox.Show("Введены не корректные данные");
+                return false;
+            }
+        }
+
+        private void Enter_Click(object sender, RoutedEventArgs e)
+        {
+            Autorization(TxtLogin.Text, PxbPassword.Password);
+        }
+        //Переход к регистрации
+        private void Registration_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.Navigate(new RegistrationPage());
+            ManagerFrame.PanelFrame.Navigate(new RegistrationPanelPage());
+            ManagerFrame.PanelFrame.Visibility = Visibility.Visible;
+        }
+    }
+}

+ 46 - 0
DailyPlanner/CalendarPage.xaml

@@ -0,0 +1,46 @@
+<Page x:Class="DailyPlanner.CalendarPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Календарь">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*"/>
+            <RowDefinition Height="4*"/>
+        </Grid.RowDefinitions>
+        <TextBlock x:Name="TxtToLeft" Text="&lt;" VerticalAlignment="Center" FontSize="80" Margin="200,0,0,0" HorizontalAlignment="Left"  MouseDown="TxtToLeft_MouseDown"/>
+        <ItemsControl Name="ListMonth" VerticalAlignment="Center" HorizontalAlignment="Center" >
+            <ItemsControl.ItemTemplate>
+                <DataTemplate>
+                    <TextBlock x:Name="TxtMonth" HorizontalAlignment="Center" FontSize="60" Text="{Binding NameMonth}"></TextBlock>
+                </DataTemplate>
+            </ItemsControl.ItemTemplate>
+        </ItemsControl>
+        <TextBlock x:Name="TxtToRight" Text=">" FontSize="80" HorizontalAlignment="Right" Margin="0,0,200,0" VerticalAlignment="Center" MouseDown="TxtToRight_MouseDown"></TextBlock>
+        <ListView x:Name="DayOfMonthList" Grid.Row="1" Background="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+            <ListView.ItemTemplate>
+                <DataTemplate>
+                    <Grid Height="180" Width="180">
+                        <Grid.Background>
+                            <ImageBrush ImageSource="{Binding Image}"> </ImageBrush>
+                        </Grid.Background>
+                        <TextBlock HorizontalAlignment="Center"  VerticalAlignment="Top" FontSize="50" Text="{Binding DateOfTask, StringFormat={}{0:dd}}"></TextBlock>
+                        <ScrollViewer Visibility="{Binding VisibilityTaskList}" CanContentScroll="True" HorizontalScrollBarVisibility="Disabled" Height="100" VerticalScrollBarVisibility="Hidden" Name="Scroller" VerticalAlignment="Bottom" HorizontalAlignment="Stretch">
+                            <TextBlock Text="{Binding AllTaskForDay}" TextWrapping="Wrap" MinHeight="80" TextAlignment="Center" ></TextBlock>
+                        </ScrollViewer>
+                    </Grid>
+                </DataTemplate>
+            </ListView.ItemTemplate>
+            <ListView.ItemsPanel>
+                <ItemsPanelTemplate>
+                    <WrapPanel></WrapPanel>
+                </ItemsPanelTemplate>
+            </ListView.ItemsPanel>
+        </ListView>
+    </Grid>
+</Page>

+ 98 - 0
DailyPlanner/CalendarPage.xaml.cs

@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для CalendarPage.xaml
+    /// </summary>
+    public partial class CalendarPage : Page
+    {
+        int currentPage = DateTime.Today.Month;
+        int itemsOnPage = 1;
+        int maxPages = 0;
+        public int UserID { get; set; }
+        List<Month> Month = new List<Month>();
+        public CalendarPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+            DateTime dateTime = new DateTime(DateTime.Today.Year, 1,1);
+            for(int i = 1; i <= 12; i++)
+            {
+                Month.Add(new Month { NameMonth = dateTime.ToString("MMMM", new CultureInfo("ru-RU")), NumberMonth = dateTime.Month });
+                dateTime = dateTime.AddMonths(1);
+                ShowMount();
+            }
+        }
+
+        public void ShowDay()
+        {
+            List<Task> TaskofMonth = new List<Task>();
+            int CurrentMonth = currentPage;
+            DateTime dateofmonth = new DateTime(DateTime.Today.Year, CurrentMonth, 1);
+            while(dateofmonth.Month == CurrentMonth)
+            {
+                Task FindTask = DB.db.Task.FirstOrDefault(item => item.IDUser == UserID && item.DateOfTask == dateofmonth);
+                if(FindTask != null)
+                {
+                    TaskofMonth.Add(FindTask);
+                }
+                else
+                {
+                    TaskofMonth.Add(new Task { DateOfTask = dateofmonth });
+                }
+                dateofmonth = dateofmonth.AddDays(1);
+            }
+            DayOfMonthList.ItemsSource = TaskofMonth;
+        }
+        //Пагинация по списку месяцев
+        public void ShowMount()
+        {
+            maxPages = (int)Math.Ceiling((decimal)Month.Count() / itemsOnPage);
+            ListMonth.ItemsSource = Month.Skip((currentPage - 1) * itemsOnPage).Take(itemsOnPage).ToList();
+            ShowDay();
+        }
+
+        private void TxtToLeft_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (currentPage > 1)
+            {
+                currentPage--;
+            }
+            else
+            {
+                currentPage = maxPages;
+            }
+            ShowMount();
+        }
+
+        private void TxtToRight_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+
+            if (currentPage != maxPages)
+            {
+                currentPage++;
+
+            }
+            else if (currentPage == maxPages)
+            {
+                currentPage = 1;
+            }
+            ShowMount();
+        }
+    }
+}

+ 20 - 0
DailyPlanner/ConvertImageToByte.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DailyPlanner
+{
+    //Класс для перевода Изображения в массив byte
+    class ConvertImageToByte
+    {
+        public static byte[] ImageToByte(string Path)
+        {
+            byte[] image;
+            image = File.ReadAllBytes(Path);
+            return image;
+        }
+    }
+}

+ 14 - 0
DailyPlanner/DB.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DailyPlanner
+{
+    //Класс для с строкой подключения бд
+    class DB
+    {
+        public static DailyPlannerEntities db = new DailyPlannerEntities();
+    }
+}

+ 31 - 0
DailyPlanner/DailyPlanner.Context.cs

@@ -0,0 +1,31 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DailyPlanner
+{
+    using System;
+    using System.Data.Entity;
+    using System.Data.Entity.Infrastructure;
+    
+    public partial class DailyPlannerEntities : DbContext
+    {
+        public DailyPlannerEntities()
+            : base("name=DailyPlannerEntities")
+        {
+        }
+    
+        protected override void OnModelCreating(DbModelBuilder modelBuilder)
+        {
+            throw new UnintentionalCodeFirstException();
+        }
+    
+        public virtual DbSet<Task> Task { get; set; }
+        public virtual DbSet<User> User { get; set; }
+    }
+}

+ 636 - 0
DailyPlanner/DailyPlanner.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 = @"DailyPlanner.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
DailyPlanner/DailyPlanner.Designer.cs

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

+ 9 - 0
DailyPlanner/DailyPlanner.cs

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

+ 226 - 0
DailyPlanner/DailyPlanner.csproj

@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <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>{1F251EB0-649B-4DB4-9278-041FBD839301}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>DailyPlanner</RootNamespace>
+    <AssemblyName>DailyPlanner</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</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>
+  </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.2.0\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.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationFramework.Aero2" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
+    <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="AddTaskPage.xaml.cs">
+      <DependentUpon>AddTaskPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CalendarPage.xaml.cs">
+      <DependentUpon>CalendarPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ConvertImageToByte.cs" />
+    <Compile Include="DailyPlanner.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DailyPlanner.tt</DependentUpon>
+    </Compile>
+    <Compile Include="EditUserPage.xaml.cs">
+      <DependentUpon>EditUserPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="EditUserPanelPage.xaml.cs">
+      <DependentUpon>EditUserPanelPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Month.cs" />
+    <Compile Include="PanelPage.xaml.cs">
+      <DependentUpon>PanelPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RegistrationPage.xaml.cs">
+      <DependentUpon>RegistrationPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RegistrationPanelPage.xaml.cs">
+      <DependentUpon>RegistrationPanelPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ShowTaskPage.xaml.cs">
+      <DependentUpon>ShowTaskPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="StringFormatState.cs" />
+    <Compile Include="Task.cs">
+      <DependentUpon>DailyPlanner.tt</DependentUpon>
+    </Compile>
+    <Compile Include="TaskPartial.cs" />
+    <Compile Include="User.cs">
+      <DependentUpon>DailyPlanner.tt</DependentUpon>
+    </Compile>
+    <Compile Include="UserPartial.cs" />
+    <Page Include="AddTaskPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="AuthorizationPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="CalendarPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="EditUserPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="EditUserPanelPage.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="AuthorizationPage.xaml.cs">
+      <DependentUpon>AuthorizationPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DailyPlanner.Context.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DailyPlanner.Context.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DailyPlanner.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DailyPlanner.edmx</DependentUpon>
+    </Compile>
+    <Compile Include="DB.cs" />
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="PanelPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="RegistrationPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="RegistrationPanelPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ShowTaskPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ManagerFrame.cs" />
+    <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="DailyPlanner.edmx">
+      <Generator>EntityModelCodeGenerator</Generator>
+      <LastGenOutput>DailyPlanner.Designer.cs</LastGenOutput>
+    </EntityDeploy>
+    <None Include="DailyPlanner.edmx.diagram">
+      <DependentUpon>DailyPlanner.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>
+    <Content Include="DailyPlanner.Context.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DailyPlanner.Context.cs</LastGenOutput>
+      <DependentUpon>DailyPlanner.edmx</DependentUpon>
+    </Content>
+    <Content Include="DailyPlanner.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>DailyPlanner.edmx</DependentUpon>
+      <LastGenOutput>DailyPlanner.cs</LastGenOutput>
+    </Content>
+    <Resource Include="Resources\notepad-vector-icon.png" />
+    <Resource Include="Resources\DefaultImage.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 192 - 0
DailyPlanner/DailyPlanner.edmx

@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
+  <!-- EF Runtime content -->
+  <edmx:Runtime>
+    <!-- SSDL content -->
+    <edmx:StorageModels>
+      <Schema Namespace="Хранилище DailyPlannerModel" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
+        <EntityType Name="Task">
+          <Key>
+            <PropertyRef Name="TaskID" />
+          </Key>
+          <Property Name="TaskID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="NameTask" Type="nvarchar(max)" Nullable="false" />
+          <Property Name="IDUser" Type="int" Nullable="false" />
+          <Property Name="IDMainTask" Type="int" />
+          <Property Name="DateOfTask" Type="date" />
+          <Property Name="TimeOfTask" Type="time" Precision="7" />
+          <Property Name="State" Type="bit" />
+          <Property Name="Description" Type="nvarchar(max)" />
+          <Property Name="Image" Type="image" />
+        </EntityType>
+        <EntityType Name="User">
+          <Key>
+            <PropertyRef Name="UserID" />
+          </Key>
+          <Property Name="UserID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="RealName" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Photo" Type="image" />
+        </EntityType>
+        <Association Name="FK_Task_Task">
+          <End Role="Task" Type="Self.Task" Multiplicity="0..1" />
+          <End Role="Task1" Type="Self.Task" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Task">
+              <PropertyRef Name="TaskID" />
+            </Principal>
+            <Dependent Role="Task1">
+              <PropertyRef Name="IDMainTask" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_Task_User">
+          <End Role="User" Type="Self.User" Multiplicity="1" />
+          <End Role="Task" Type="Self.Task" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="User">
+              <PropertyRef Name="UserID" />
+            </Principal>
+            <Dependent Role="Task">
+              <PropertyRef Name="IDUser" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <EntityContainer Name="Хранилище DailyPlannerModelContainer">
+          <EntitySet Name="Task" EntityType="Self.Task" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="User" EntityType="Self.User" Schema="dbo" store:Type="Tables" />
+          <AssociationSet Name="FK_Task_Task" Association="Self.FK_Task_Task">
+            <End Role="Task" EntitySet="Task" />
+            <End Role="Task1" EntitySet="Task" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Task_User" Association="Self.FK_Task_User">
+            <End Role="User" EntitySet="User" />
+            <End Role="Task" EntitySet="Task" />
+          </AssociationSet>
+        </EntityContainer>
+      </Schema>
+    </edmx:StorageModels>
+    <!-- CSDL content -->
+    <edmx:ConceptualModels>
+      <Schema Namespace="DailyPlannerModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
+        <EntityType Name="Task">
+          <Key>
+            <PropertyRef Name="TaskID" />
+          </Key>
+          <Property Name="TaskID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="NameTask" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="IDUser" Type="Int32" Nullable="false" />
+          <Property Name="IDMainTask" Type="Int32" />
+          <Property Name="DateOfTask" Type="DateTime" Precision="0" />
+          <Property Name="TimeOfTask" Type="Time" Precision="7" />
+          <Property Name="State" Type="Boolean" />
+          <Property Name="Description" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
+          <Property Name="Image" Type="Binary" MaxLength="Max" FixedLength="false" />
+          <NavigationProperty Name="Task1" Relationship="Self.FK_Task_Task" FromRole="Task" ToRole="Task1" />
+          <NavigationProperty Name="Task2" Relationship="Self.FK_Task_Task" FromRole="Task1" ToRole="Task" />
+          <NavigationProperty Name="User" Relationship="Self.FK_Task_User" FromRole="Task" ToRole="User" />
+        </EntityType>
+        <EntityType Name="User">
+          <Key>
+            <PropertyRef Name="UserID" />
+          </Key>
+          <Property Name="UserID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="RealName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Login" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Photo" Type="Binary" MaxLength="Max" FixedLength="false" />
+          <NavigationProperty Name="Task" Relationship="Self.FK_Task_User" FromRole="User" ToRole="Task" />
+        </EntityType>
+        <Association Name="FK_Task_Task">
+          <End Role="Task" Type="Self.Task" Multiplicity="0..1" />
+          <End Role="Task1" Type="Self.Task" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Task">
+              <PropertyRef Name="TaskID" />
+            </Principal>
+            <Dependent Role="Task1">
+              <PropertyRef Name="IDMainTask" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_Task_User">
+          <End Role="User" Type="Self.User" Multiplicity="1" />
+          <End Role="Task" Type="Self.Task" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="User">
+              <PropertyRef Name="UserID" />
+            </Principal>
+            <Dependent Role="Task">
+              <PropertyRef Name="IDUser" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <EntityContainer Name="DailyPlannerEntities" annotation:LazyLoadingEnabled="true">
+          <EntitySet Name="Task" EntityType="Self.Task" />
+          <EntitySet Name="User" EntityType="Self.User" />
+          <AssociationSet Name="FK_Task_Task" Association="Self.FK_Task_Task">
+            <End Role="Task" EntitySet="Task" />
+            <End Role="Task1" EntitySet="Task" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Task_User" Association="Self.FK_Task_User">
+            <End Role="User" EntitySet="User" />
+            <End Role="Task" EntitySet="Task" />
+          </AssociationSet>
+        </EntityContainer>
+      </Schema>
+    </edmx:ConceptualModels>
+    <!-- C-S mapping content -->
+    <edmx:Mappings>
+      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
+        <EntityContainerMapping StorageEntityContainer="Хранилище DailyPlannerModelContainer" CdmEntityContainer="DailyPlannerEntities">
+          <EntitySetMapping Name="Task">
+            <EntityTypeMapping TypeName="DailyPlannerModel.Task">
+              <MappingFragment StoreEntitySet="Task">
+                <ScalarProperty Name="TaskID" ColumnName="TaskID" />
+                <ScalarProperty Name="NameTask" ColumnName="NameTask" />
+                <ScalarProperty Name="IDUser" ColumnName="IDUser" />
+                <ScalarProperty Name="IDMainTask" ColumnName="IDMainTask" />
+                <ScalarProperty Name="DateOfTask" ColumnName="DateOfTask" />
+                <ScalarProperty Name="TimeOfTask" ColumnName="TimeOfTask" />
+                <ScalarProperty Name="State" ColumnName="State" />
+                <ScalarProperty Name="Description" ColumnName="Description" />
+                <ScalarProperty Name="Image" ColumnName="Image" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="User">
+            <EntityTypeMapping TypeName="DailyPlannerModel.User">
+              <MappingFragment StoreEntitySet="User">
+                <ScalarProperty Name="UserID" ColumnName="UserID" />
+                <ScalarProperty Name="RealName" ColumnName="RealName" />
+                <ScalarProperty Name="Login" ColumnName="Login" />
+                <ScalarProperty Name="Password" ColumnName="Password" />
+                <ScalarProperty Name="Photo" ColumnName="Photo" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+        </EntityContainerMapping>
+      </Mapping>
+    </edmx:Mappings>
+  </edmx:Runtime>
+  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
+  <Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
+    <Connection>
+      <DesignerInfoPropertySet>
+        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
+      </DesignerInfoPropertySet>
+    </Connection>
+    <Options>
+      <DesignerInfoPropertySet>
+        <DesignerProperty Name="ValidateOnBuild" Value="true" />
+        <DesignerProperty Name="EnablePluralization" Value="false" />
+        <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
+        <DesignerProperty Name="UseLegacyProvider" Value="false" />
+        <DesignerProperty Name="CodeGenerationStrategy" Value="Нет" />
+      </DesignerInfoPropertySet>
+    </Options>
+    <!-- Diagram content (shape and connector positions) -->
+    <Diagrams></Diagrams>
+  </Designer>
+</edmx:Edmx>

+ 15 - 0
DailyPlanner/DailyPlanner.edmx.diagram

@@ -0,0 +1,15 @@
+<?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="ab52cad546144c69a577e49b9b274df1" Name="Diagram1">
+        <EntityTypeShape EntityType="DailyPlannerModel.Task" Width="1.5" PointX="3" PointY="1" IsExpanded="true" />
+        <EntityTypeShape EntityType="DailyPlannerModel.User" Width="1.5" PointX="0.75" PointY="1.625" IsExpanded="true" />
+        <AssociationConnector Association="DailyPlannerModel.FK_Task_Task" ManuallyRouted="false" />
+        <AssociationConnector Association="DailyPlannerModel.FK_Task_User" ManuallyRouted="false" />
+      </Diagram>
+    </edmx:Diagrams>
+  </edmx:Designer>
+</edmx:Edmx>

+ 733 - 0
DailyPlanner/DailyPlanner.tt

@@ -0,0 +1,733 @@
+<#@ template language="C#" debug="false" hostspecific="true"#>
+<#@ include file="EF6.Utility.CS.ttinclude"#><#@ 
+ output extension=".cs"#><#
+
+const string inputFile = @"DailyPlanner.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);
+    }
+}
+#>

+ 60 - 0
DailyPlanner/EditUserPage.xaml

@@ -0,0 +1,60 @@
+<Page x:Class="DailyPlanner.EditUserPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Изменение пользователя">
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition Height="80"/>
+        </Grid.RowDefinitions>
+        <TextBlock Text="Фото пользователя" HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Center"></TextBlock>
+        <StackPanel>
+            <ItemsControl x:Name="UserAvatar" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center">
+                <ItemsControl.ItemTemplate>
+                    <DataTemplate>
+                        <Grid x:Name="ImageGrid" MouseDown="ImageGrid_MouseDown">
+                            <Button Name="BtnDeletePhoto" Content="✗" Height="50" Width="50" HorizontalAlignment="Right" Click="BtnDeletePhoto_Click" VerticalAlignment="Top" Grid.Column="1" Panel.ZIndex="1"></Button>
+                            <Border BorderBrush="#BFEE8756" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="2" Background="Transparent" Height="400" Width="400">
+                                <Image Source="{Binding Avatar}" Height="450" Width="400"></Image>
+                            </Border>
+                        </Grid>
+                    </DataTemplate>
+                </ItemsControl.ItemTemplate>
+            </ItemsControl>
+        </StackPanel>
+        <CheckBox x:Name="ChangePassword" HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Top" VerticalContentAlignment="Center" Checked="ChangePassword_Checked" Unchecked="ChangePassword_Unchecked" Margin="0,0,20,0">
+            <TextBlock Text="Сменить пароль" FontSize="50"></TextBlock>
+        </CheckBox>
+        <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Имя" Margin="0,0,80,0" FontSize="50"></TextBlock>
+                <TextBox Name="TxtName"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Логин" Margin="0,0,40,0" FontSize="50"></TextBlock>
+                <TextBox Name="TxtLogin"></TextBox>
+            </StackPanel>
+            <StackPanel Name="PasswordStack" Visibility="Collapsed">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Text="Старый пароль" Margin="0,0,20,0" FontSize="50"></TextBlock>
+                    <PasswordBox Name="PxbOldPassword"></PasswordBox>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Text="Новый пароль" Margin="0,0,50,0" FontSize="50"></TextBlock>
+                    <PasswordBox Name="PxbNewPassword"></PasswordBox>
+                </StackPanel>
+            </StackPanel>
+        </StackPanel>
+        <Button Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Content="Изменение" Name="BtnEditUser" Click="BtnEditUser_Click"></Button>
+    </Grid>
+</Page>

+ 145 - 0
DailyPlanner/EditUserPage.xaml.cs

@@ -0,0 +1,145 @@
+using Microsoft.Win32;
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для EditUserPage.xaml
+    /// </summary>
+    public partial class EditUserPage : Page
+    {
+        public int UserID { get; set; }
+        //Переменная для хранения пути к изображению
+        string FilePath = string.Empty;
+        public EditUserPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+            User SelectedUser = DB.db.User.SingleOrDefault(item => item.UserID == UserID);
+            TxtName.Text = SelectedUser.RealName;
+            TxtLogin.Text = SelectedUser.Login;
+            UserAvatar.ItemsSource = DB.db.User.Where(item => item.UserID == UserID).ToList();
+        }
+
+        //Изменение изображения пользователя
+        private void ImageGrid_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            if (openFileDialog.ShowDialog() == true)
+            {
+                FilePath = openFileDialog.FileName;
+                User user = DB.db.User.Find(UserID);
+                if (FilePath != string.Empty)
+                {
+                    user.Photo = ConvertImageToByte.ImageToByte(FilePath);
+                }
+                DB.db.SaveChanges();
+                UserAvatar.ItemsSource = DB.db.User.Where(item => item.UserID == UserID).ToList();
+            }
+            else
+            {
+                FilePath = string.Empty;
+            }
+        }
+        //Функция редактирования пользователя
+        public bool EditUser(string Name, string Login, string OldPassword, string NewPassword)
+        {
+            User user = DB.db.User.Find(UserID);
+            if (ChangePassword.IsChecked == true)
+            {
+                if (Name == string.Empty || Login == string.Empty || OldPassword == string.Empty || NewPassword == string.Empty)
+                {
+                    MessageBox.Show("Ключевые поля не заполнены");
+                    return false;
+                }
+                else
+                {
+                    if (DB.db.User.FirstOrDefault(item => item.UserID != UserID && item.Login.Contains(Login))!=null)
+                    {
+                        MessageBox.Show("Логин занят");
+                        return false;
+                    }
+                    else if (OldPassword != user.Password)
+                    {
+                        MessageBox.Show("Неверно указан старый пароль");
+                        return false;
+                    }
+                    else if (NewPassword.Length <= 8)
+                    {
+                        MessageBox.Show("Пароль слишком короткий");
+                        return false;
+                    }
+                    else
+                    {
+                        user.RealName = Name;
+                        user.Login = Login;
+                        user.Password = NewPassword;
+                        DB.db.SaveChanges();
+                        MessageBox.Show("Изменено!");
+                        return true;
+                    }
+                }
+            }
+            else
+            {
+                if (Name == string.Empty || Login == string.Empty)
+                {
+                    MessageBox.Show("Ключевые поля не заполнены");
+                    return false;
+                }
+                else
+                {
+                    if (DB.db.User.Select(item => item.Login).Contains(Login))
+                    {
+                        MessageBox.Show("Логин занят");
+                        return false;
+                    }
+                    else
+                    {
+                        user.RealName = Name;
+                        user.Login = Login;
+                        DB.db.SaveChanges();
+                        return true;
+                    }
+                }
+            }
+        }
+
+        private void BtnEditUser_Click(object sender, RoutedEventArgs e)
+        {
+            EditUser(TxtName.Text, TxtLogin.Text, PxbOldPassword.Password, PxbNewPassword.Password);
+        }
+
+        private void ChangePassword_Checked(object sender, RoutedEventArgs e)
+        {
+            PasswordStack.Visibility = Visibility.Visible;
+        }
+
+        private void ChangePassword_Unchecked(object sender, RoutedEventArgs e)
+        {
+            PasswordStack.Visibility = Visibility.Collapsed;
+        }
+
+        //Удаление фото пользователя
+        private void BtnDeletePhoto_Click(object sender, RoutedEventArgs e)
+        {
+            User user = DB.db.User.Find(UserID);
+            user.Photo = null;
+            DB.db.SaveChanges();
+            UserAvatar.ItemsSource = DB.db.User.Where(item => item.UserID == UserID).ToList();
+        }
+    }
+}

+ 14 - 0
DailyPlanner/EditUserPanelPage.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="DailyPlanner.EditUserPanelPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="EditUserPanelPage">
+
+    <Grid>
+        <Button x:Name="BtnBack" Content="Назад" Click="BtnBack_Click" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0"></Button>
+    </Grid>
+</Page>

+ 36 - 0
DailyPlanner/EditUserPanelPage.xaml.cs

@@ -0,0 +1,36 @@
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для EditUserPanelPage.xaml
+    /// </summary>
+    public partial class EditUserPanelPage : Page
+    {
+        public int UserID { get; set; }
+        public EditUserPanelPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+        }
+
+        private void BtnBack_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.PanelFrame.Navigate(new PanelPage(UserID));
+            ManagerFrame.MainFrame.Navigate(new ShowTaskPage(UserID));
+        }
+    }
+}

+ 17 - 0
DailyPlanner/MainWindow.xaml

@@ -0,0 +1,17 @@
+<Window x:Class="DailyPlanner.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:DailyPlanner"
+        mc:Ignorable="d"
+        Title="{Binding ElementName=MainFrame, Path=Content.Title}" Height="800" Width="1200" Background="#FF2D2D30" WindowStartupLocation="CenterScreen" Icon="Resources/notepad-vector-icon.png" BorderBrush="#BFF1AD8D">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="110"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Frame x:Name="PanelFrame" NavigationUIVisibility="Hidden" Visibility="Collapsed"></Frame>
+        <Frame Grid.Row="1" Name="MainFrame" NavigationUIVisibility="Hidden"/>
+    </Grid>
+</Window>

+ 32 - 0
DailyPlanner/MainWindow.xaml.cs

@@ -0,0 +1,32 @@
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+            //Привязка фремов для навигации
+            ManagerFrame.MainFrame = this.MainFrame;
+            ManagerFrame.PanelFrame = this.PanelFrame;
+            ManagerFrame.MainFrame.Navigate(new AuthorizationPage());
+        }
+    }
+}

+ 16 - 0
DailyPlanner/ManagerFrame.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace DailyPlanner
+{
+    //Класс для навигации
+    class ManagerFrame
+    {
+        public static Frame MainFrame;
+        public static Frame PanelFrame;
+    }
+}

+ 15 - 0
DailyPlanner/Month.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DailyPlanner
+{
+    //Класс для представления месяцев
+    class Month
+    {
+        public string NameMonth { get; set; }
+        public int NumberMonth { get; set; }
+    }
+}

+ 31 - 0
DailyPlanner/PanelPage.xaml

@@ -0,0 +1,31 @@
+<Page x:Class="DailyPlanner.PanelPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="PanelPage">
+
+    <Grid>
+
+        <StackPanel Orientation="Horizontal" Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center">
+            <ItemsControl x:Name="UserAvatar" MouseDown="UserAvatar_MouseDown" Background="Transparent" BorderThickness="0" Height="100" Width="100" Margin="0,5,20,5" HorizontalContentAlignment="Center">
+                <ItemsControl.ItemTemplate>
+                    <DataTemplate>
+                        <StackPanel Orientation="Vertical">
+                            <Border BorderBrush="#BFEE8756" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="2" Background="Transparent">
+                                <Image Height="90" Width="80" Source="{Binding Avatar}"></Image>
+                            </Border>
+                        </StackPanel>
+                    </DataTemplate>
+                </ItemsControl.ItemTemplate>
+            </ItemsControl>
+            <Button x:Name="BtnAddTask" Width="260" Content="Добавление задач" Click="BtnAddTask_Click" Margin="0,0,20,0"></Button>
+            <Button x:Name="BtnShowTask" Width="200" Content="Список задач" Click="BtnShowTask_Click" Margin="0,0,20,0" ></Button>
+            <Button x:Name="BtnShowCalendar" Width="200" Content="Календарь" Click="BtnShowCalendar_Click" Margin="0,0,20,0"></Button>
+        </StackPanel>
+        <Button x:Name="BtnExit" Content="Выход" Width="150" Click="BtnExit_Click" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,20,0"></Button>
+    </Grid>
+</Page>

+ 62 - 0
DailyPlanner/PanelPage.xaml.cs

@@ -0,0 +1,62 @@
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для PanelPage.xaml
+    /// </summary>
+    public partial class PanelPage : Page
+    {
+        //Меню выбора страниц
+        public int UserID{ get; set; }
+        public PanelPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+            UserAvatar.ItemsSource = DB.db.User.Where(item => item.UserID == UserID).ToList();
+        }
+
+        private void BtnAddTask_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.Navigate(new AddTaskPage(UserID));
+        }
+
+        private void BtnShowTask_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.Navigate(new ShowTaskPage(UserID));
+        }
+
+        private void BtnShowCalendar_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.Navigate(new CalendarPage(UserID));
+        }
+
+        private void BtnExit_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.PanelFrame.Visibility = Visibility.Collapsed;
+            while (ManagerFrame.MainFrame.CanGoBack)
+            {
+                ManagerFrame.MainFrame.GoBack();
+            }
+        }
+
+        private void UserAvatar_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            ManagerFrame.PanelFrame.Navigate(new EditUserPanelPage(UserID));
+            ManagerFrame.MainFrame.Navigate(new EditUserPage(UserID));
+        }
+    }
+}

+ 55 - 0
DailyPlanner/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("DailyPlanner")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DailyPlanner")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[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")]

+ 83 - 0
DailyPlanner/Properties/Resources.Designer.cs

@@ -0,0 +1,83 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DailyPlanner.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("DailyPlanner.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;
+            }
+        }
+        
+        /// <summary>
+        ///   Поиск локализованного ресурса типа System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap DefaultImage {
+            get {
+                object obj = ResourceManager.GetObject("DefaultImage", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   Поиск локализованного ресурса типа System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap notepad_vector_icon {
+            get {
+                object obj = ResourceManager.GetObject("notepad_vector_icon", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}

+ 127 - 0
DailyPlanner/Properties/Resources.resx

@@ -0,0 +1,127 @@
+<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <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" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </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" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="DefaultImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\DefaultImage.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="notepad_vector_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\notepad-vector-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

+ 30 - 0
DailyPlanner/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DailyPlanner.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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
DailyPlanner/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>

+ 45 - 0
DailyPlanner/RegistrationPage.xaml

@@ -0,0 +1,45 @@
+<Page x:Class="DailyPlanner.RegistrationPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Регистрация">
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition Height="80"/>
+        </Grid.RowDefinitions>
+        <TextBlock Text="Фото пользователя" HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Center"></TextBlock>
+        <Grid x:Name="ImageGrid" MouseDown="ImageGrid_MouseDown">
+            <Button Name="BtnDeletePhoto" Content="✗" Height="50" Width="50" HorizontalAlignment="Right" Click="BtnDeletePhoto_Click" VerticalAlignment="Top" Grid.Column="1" Panel.ZIndex="1" Margin="40"></Button>
+            <Border BorderBrush="#BFEE8756" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="2" Background="Transparent" Panel.ZIndex="1" Height="400" Width="400">
+                <Image x:Name="PhotoOfClent" Height="450" Width="400"></Image>
+            </Border>
+            <TextBlock Text="Добавить изображение" HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="0"></TextBlock>
+        </Grid>
+        <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
+
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Имя" Margin="0,0,80,0" FontSize="50"></TextBlock>
+                <TextBox Name="TxtName"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Логин" Margin="0,0,40,0" FontSize="50"></TextBlock>
+                <TextBox Name="TxtLogin"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Text="Пароль" Margin="0,0,20,0" FontSize="50"></TextBlock>
+                <PasswordBox Name="PxbPassword"></PasswordBox>
+            </StackPanel>
+        </StackPanel>
+        <Button Grid.Row="1" Grid.ColumnSpan="2" Width="300" VerticalAlignment="Top" Content="Зарегистрироваться" Name="BtnRegistration" Click="BtnRegistration_Click"></Button>
+    </Grid>
+</Page>

+ 103 - 0
DailyPlanner/RegistrationPage.xaml.cs

@@ -0,0 +1,103 @@
+using Microsoft.Win32;
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для RegistrationPage.xaml
+    /// </summary>
+    public partial class RegistrationPage : Page
+    {
+        //Переменная для хранения пути к изображению
+        string FilePath = string.Empty;
+        public RegistrationPage()
+        {
+            InitializeComponent();
+        }
+        //Добавление изображения пользователя
+        private void ImageGrid_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            if (openFileDialog.ShowDialog() == true)
+            {
+                FilePath = openFileDialog.FileName;
+                string uriString = $"{FilePath}";
+                PhotoOfClent.Source = new BitmapImage(new Uri(@uriString));
+            }
+            else
+            {
+                FilePath = string.Empty;
+            }
+        }
+
+        private void BtnRegistration_Click(object sender, RoutedEventArgs e)
+        {
+            RegistrationClient(TxtName.Text, TxtLogin.Text, PxbPassword.Password, FilePath);
+        }
+
+        //Регистрация пользователя
+        public bool RegistrationClient(string Name, string Login, string Password,string FilePath)
+        {
+            if (Name == string.Empty || Login == string.Empty || Password == string.Empty)
+            {
+                MessageBox.Show("Ключевые поля не заполнены");
+                return false;
+            }
+            else
+            {
+                if (DB.db.User.Select(item => item.Login).Contains(Login))
+                {
+                    MessageBox.Show("Логин занят");
+                    return false;
+                }
+                else if (Password.Length<=8)
+                {
+                    MessageBox.Show("Пароль слишком короткий");
+                    return false;
+                }
+                else
+                {
+                    try
+                    {
+                        User user = new User();
+                        user.Login = Login;
+                        user.Password = Password;
+                        user.RealName = Name;
+                        if(FilePath != string.Empty)
+                        {
+                            user.Photo = ConvertImageToByte.ImageToByte(FilePath);
+                        }
+                        DB.db.User.Add(user);
+                        DB.db.SaveChanges();
+                        MessageBox.Show("Вы зарегестрированы!");
+                        return true;
+                    }
+                    catch
+                    {
+                        MessageBox.Show("Введено не корректное значение");
+                        return false;
+                    }
+                }
+            }
+        }
+
+        private void BtnDeletePhoto_Click(object sender, RoutedEventArgs e)
+        {
+            PhotoOfClent.Source = null;
+            FilePath = string.Empty;
+        }
+    }
+}

+ 14 - 0
DailyPlanner/RegistrationPanelPage.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="DailyPlanner.RegistrationPanelPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="RegistrationPanelPage">
+
+    <Grid>
+        <Button x:Name="BtnBack" Content="Назад" Click="BtnBack_Click" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0"></Button>
+    </Grid>
+</Page>

+ 34 - 0
DailyPlanner/RegistrationPanelPage.xaml.cs

@@ -0,0 +1,34 @@
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для RegistrationPanelPage.xaml
+    /// </summary>
+    public partial class RegistrationPanelPage : Page
+    {
+        public RegistrationPanelPage()
+        {
+            InitializeComponent();
+        }
+
+        private void BtnBack_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.PanelFrame.Visibility = Visibility.Collapsed;
+            ManagerFrame.MainFrame.GoBack();
+        }
+    }
+}

BIN
DailyPlanner/Resources/DefaultImage.jpg


BIN
DailyPlanner/Resources/notepad-vector-icon.png


+ 88 - 0
DailyPlanner/ShowTaskPage.xaml

@@ -0,0 +1,88 @@
+<Page x:Class="DailyPlanner.ShowTaskPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:DailyPlanner"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Список задач">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="80"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <CheckBox x:Name="OnlyCurrentTask" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Checked="OnlyCurrentTask_Checked" Unchecked="OnlyCurrentTask_Unchecked" Margin="20,0,0,0">
+            <TextBlock Text="Только актуальные"></TextBlock>
+        </CheckBox>
+        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,20,0" >
+            <TextBlock Text="Поиск: "></TextBlock>
+            <DatePicker Name="DaPSearchTask" SelectedDateChanged="DaPSearchTask_SelectedDateChanged"></DatePicker>
+        </StackPanel>
+        <DataGrid Panel.ZIndex="0" x:Name="ListMainTask" Grid.Row="1" CurrentCellChanged="ListMainTask_CurrentCellChanged" KeyUp="ListMainTask_KeyUp" >
+            <DataGrid.Columns>
+                <DataGridTextColumn Header="Название задачи" Binding="{Binding NameTask}"></DataGridTextColumn>
+                <DataGridTemplateColumn Header="Дата">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <DatePicker VerticalAlignment="Top" Name="DateMainTask" SelectedDateChanged="DateOfMainTask_SelectedDateChanged" SelectedDate="{Binding DateOfTask}" BorderBrush="Transparent"></DatePicker>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+                <DataGridTextColumn Header="Время"  Binding="{Binding TimeOfTask}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Описание"  Binding="{Binding Description}"></DataGridTextColumn>
+                <DataGridTemplateColumn Header="Изображение">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <Grid  MouseDown="TxtImageTask_MouseDown">
+                                <Image Source="{Binding Image}" Height="200" Width="200"></Image>
+                                <TextBlock x:Name="TxtImageOfMainTask" Foreground="#00000000"/>
+                            </Grid>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+                <DataGridComboBoxColumn Header="Выполнение" x:Name="CmbStateMainTask" SelectedValueBinding="{Binding State}" EditingElementStyle ="{StaticResource ComboBoxMainStyle}"></DataGridComboBoxColumn>
+            </DataGrid.Columns>
+            <DataGrid.RowDetailsTemplate >
+                <DataTemplate>
+                    <DataGrid x:Name="ListSubTask" ItemsSource="{Binding SubTask}" CurrentCellChanged="ListSubTask_CurrentCellChanged" KeyUp="ListSubTask_KeyUp" LoadingRow="ListSubTask_LoadingRow">
+                        <DataGrid.Columns>
+                            <DataGridTextColumn Header="Название подзадачи" Binding="{Binding NameTask}"></DataGridTextColumn>
+                            <DataGridTemplateColumn Header="Дата">
+                                <DataGridTemplateColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <DatePicker Name="DateOfSubTask" VerticalAlignment="Top" SelectedDateChanged="DateOfSubTask_SelectedDateChanged" SelectedDate="{Binding DateOfTask}" BorderBrush="Transparent"></DatePicker>
+                                    </DataTemplate>
+                                </DataGridTemplateColumn.CellTemplate>
+                            </DataGridTemplateColumn>
+                            <DataGridTextColumn Header="Время"  Binding="{Binding TimeOfTask}"></DataGridTextColumn>
+                            <DataGridTextColumn Header="Описание"  Binding="{Binding Description}"></DataGridTextColumn>
+                            <DataGridTemplateColumn Header="Изображение">
+                                <DataGridTemplateColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Grid MouseDown="TxtImageTask_MouseDown">
+                                            <Image Source="{Binding Image}" Height="200" Width="200"></Image>
+                                            <TextBlock x:Name="TxtImageOfSubTask" Foreground="#00000000"/>
+                                        </Grid>
+                                    </DataTemplate>
+                                </DataGridTemplateColumn.CellTemplate>
+                            </DataGridTemplateColumn>
+                            <DataGridComboBoxColumn Header="Выполнение" x:Name="CmbStateSubTask" DisplayMemberPath="StringState" SelectedValuePath="State"  SelectedValueBinding="{Binding State}" EditingElementStyle ="{StaticResource ComboBoxMainStyle}"></DataGridComboBoxColumn>
+                        </DataGrid.Columns>
+                    </DataGrid>
+                </DataTemplate>
+            </DataGrid.RowDetailsTemplate>
+        </DataGrid>
+        <Border x:Name="MessageArea" Grid.RowSpan="2" BorderBrush = "#FFD8A86E" BorderThickness="1"  Height="300" Width="350" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Visibility="Collapsed">
+            <Grid Background="#FF2D2D30" Height="300" Width="350" >
+                <Button Name="CloseMessage" Content="✗" Height="40" Width="40" HorizontalAlignment="Right" Click="CloseMessage_Click" VerticalAlignment="Top" ></Button>
+                <StackPanel VerticalAlignment="Center">
+                    <TextBlock Name="TxtMissedTask" Text="!Вы пропустили вчерашнюю задачу!" Visibility="Collapsed" TextAlignment="Center" TextWrapping="Wrap"></TextBlock>
+                    <TextBlock Name="TxtActualTask" Text="!На сегодня есть заланированные задачи!" TextAlignment="Center" Visibility="Collapsed" TextWrapping="Wrap"></TextBlock>
+                </StackPanel>
+            </Grid>
+        </Border>
+        
+    </Grid>
+</Page>

+ 205 - 0
DailyPlanner/ShowTaskPage.xaml.cs

@@ -0,0 +1,205 @@
+using Microsoft.Win32;
+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 DailyPlanner
+{
+    /// <summary>
+    /// Логика взаимодействия для ShowTaskPage.xaml
+    /// </summary>
+    public partial class ShowTaskPage : Page
+    {
+        public int UserID { get; set; }
+        //Переменная, которая укзывает, что необходимо удалить только подзадачу
+        public bool IsDeleteSubtask = false;
+        //Список с возможными состояними выполнения задачи
+        List<StringFormatState> StateList = new List<StringFormatState>();
+        string DateOfISO8601 = string.Empty;
+        string FilePath = string.Empty;
+        public ShowTaskPage(int iduser)
+        {
+            InitializeComponent();
+            UserID = iduser;
+            ShowTask();
+            //Отображение сообщения о актуальных или пропущенных задачах
+            DateTime Yesterday = DateTime.Today.AddDays(-1);
+            Task ActualTask = DB.db.Task.FirstOrDefault(item => item.DateOfTask == DateTime.Today && item.IDUser == UserID);
+            Task MissedTask = DB.db.Task.FirstOrDefault(item => item.DateOfTask == Yesterday && item.IDUser == UserID && item.State != true);
+            if(ActualTask!=null) 
+            {
+                MessageArea.Visibility = Visibility.Visible;
+                TxtActualTask.Visibility = Visibility.Visible;
+            }
+            if (MissedTask !=null)
+            {
+                MessageArea.Visibility = Visibility.Visible;
+                TxtMissedTask.Visibility = Visibility.Visible;
+            }
+            StateList.Add(new StringFormatState {StringState="Выполняется" , State = null});
+            StateList.Add(new StringFormatState {StringState="Выполнена" , State = true});
+            StateList.Add(new StringFormatState {StringState="Не выполнена" , State = false});
+            CmbStateMainTask.ItemsSource = StateList;
+            CmbStateMainTask.DisplayMemberPath = "StringState";
+            CmbStateMainTask.SelectedValuePath = "State";
+            
+        }
+
+        // Представление задач пользователя
+        public void ShowTask()
+        {
+            if (OnlyCurrentTask.IsChecked == true)
+            {
+                ListMainTask.ItemsSource = DB.db.Task.Where(item => item.IDUser == UserID && item.IDMainTask == null && (item.DateOfTask>=DateTime.Today || (item.DateOfTask==null && item.State!=true)) && item.DateOfTask.ToString().Contains(DateOfISO8601)).ToList();
+            }
+            else
+            {
+                ListMainTask.ItemsSource = DB.db.Task.Where(item => item.IDUser == UserID && item.IDMainTask == null && item.DateOfTask.ToString().Contains(DateOfISO8601)).ToList();
+            }
+
+        }
+        
+
+        private void DateOfMainTask_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var CurrentMainTask = (sender as DatePicker).DataContext as Task;
+            CurrentMainTask.DateOfTask = (sender as DatePicker).SelectedDate.GetValueOrDefault();
+            DB.db.SaveChanges();
+        }
+
+        private void DateOfSubTask_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var CurrentSubTask = (sender as DatePicker).DataContext as Task;
+            CurrentSubTask.DateOfTask = (sender as DatePicker).SelectedDate.GetValueOrDefault();
+            DB.db.SaveChanges();
+        }
+
+        private void ListMainTask_CurrentCellChanged(object sender, EventArgs e)
+        {
+            DB.db.SaveChanges();
+        }
+
+        private void ListSubTask_CurrentCellChanged(object sender, EventArgs e)
+        {
+            DB.db.SaveChanges();
+        }
+        
+        public bool DeleteTask(Task CurrentTask)
+        {
+            DB.db.Task.Remove(CurrentTask);
+            DB.db.SaveChanges();
+            return true;
+        }
+
+        private void ListSubTask_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Delete)
+            {
+                MessageBoxResult result = MessageBox.Show("Удалить?", "", MessageBoxButton.YesNo);
+                if (result == MessageBoxResult.Yes)
+                {
+                    Task CurrentTask = (sender as DataGrid).SelectedItem as Task;
+                    DeleteTask(CurrentTask);
+                    ShowTask();
+                    IsDeleteSubtask = true;
+                }
+            }
+        }
+
+        private void OnlyCurrentTask_Checked(object sender, RoutedEventArgs e)
+        {
+            ShowTask();
+        }
+
+        private void OnlyCurrentTask_Unchecked(object sender, RoutedEventArgs e)
+        {
+            ShowTask();
+        }
+
+        private void ListMainTask_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Delete && IsDeleteSubtask == false)
+            {
+                MessageBoxResult result = MessageBox.Show("Удалить?", "", MessageBoxButton.YesNo);
+                if (result == MessageBoxResult.Yes)
+                {
+                    Task CurrentTask = (sender as DataGrid).SelectedItem as Task;
+                    foreach(Task SubTask in CurrentTask.SubTask)
+                    {
+                        DeleteTask(SubTask);
+                    }
+                    DeleteTask(CurrentTask);
+                    ShowTask();
+                }
+            }
+            else
+            {
+                IsDeleteSubtask = false;
+            }
+        }
+        //конвертация даты в международный формат
+        private void DaPSearchTask_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (DaPSearchTask.Text != string.Empty)
+            {
+                DateOfISO8601 = DateTime.SpecifyKind((DateTime)DaPSearchTask.SelectedDate, DateTimeKind.Utc).ToString("yyyy-MM-dd");
+            }
+            else
+            {
+                DateOfISO8601 = string.Empty;
+            }
+            ShowTask();
+        }
+        //Привязка данных comboBox для генерируемой таблицы с подзадачами
+        private void ListSubTask_LoadingRow(object sender, DataGridRowEventArgs e)
+        {
+            var dataGrid = sender as DataGrid;
+            var comboBox = dataGrid.FindName("CmbStateSubTask") as DataGridComboBoxColumn;
+            comboBox.ItemsSource = StateList;
+         }
+
+        private void TxtImageTask_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            if (openFileDialog.ShowDialog() == true)
+            {
+                FilePath = openFileDialog.FileName;
+                Task СurrentTask = (sender as Grid).DataContext as Task;
+                Task Task = DB.db.Task.Find(СurrentTask.TaskID);
+                Task.Image = ConvertImageToByte.ImageToByte(FilePath);
+                DB.db.SaveChanges();
+                ShowTask();
+            }
+        }
+
+        private void TxtImageOfSubTask_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            if (openFileDialog.ShowDialog() == true)
+            {
+                FilePath = openFileDialog.FileName;
+                var СurrentTask = (sender as Grid).DataContext as Task;
+                Task Task = DB.db.Task.Find(СurrentTask.TaskID);
+                Task.Image = ConvertImageToByte.ImageToByte(FilePath);
+                DB.db.SaveChanges();
+                ShowTask();
+            }
+        }
+        //Отображение сообщения
+        private void CloseMessage_Click(object sender, RoutedEventArgs e)
+        {
+            MessageArea.Visibility = Visibility.Collapsed;
+        }
+    }
+}

+ 15 - 0
DailyPlanner/StringFormatState.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DailyPlanner
+{
+    //Класс для представления состояний в виде текста
+    public class StringFormatState
+    {
+        public string StringState { get; set; }
+        public bool? State { get; set; }
+    }
+}

+ 38 - 0
DailyPlanner/Task.cs

@@ -0,0 +1,38 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DailyPlanner
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class Task
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public Task()
+        {
+            this.Task1 = new HashSet<Task>();
+        }
+    
+        public int TaskID { get; set; }
+        public string NameTask { get; set; }
+        public int IDUser { get; set; }
+        public Nullable<int> IDMainTask { get; set; }
+        public Nullable<System.DateTime> DateOfTask { get; set; }
+        public Nullable<System.TimeSpan> TimeOfTask { get; set; }
+        public Nullable<bool> State { get; set; }
+        public string Description { get; set; }
+        public byte[] Image { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<Task> Task1 { get; set; }
+        public virtual Task Task2 { get; set; }
+        public virtual User User { get; set; }
+    }
+}

+ 62 - 0
DailyPlanner/TaskPartial.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace DailyPlanner
+{
+    //Частичный класс для задач
+    partial class Task
+    {
+        //Все подзадачи одной задачи
+       public List<Task> SubTask
+       {
+            get
+            {
+                return DB.db.Task.Where(item => item.IDMainTask == TaskID).ToList();
+            }
+       }
+        //Все задачи пользователя на день
+        public string AllTaskForDay
+        {
+            get
+            {
+                string AllTask = "";
+                List<Task> AllTaskList = DB.db.Task.Where(item => item.DateOfTask == DateOfTask && item.IDUser == IDUser).ToList();
+                if (AllTaskList.Count != 0)
+                {
+                    foreach (Task task in AllTaskList)
+                    {
+                        AllTask += task.NameTask;
+                        if (task.TimeOfTask != null)
+                        {
+                            AllTask += ": " + task.TimeOfTask.ToString();
+                        }
+                        AllTask += "\n";
+                    }
+                    AllTask = AllTask.Substring(0, AllTask.Length - 1);
+                }
+                return AllTask;
+            }
+        }
+        //Отображение задач в календаре
+        public Visibility VisibilityTaskList
+        {
+            get
+            {
+                List<Task> AllTaskList = DB.db.Task.Where(item => item.DateOfTask == DateOfTask && item.IDUser == IDUser).ToList();
+                if (AllTaskList.Count != 0)
+                {
+                    return Visibility.Visible;
+                }
+                else
+                {
+                    return Visibility.Collapsed;
+                }
+
+            }
+        }
+    }
+}

+ 32 - 0
DailyPlanner/User.cs

@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DailyPlanner
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class User
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public User()
+        {
+            this.Task = new HashSet<Task>();
+        }
+    
+        public int UserID { get; set; }
+        public string RealName { get; set; }
+        public string Login { get; set; }
+        public string Password { get; set; }
+        public byte[] Photo { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<Task> Task { get; set; }
+    }
+}

+ 28 - 0
DailyPlanner/UserPartial.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DailyPlanner
+{
+    //Частичный класс для пользователя
+   partial class User
+   {
+        //Применение стандартного изображение для пользователя без аватара
+        public object Avatar
+        {
+            get
+            {
+                if (Photo is null)
+                {
+                    return @"Resources/DefaultImage.jpg";
+                }
+                else
+                {
+                    return Photo;
+                }
+            }
+        }
+    }
+}

+ 5 - 0
DailyPlanner/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="6.2.0" targetFramework="net472" />
+  <package id="EntityFramework.ru" version="6.2.0" targetFramework="net472" />
+</packages>

+ 6 - 0
UnitTestDailyPlanner/App.Config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <connectionStrings>
+    <add name="DailyPlannerEntities" connectionString="metadata=res://*/DailyPlanner.csdl|res://*/DailyPlanner.ssdl|res://*/DailyPlanner.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DESKTOP-340BQJQ\SQLEXPRESS2;initial catalog=DailyPlanner;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+</configuration>

+ 20 - 0
UnitTestDailyPlanner/DailyPlannerTest.cs

@@ -0,0 +1,20 @@
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using DailyPlanner;
+namespace UnitTestDailyPlanner
+{
+    [TestClass]
+    public class DailyPlannerTest
+    {
+        [TestMethod]
+        public void AuthorizationTest()
+        {
+            AuthorizationPage authorizationPage = new AuthorizationPage();
+            App app = new App();
+            app.InitializeComponent();
+            Assert.IsFalse(authorizationPage.Autorization("", ""));
+            Assert.IsFalse(authorizationPage.Autorization("Tests123", "QWEasd123"));
+            Assert.IsTrue(authorizationPage.Autorization("Test", "QWEasd123"));
+        }
+    }
+}

+ 20 - 0
UnitTestDailyPlanner/Properties/AssemblyInfo.cs

@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestDailyPlanner")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestDailyPlanner")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("7e001747-2167-48ed-88f6-74f97506b484")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 92 - 0
UnitTestDailyPlanner/UnitTestDailyPlanner.csproj

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.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>{7E001747-2167-48ED-88F6-74F97506B484}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTestDailyPlanner</RootNamespace>
+    <AssemblyName>UnitTestDailyPlanner</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
+    <IsCodedUITest>False</IsCodedUITest>
+    <TestProjectType>UnitTest</TestProjectType>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <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' ">
+    <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.2.0\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.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DailyPlannerTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.Config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\DailyPlanner\DailyPlanner.csproj">
+      <Project>{1f251eb0-649b-4db4-9278-041fbd839301}</Project>
+      <Name>DailyPlanner</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
+  </Target>
+  <Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
+</Project>

+ 7 - 0
UnitTestDailyPlanner/packages.config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="6.2.0" targetFramework="net472" />
+  <package id="EntityFramework.ru" version="6.2.0" targetFramework="net472" />
+  <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
+  <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
+</packages>