Browse Source

Добавление окон добавление/редактирования

Валерия Семенова 2 years ago
parent
commit
d867f51396

+ 5 - 2
PleasantRustle/Pages/Main.xaml

@@ -31,9 +31,12 @@
                             <TextBlock Text="Приоритетность: " FontFamily="Monotype Corsiva" FontSize="18"/>
                             <TextBlock Text="{Binding Priority}" FontFamily="Monotype Corsiva" FontSize="15"/>
                         </StackPanel>
+                        <StackPanel Orientation="Horizontal">
+                            <Button x:Name="buttonUpdate" Click="buttonUpdate_Click" Content="Редактировать агента" Background="White" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18" Width="600" Height="20"/>
+                        </StackPanel>
                     </StackPanel>
-                    <StackPanel Width="50" Height="50" HorizontalAlignment="Right">
-                        <TextBlock Text="10%" FontFamily="Monotype Corsiva" FontSize="25"/>
+                    <StackPanel Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top">
+                        <TextBlock Text="10%" FontFamily="Monotype Corsiva" FontSize="25" Margin="10,0,0,0"/>
                     </StackPanel>
             </StackPanel>
             </Border>

+ 7 - 1
PleasantRustle/Pages/Main.xaml.cs

@@ -72,6 +72,7 @@ namespace PleasantRustle.Pages
                     agents.Reverse();
                     break;
             }
+            listboxPleasant.ItemsSource = agents;
         }
 
         private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
@@ -94,6 +95,11 @@ namespace PleasantRustle.Pages
         {
             Add add = new Add();
             add.ShowDialog();
-        }       
+        }
+
+        private void buttonUpdate_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 9 - 2
PleasantRustle/PleasantRustle.csproj

@@ -70,7 +70,7 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
-    <Compile Include="Add.xaml.cs">
+    <Compile Include="Windows\Add.xaml.cs">
       <DependentUpon>Add.xaml</DependentUpon>
     </Compile>
     <Compile Include="Agent.cs">
@@ -118,7 +118,10 @@
     <Compile Include="Supplier.cs">
       <DependentUpon>Model.tt</DependentUpon>
     </Compile>
-    <Page Include="Add.xaml">
+    <Compile Include="Windows\Update.xaml.cs">
+      <DependentUpon>Update.xaml</DependentUpon>
+    </Compile>
+    <Page Include="Windows\Add.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -138,6 +141,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Windows\Update.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Model.Context.cs">

+ 2 - 2
PleasantRustle/Add.xaml → PleasantRustle/Windows/Add.xaml

@@ -39,8 +39,8 @@
                 <TextBox/>
             </GroupBox>
             <StackPanel>
-                <Button Content="Готово" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,20"/>
-                <Button Content="Назад" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,0"/>
+                <Button Content="Добавить" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,20"/>
+                <Button Content="Назад" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,0" Click="Button_Click"/>
             </StackPanel>
         </StackPanel>
     </Grid>

+ 5 - 1
PleasantRustle/Add.xaml.cs → PleasantRustle/Windows/Add.xaml.cs

@@ -11,7 +11,6 @@ using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Shapes;
-
 namespace PleasantRustle
 {
     /// <summary>
@@ -23,5 +22,10 @@ namespace PleasantRustle
         {
             InitializeComponent();
         }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
     }
 }

+ 47 - 0
PleasantRustle/Windows/Update.xaml

@@ -0,0 +1,47 @@
+<Window x:Class="PleasantRustle.Windows.Update"
+        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:PleasantRustle.Windows"
+        mc:Ignorable="d"
+        Title="Редактирование агента" MinWidth="300" MinHeight="680">
+    <Grid>
+        <StackPanel>
+            <GroupBox Header="Наименование агента" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="Тип агента" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <ComboBox/>
+            </GroupBox>
+            <GroupBox Header="Юридический адресс" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="ИНН" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="КПП" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="Директор" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="Телефон агента" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="Электронная почта агента" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <GroupBox Header="Логотип агента" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <Button Content="Загрузить логотип агента" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18"/>
+            </GroupBox>
+            <GroupBox Header="Приоритет" BorderBrush="#FF46B29D" FontFamily="Monotype Corsiva" FontSize="18">
+                <TextBox/>
+            </GroupBox>
+            <StackPanel>
+                <Button Content="Редактировать" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,20"/>
+                <Button Content="Назад" Background="#FF46B29D" BorderBrush="{x:Null}" Foreground="White" FontFamily="Monotype Corsiva" FontSize="18" Margin="50,0" Click="Button_Click"/>
+            </StackPanel>
+        </StackPanel>
+    </Grid>
+</Window>

+ 32 - 0
PleasantRustle/Windows/Update.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.Shapes;
+
+namespace PleasantRustle.Windows
+{
+    /// <summary>
+    /// Логика взаимодействия для Update.xaml
+    /// </summary>
+    public partial class Update : Window
+    {
+        public Update()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+    }
+}