MoskalenkoSergey 6 hónapja
szülő
commit
2438e4f502

+ 1 - 1
PP_Ven_MosS/App.config

@@ -9,7 +9,7 @@
   </startup>
   <connectionStrings>
 
-  <add name="PP_MininEntities" connectionString="metadata=res://*/ModelBase.Model1.csdl|res://*/ModelBase.Model1.ssdl|res://*/ModelBase.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=sql;initial catalog=PP_Minin;user id=43П;password=444444;multipleactiveresultsets=True;encrypt=True;trustservercertificate=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
+  <add name="PP_MininEntities" connectionString="metadata=res://*/ModelBase.Model1.csdl|res://*/ModelBase.Model1.ssdl|res://*/ModelBase.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ngknn.ru;initial catalog=PP_Minin;user id=43П;password=444444;multipleactiveresultsets=True;encrypt=True;trustservercertificate=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
   <entityFramework>
     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
       <parameters>

+ 27 - 11
PP_Ven_MosS/Pages/Acount.xaml

@@ -32,17 +32,33 @@
                 </ListView.ItemsPanel>
                 <ListView.ItemTemplate>
                     <DataTemplate>
-                        <Border Width="500" Height="150" BorderThickness="1" BorderBrush="Red">
-                            <StackPanel Orientation="Horizontal">
-                                <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Left">
-                                    <TextBlock Text="{Binding Surname}"/>
-                                    <TextBlock Text="{Binding Name}"/>
-                                    <TextBlock Text="{Binding Patronymic}"/>
-                                    <TextBlock Text="{Binding Post}"/>
-                                    <TextBlock Text="{Binding Phone_number}"/>
-                                    <TextBlock Text="{Binding Path=Role.Title_role}"/>
-                                    <TextBlock x:Name="cca" Text="{Binding Count_complete_app}" Visibility="Hidden"/>
-                                    <TextBlock x:Name="cce" Text="{Binding Count_complete_event}" Visibility="Hidden"/>
+                        <Border Width="500" BorderThickness="1" BorderBrush="Red">
+                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
+                                <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Center">
+                                    <GroupBox Height="40" Header="Фамилия" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Surname}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Имя" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Name}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Отчество" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Patronymic}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Должность" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Post}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Телефон" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Phone_number}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Роль" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Path=Role.Title_role}"/>
+                                    </GroupBox>
+                                    <GroupBox Name="cca" Height="40" Header="Кол-во выполненных служебных записок" BorderThickness="2" BorderBrush="#FF0000" Visibility="Hidden">
+                                        <TextBlock  Text="{Binding Count_complete_app}"/>
+                                    </GroupBox>
+                                    <GroupBox Name="cce" Height="40" Header="Кол-во проведенных мероприятий" BorderThickness="2" BorderBrush="#FF0000" Visibility="Hidden">
+                                        <TextBlock  Text="{Binding Count_complete_event}"/>
+                                    </GroupBox>
                                 </StackPanel>
                             </StackPanel>
                         </Border>

+ 6 - 1
PP_Ven_MosS/Pages/Acount.xaml.cs

@@ -30,7 +30,12 @@ namespace PP_Ven_MosS.Pages
             UserList.ItemsSource = Classes.Database.entities.User.ToList();
             CB_Filter_user.ItemsSource = new List<string> { "Роли", "Сотрудники", "Пользователи" };
             CB_Filter_user.SelectedIndex = 0;
-            
+            User user = Classes.Database.entities.User.FirstOrDefault();
+            if (user.Id_role == 2)
+            {
+                //cca.Visible = Visibility.Visible;
+                //cce.Visible = Visibility.Visible;
+            }
         }
 
         private void CB_Filter_user_SelectionChanged(object sender, SelectionChangedEventArgs e)

+ 24 - 9
PP_Ven_MosS/Pages/ApplicationsListAdmin.xaml

@@ -47,15 +47,30 @@
                 </ListView.ItemsPanel>
                 <ListView.ItemTemplate>
                     <DataTemplate>
-                        <Border Width="500" Height="120" BorderThickness="1" BorderBrush="Red">
-                            <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Left">
-                                <CheckBox Name="TF" Uid="{Binding Id_application}" Checked="TF_Checked"></CheckBox>
-                                <TextBlock Text="{Binding Date_app}"/>
-                                <TextBlock Text="{Binding Place_app}"/>
-                                <TextBlock Text="{Binding Path=Application_type.Title_app_type}"/>
-                                <TextBlock Text="{Binding Description}"/>
-                                <TextBlock Text="{Binding Path=User.Surname}"/>
-                                <TextBlock Text="{Binding Path=Status_application.Title_status_app}" FontWeight="Bold"/>
+                        <Border Width="500" Height="300" BorderThickness="1" BorderBrush="Red">
+                            <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Center">
+                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
+                                    <TextBlock Text="Отметить как выполнено "></TextBlock>
+                                    <CheckBox Name="TF" Uid="{Binding Id_application}" Checked="TF_Checked"></CheckBox>
+                                </StackPanel>
+                                <GroupBox Height="40" Header="Дата служебной записки" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Date_app}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Место" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Place_app}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Тип служебной записки" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=Application_type.Title_app_type}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Описание проблемы" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Description}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Фамилия" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=User.Surname}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Статус" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=Status_application.Title_status_app}" FontWeight="Bold"/>
+                                </GroupBox>
                             </StackPanel>
                         </Border>
                     </DataTemplate>

+ 3 - 2
PP_Ven_MosS/Pages/ApplicationsListAdmin.xaml.cs

@@ -119,9 +119,10 @@ namespace PP_Ven_MosS.Pages
         {
             CheckBox cb = (CheckBox)sender;
             int id = Convert.ToInt32(cb.Uid);
-            Applications applications = Classes.Database.entities.Applications.Where(x => x.Id_employee == UserID.userid).FirstOrDefault();
+            Applications applications = Classes.Database.entities.Applications.Where(x=>x.Id_application == id).FirstOrDefault();
             applications.Id_status_app = 1;
-            User user = Classes.Database.entities.User.FirstOrDefault();
+            Classes.Database.entities.SaveChanges();
+            User user = Classes.Database.entities.User.Where(x=>x.Id_user == applications.Id_employee).FirstOrDefault();
             user.Count_complete_app++;
             Classes.Database.entities.SaveChanges();
             FrameClass.MainFrame.Navigate(new ApplicationsListAdmin());

+ 20 - 9
PP_Ven_MosS/Pages/ApplicationsListUser.xaml

@@ -50,15 +50,26 @@
                 </ListView.ItemsPanel>
                 <ListView.ItemTemplate>
                     <DataTemplate>
-                        <Border Width="500" Height="100" BorderThickness="1" BorderBrush="Red">
-                            <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Left">
-                                <TextBlock Text="{Binding Date_app}"/>
-                                <TextBlock Text="{Binding Place_app}"/>
-                                <TextBlock Text="{Binding Path = Application_type.Title_app_type}"/>
-                                <TextBlock Text="{Binding Description}"/>
-                                <TextBlock Text="{Binding Path = User.Surname}"/>
-                                <TextBlock Text="{Binding Path = Status_application.Title_status_app}" FontWeight="Bold"/>
-                                
+                        <Border Width="500" Height="250" BorderThickness="1" BorderBrush="Red">
+                            <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Center">
+                                <GroupBox Height="40" Header="Дата служебной записки" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Date_app}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Место" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Place_app}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Тип служебной записки" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=Application_type.Title_app_type}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Описание проблемы" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Description}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Фамилия" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=User.Surname}"/>
+                                </GroupBox>
+                                <GroupBox Height="40" Header="Статус" BorderThickness="2" BorderBrush="#FF0000">
+                                    <TextBlock Text="{Binding Path=Status_application.Title_status_app}" FontWeight="Bold"/>
+                                </GroupBox>
                             </StackPanel>
                         </Border>
                     </DataTemplate>

+ 2 - 2
PP_Ven_MosS/Pages/Avtorization.xaml

@@ -23,9 +23,9 @@
             <Image Source="/Images/minin.png" Width="800" Height="150"></Image>
         </StackPanel>
         <Border Grid.Column="1" Grid.Row="1" BorderBrush="#FF0000" BorderThickness="4" CornerRadius="10">
-            <StackPanel Orientation="Vertical">
+            <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,0,100">
                 <TextBlock Text="Авторизация" Width="200" HorizontalAlignment="Center" FontWeight="Bold" FontSize="30" Margin="0,30,0,0"></TextBlock>
-                <GroupBox Header="Логин" FontSize="20" FontWeight="Bold" Style="{StaticResource GBSt}">
+                <GroupBox Header="Логин" FontSize="20" FontWeight="Bold" Style="{StaticResource GBSt}" Margin="0,20,0,0">
                     <TextBox Name="TBLog"></TextBox>
                 </GroupBox>
                 <GroupBox Header="Пароль" FontSize="20" FontWeight="Bold" Style="{StaticResource GBSt}">

+ 2 - 2
PP_Ven_MosS/Pages/Diagram.xaml

@@ -10,11 +10,11 @@
 
     <Grid x:Name="diagram">
         <Grid.RowDefinitions>
-            <RowDefinition></RowDefinition>
+            <RowDefinition ></RowDefinition>
             <RowDefinition Height="50"></RowDefinition>
         </Grid.RowDefinitions>
         <StackPanel Grid.Row="0" Name="dgm" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal"></StackPanel>
-        <StackPanel Grid.Row="0" Name="dgmu" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal"></StackPanel>
+        <StackPanel Grid.Row="0" Name="dgmu" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" Margin="0,250,0,0"></StackPanel>
         <StackPanel Grid.Row="1"  HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
             <Button Height="30" Content="Сохранить отчет" FontSize="20" Style="{StaticResource BtnSt}" Name="Save" Click="Button_Click" Margin="0,0,10,0"></Button>
             <Button Height="30" Content="Выйти" FontSize="20" Style="{StaticResource BtnSt}" Name="Exit" Click="Exit_Click"></Button>

+ 20 - 8
PP_Ven_MosS/Pages/MenuAdmin.xaml

@@ -53,15 +53,27 @@
                 </ListView.ItemsPanel>
                 <ListView.ItemTemplate>
                     <DataTemplate>
-                        <Border Width="500" Height="150" BorderThickness="1" BorderBrush="Red">
-                            <StackPanel Orientation="Horizontal">
-                                <StackPanel Margin="10,0,0,0" Width="300" Orientation="Vertical" HorizontalAlignment="Left">
+                        <Border Width="500" Height="300" BorderThickness="1" BorderBrush="Red">
+                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
+                                <StackPanel Margin="10,0,0,0" Width="300" Height="500" Orientation="Vertical" HorizontalAlignment="Center">
+                                    <GroupBox Height="40" Header="Дата служебной записки" BorderThickness="2" BorderBrush="#FF0000">
                                     <TextBlock Text="{Binding Date_app}"/>
-                                    <TextBlock Text="{Binding Place_app}"/>
-                                    <TextBlock Text="{Binding Path=Application_type.Title_app_type}"/>
-                                    <TextBlock Text="{Binding Description}"/>
-                                    <TextBlock Text="{Binding Path=User.Surname}"/>
-                                    <TextBlock Text="{Binding Path=Status_application.Title_status_app}" FontWeight="Bold"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Место" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Place_app}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Тип служебной записки" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Path=Application_type.Title_app_type}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Описание проблемы" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Description}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Фамилия" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Path=User.Surname}"/>
+                                    </GroupBox>
+                                    <GroupBox Height="40" Header="Статус" BorderThickness="2" BorderBrush="#FF0000">
+                                        <TextBlock Text="{Binding Path=Status_application.Title_status_app}" FontWeight="Bold"/>
+                                    </GroupBox>
                                     <GroupBox Header="Назначить исполнителя" FontSize="10" Style="{StaticResource GBSt}" HorizontalAlignment="Right">
                                         <ComboBox x:Name="CBEmpl" Height="20" Loaded="CBEmpl_Loaded" SelectionChanged="CBEmpl_SelectionChanged" Uid="{Binding Id_application}"/>
                                     </GroupBox>