shabanin.serzh@gmail.com 2 years ago
parent
commit
6ca7810184

+ 1 - 0
ShabaninDemoEkz/AddChanged.xaml

@@ -51,6 +51,7 @@
                 <TextBox x:Name="Prioriti" Text="{Binding Priority}"/>
             </GroupBox>
             <Button x:Name="SaveBtn" Content="Сохранить" FontSize="20" Margin="0 20 0 0" Click="SaveBtn_Click"/>
+  
             <Button x:Name="DelBtn" Content="Удалить" FontSize="20" Margin="0 20 0 0" Click="DelBtn_Click"/>
         </StackPanel>
 

+ 11 - 3
ShabaninDemoEkz/AddChanged.xaml.cs

@@ -40,7 +40,12 @@ namespace ShabaninDemoEkz
 
 
         }
-
+        public AddChanged()
+        {
+            InitializeComponent();
+            SaveBtn.Visibility = Visibility.Collapsed;
+            DelBtn.Visibility = Visibility.Collapsed;
+        }
         private void SaveBtn_Click(object sender, RoutedEventArgs e)
         {
 
@@ -55,8 +60,6 @@ namespace ShabaninDemoEkz
                         BaseConnect.BaseModel.SaveChanges();
                         MessageBox.Show("Изменения сохранены", "Сохранение изменений", MessageBoxButton.OK, MessageBoxImage.Information);
                     }
-
-
                 }
                 else
                 {
@@ -87,5 +90,10 @@ namespace ShabaninDemoEkz
                 MessageBox.Show("Ошибка удаления", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
             }
         }
+
+        private void SaveBtn1_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 1 - 0
ShabaninDemoEkz/Pages/AgentPage.xaml

@@ -68,6 +68,7 @@
                 <ComboBox Name="FilterCmb" SelectionChanged="FilterCmb_SelectionChanged"/>
             </GroupBox>
             <Button x:Name="ChangePrior" Content="Изменить приоритет на ..." Height="45" Visibility="Collapsed" Click="ChangePrior_Click"/>
+            <Button x:Name="AddAgent" Content="Добавить агента" Height="45" Click="AddAgent_Click"/>
         </StackPanel>
         <ListView x:Name="AgentList" ItemTemplate="{StaticResource ListAgentD}" Grid.ColumnSpan="2" Grid.Row="1" SelectionMode="Extended" SelectionChanged="AgentList_SelectionChanged" MouseDoubleClick="AgentList_MouseDoubleClick"/>
     </Grid>

+ 7 - 0
ShabaninDemoEkz/Pages/AgentPage.xaml.cs

@@ -135,5 +135,12 @@ namespace ShabaninDemoEkz
             VM = new VModel();
             Filter();
         }
+
+        private void AddAgent_Click(object sender, RoutedEventArgs e)
+        {
+            new AddChanged().ShowDialog();
+            VM = new VModel();
+            Filter();
+        }
     }
 }