ソースを参照

Добавили класс AgentPriorityHistory

lizka.flex@outlook.com 2 年 前
コミット
790f7f1a45

+ 4 - 3
Muzzle/Add.xaml

@@ -5,7 +5,7 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:Muzzle"
         mc:Ignorable="d"
-        Title="Add" Height="450" Width="800">
+        Title="Добавление продукции" Height="450" Width="800">
     <Grid>
         <StackPanel Orientation = "Vertical" >
             <StackPanel Orientation="Horizontal">
@@ -40,8 +40,9 @@
                 <Label Content="Описание"></Label>
                 <TextBox Width = "300" Height="100"></TextBox>
             </StackPanel>
-            <StackPanel>
-                <Button x:Name="btnNaz" Content="Назад" Width="100" Height="20" HorizontalAlignment="Left" Margin="10" Click="btnNaz_Click"></Button>
+            <StackPanel Orientation="Vertical">
+                <Button x:Name="btnDob" Content="Добавить" Width="100" Height="20" HorizontalAlignment="Left" Margin="10,10,0,10"></Button>
+                <Button x:Name="btnNaz" Content="Назад" Width="100" Height="20" HorizontalAlignment="Left" Margin="10,0,0,0" Click="btnNaz_Click"></Button>
             </StackPanel>
         </StackPanel>
     </Grid>

+ 5 - 0
Muzzle/Add.xaml.cs

@@ -32,5 +32,10 @@ namespace Muzzle
         {
             this.Close();
         }
+
+        private void btnNaz_Click_1(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 13 - 0
Muzzle/Class/AgentPriorityHistory.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Muzzle
+{
+    public partial class AgentPriorityHistory
+    {
+        public bool TooOld { get => (DateTime.Now - ChangeDate).Days >= 365; }
+    }
+}

+ 1 - 1
Muzzle/Model1.Designer.cs

@@ -1,4 +1,4 @@
-// Создание кода T4 для модели "X:\Muzzle\Muzzle\Muzzle\Model1.edmx" включено. 
+// Создание кода T4 для модели "C:\Users\ЛюлинаЕА\source\repos\Muzzle\Muzzle\Model1.edmx" включено. 
 // Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
 // на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
 // открыта в конструкторе.

+ 8 - 0
Muzzle/Muzzle.csproj

@@ -79,6 +79,7 @@
     <Compile Include="AgentType.cs">
       <DependentUpon>Model1.tt</DependentUpon>
     </Compile>
+    <Compile Include="Class\AgentPriorityHistory.cs" />
     <Compile Include="Class\BaseConnect.cs" />
     <Compile Include="Material.cs">
       <DependentUpon>Model1.tt</DependentUpon>
@@ -118,6 +119,9 @@
     <Compile Include="sysdiagrams.cs">
       <DependentUpon>Model1.tt</DependentUpon>
     </Compile>
+    <Compile Include="Update.xaml.cs">
+      <DependentUpon>Update.xaml</DependentUpon>
+    </Compile>
     <Page Include="Add.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -151,6 +155,10 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="Update.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">

+ 1 - 1
Muzzle/Pages/Main.xaml

@@ -26,7 +26,7 @@
                         <TextBlock Text="{Binding Material.Title}"  Loaded="TextBlock_Loaded" Tag="{Binding ID}"/>
                     </StackPanel>
                         <StackPanel Orientation="Horizontal">
-                            <Button x:Name="btnRed" Content="Редактировать" Width="100" Height="20" Margin="5"></Button>
+                            <Button x:Name="btnRed" Content="Редактировать" Width="100" Height="20" Margin="5" Click="btnIzmena_CLick"></Button>
                         </StackPanel>
                 </StackPanel>
                 <TextBlock Text="{Binding Material.Cost}" Loaded="TextBlock_Loaded_1" Tag="{Binding ID}" VerticalAlignment="Center"/>

+ 6 - 0
Muzzle/Pages/Main.xaml.cs

@@ -141,5 +141,11 @@ namespace Muzzle
             add.ShowDialog();
 
         }
+
+        private void btnIzmena_CLick(object sender, RoutedEventArgs e)
+        {
+            Update update = new Update();
+            update.ShowDialog();
+        }
     }       
 }

+ 49 - 0
Muzzle/Update.xaml

@@ -0,0 +1,49 @@
+<Window x:Class="Muzzle.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:Muzzle"
+        mc:Ignorable="d"
+        Title="Редактирование продукта" Height="450" Width="800">
+    <Grid>
+        <StackPanel Orientation = "Vertical" >
+            <StackPanel Orientation="Horizontal">
+                <Label Content = "Артикул" ></Label>
+                <TextBox Width="100" Height="15"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Наименование"></Label>
+                <TextBox Width = "100" Height="15"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Тип продукта"></Label>
+                <ComboBox Width = "150" Height="15"></ComboBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Изображение"></Label>
+                <Button x:Name="btnImage" Content="Загрузить изображение" Width="150" Height="20"></Button>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Количество человек для производства"></Label>
+                <TextBox Width = "100" Height="15"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Номер производственого цеха"></Label>
+                <TextBox Width = "100" Height="15"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Минимальная стоимость для агента"></Label>
+                <TextBox Width = "100" Height="15"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation = "Horizontal" >
+                <Label Content="Описание"></Label>
+                <TextBox Width = "300" Height="100"></TextBox>
+            </StackPanel>
+            <StackPanel Orientation="Vertical">
+                <Button x:Name="btnDob" Content="Готово" Width="100" Height="20" HorizontalAlignment="Left" Margin="10,10,0,10"></Button>
+                <Button x:Name="btnNaz" Content="Назад" Width="100" Height="20" HorizontalAlignment="Left" Margin="10,0,0,0" Click="btnNaz_Click"></Button>
+            </StackPanel>
+        </StackPanel>
+    </Grid>
+</Window>

+ 35 - 0
Muzzle/Update.xaml.cs

@@ -0,0 +1,35 @@
+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 Muzzle
+{
+    /// <summary>
+    /// Логика взаимодействия для Update.xaml
+    /// </summary>
+    public partial class Update : Window
+    {
+        public static class Products
+        {
+            public static Frame frm;
+        }
+        public Update()
+        {
+            InitializeComponent();
+        }
+        private void btnNaz_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+    }
+}