Explorar o código

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

gr682_bpv %!s(int64=4) %!d(string=hai) anos
pai
achega
eca72ed555

+ 25 - 0
SkladProject.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30804.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkladProject", "SkladProject\SkladProject.csproj", "{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {E9D8E977-BEE6-4040-88D0-B9C952039307}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
SkladProject/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>
+</configuration>

+ 16 - 0
SkladProject/App.xaml

@@ -0,0 +1,16 @@
+<Application x:Class="SkladProject.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:SkladProject"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Application.Resources>
+</Application>

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

BIN=BIN
SkladProject/Image/icon.png


BIN=BIN
SkladProject/Image/kladmen.png


BIN=BIN
SkladProject/Image/privet.png


BIN=BIN
SkladProject/Image/sklad.jpg


+ 36 - 0
SkladProject/MainWindow.xaml

@@ -0,0 +1,36 @@
+<Window x:Class="SkladProject.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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:SkladProject"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="400" Width="350" Icon="Image/icon.png" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
+    <Grid MouseDown="Grid_MouseDown">
+        <Border Name="background" Background="#FFBEBDBF" CornerRadius="20,20,20,20"/>
+        <Border Margin="0,0,0.4,282" CornerRadius="20,20,0,0">
+            <Border.Background>
+                <ImageBrush ImageSource="Image/sklad.jpg"/>
+            </Border.Background>
+        </Border>
+        <Label Content="Авторизация" FontFamily="Century Gothic" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Margin="0,169,0.4,193" VerticalAlignment="Center" Width="350" FontWeight="Bold" FontSize="24"/>
+        <StackPanel Orientation="Vertical" Margin="60,208,60.4,86">
+            <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
+                <materialDesign:PackIcon Kind="User" Width="30" Height="30" Foreground="#010101" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBox Name="logintxt" Margin="5,0,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="10" materialDesign:TextFieldAssist.UnderlineBrush="#010101" materialDesign:HintAssist.Hint="Введите логин" Width="195" TextChanged="logintxt_TextChanged"/>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
+                <materialDesign:PackIcon Kind="Password" Width="30" Height="30" Foreground="#010101" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <PasswordBox Name="passwordtxt" Margin="5,0,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="10" materialDesign:TextFieldAssist.UnderlineBrush="#010101" materialDesign:HintAssist.Hint="Введите пароль" Width="195" PasswordChanged="passwordtxt_PasswordChanged"/>
+            </StackPanel>
+        </StackPanel>
+        <Button Content="Войти" BorderThickness="0" Background="#010101" materialDesign:ButtonAssist.CornerRadius="10" HorizontalAlignment="Center"  VerticalAlignment="Center" Width="108"  Height="37" Margin="121,338,121.4,25" Click="Vhod_Click"/>
+        <Button x:Name="WinMin" Style="{StaticResource MaterialDesignIconButton}" Margin="244,123,58.4,229" Click="WinMin_Click">
+            <materialDesign:PackIcon Kind="WindowMinimize" Foreground="#010101"/>
+        </Button>
+        <Button x:Name="Exit" Style="{StaticResource MaterialDesignIconButton}" Margin="292,123,10.4,229" Click="Exit_Click">
+            <materialDesign:PackIcon Kind="WindowClose" Foreground="#010101"/>
+        </Button>
+    </Grid>
+</Window>

+ 117 - 0
SkladProject/MainWindow.xaml.cs

@@ -0,0 +1,117 @@
+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;
+using System.Data.SqlClient;
+using System.Data;
+
+namespace SkladProject
+{
+    /// <summary>
+    /// Логика взаимодействия для MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+
+        SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=praktika;Integrated Security=True");
+
+        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            DragMove();
+        }
+
+        private void Exit_Click(object sender, RoutedEventArgs e)
+        {
+            Application.Current.Shutdown();
+        }
+
+        private void WinMin_Click(object sender, RoutedEventArgs e)
+        {
+            this.WindowState = WindowState.Minimized;
+        }
+
+        private void logintxt_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')).ToArray());
+            }
+        }
+
+        private void passwordtxt_PasswordChanged(object sender, RoutedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')).ToArray());
+            }
+        }
+
+        private void Vhod_Click(object sender, RoutedEventArgs e)
+        {
+            try
+            {
+                if (logintxt.Text == "" || passwordtxt.Password == "")
+                {
+                    MessageBox.Show("Поля не могут быть пустыми!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
+                }
+                else
+                {
+                    con.Open();
+                    SqlCommand cmd = new SqlCommand("Select * from Users where Login ='" + logintxt.Text + "'  and Password ='" + passwordtxt.Password + "'", con);
+                    cmd.CommandType = CommandType.Text;
+                    SqlDataAdapter adapter = new SqlDataAdapter();
+                    adapter.SelectCommand = cmd;
+                    DataSet dataSet = new DataSet();
+                    adapter.Fill(dataSet);
+                    if (dataSet.Tables[0].Rows.Count > 0)
+                    {
+                        string idrole = dataSet.Tables[0].Rows[0]["ID_RoleUser"].ToString();
+                        string username = dataSet.Tables[0].Rows[0]["ID_User"].ToString();
+                        if (idrole.ToString() == "1")
+                        {
+                            con.Close();
+                            WindowAdmin windowAdmin = new WindowAdmin();
+                            windowAdmin.Show();
+                            this.Close();                         
+                        }
+                        else
+                        {
+                            WorkerWindow workerWindow = new WorkerWindow();
+                            workerWindow.idusertxt.Text = username;
+                            con.Close();
+                            workerWindow.Show();
+                            this.Close();
+                        }
+                    }
+                    else
+                    {
+                        con.Close();
+                        MessageBox.Show("Неправильный логин/пароль!", "Вход", MessageBoxButton.OK, MessageBoxImage.Information);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                con.Close();
+                MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+            
+        }
+    }
+}

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

+ 70 - 0
SkladProject/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код был создан программным средством.
+//     Версия среды выполнения: 4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
+//     код создан повторно.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace SkladProject.Properties
+{
+    /// <summary>
+    ///   Класс ресурсов со строгим типом для поиска локализованных строк и пр.
+    /// </summary>
+    // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
+    // класс с помощью таких средств, как ResGen или Visual Studio.
+    // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
+    // с параметром /str или заново постройте свой VS-проект.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SkladProject.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;
+            }
+        }
+    }
+}

+ 117 - 0
SkladProject/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
SkladProject/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <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 SkladProject.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
SkladProject/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>

+ 138 - 0
SkladProject/SkladProject.csproj

@@ -0,0 +1,138 @@
+<?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>{ED0E2EDD-23BA-47A2-9991-5E42A74BA266}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>SkladProject</RootNamespace>
+    <AssemblyName>SkladProject</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>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </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="MaterialDesignColors, Version=2.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MaterialDesignColors.2.0.0\lib\net452\MaterialDesignColors.dll</HintPath>
+    </Reference>
+    <Reference Include="MaterialDesignThemes.Wpf, Version=4.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
+      <HintPath>..\packages\MaterialDesignThemes.4.0.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <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="WindowAdmin.xaml.cs">
+      <DependentUpon>WindowAdmin.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="WorkerWindow.xaml.cs">
+      <DependentUpon>WorkerWindow.xaml</DependentUpon>
+    </Compile>
+    <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="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="WindowAdmin.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="WorkerWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <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>
+    <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>
+    <Resource Include="Image\icon.png" />
+    <Resource Include="Image\sklad.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Image\kladmen.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Image\privet.png" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets'))" />
+  </Target>
+</Project>

+ 53 - 0
SkladProject/WindowAdmin.xaml

@@ -0,0 +1,53 @@
+<Window x:Class="SkladProject.WindowAdmin"
+        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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:SkladProject"
+        mc:Ignorable="d"
+        Title="WindowAdmin" Height="450" Width="800" Icon="Image/icon.png" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Loaded="Window_Loaded">
+    <Grid MouseDown="Grid_MouseDown">
+        <Border Name="background" Background="#FFBEBDBF" CornerRadius="20,20,20,20"/>
+        <Label Content="Работники склада" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="800" Margin="0,26,0,365.6"  />
+        <TextBlock Name="idusertxt" Visibility="Hidden"/>
+        <StackPanel Margin="6,94,547,64.6" Orientation="Vertical">
+            <TextBox x:Name="familiyatxt" Margin="10,15,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="25"
+                materialDesign:HintAssist.Hint="Фамилия работника" materialDesign:TextFieldAssist.UnderlineBrush="#010101" TextChanged="familiyatxt_TextChanged"/>
+            <TextBox x:Name="nametxt" Margin="10,15,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="15"
+                materialDesign:HintAssist.Hint="Имя работника" materialDesign:TextFieldAssist.UnderlineBrush="#010101" TextChanged="nametxt_TextChanged"/>
+            <TextBox x:Name="otchestvotxt" Margin="10,15,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="25"
+                materialDesign:HintAssist.Hint="Отчество работника" materialDesign:TextFieldAssist.UnderlineBrush="#010101" TextChanged="otchestvotxt_TextChanged"/>
+            <TextBox x:Name="logintxt" Margin="10,15,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="10"
+                materialDesign:HintAssist.Hint="Логин работника" materialDesign:TextFieldAssist.UnderlineBrush="#010101" TextChanged="logintxt_TextChanged"/>
+            <PasswordBox x:Name="passwordtxt" Margin="10,15,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="10"
+                materialDesign:HintAssist.Hint="Пароль работника" materialDesign:TextFieldAssist.UnderlineBrush="#010101" PasswordChanged="passwordtxt_PasswordChanged"/>
+            <ComboBox Name="rolecombo" Margin="10,5,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Style="{StaticResource MaterialDesignFloatingHintComboBox}"
+              materialDesign:HintAssist.Hint="Роль" materialDesign:TextFieldAssist.UnderlineBrush="#010101" Height="48"/>
+        </StackPanel>
+        <StackPanel Margin="6,370,547,-6.4" Orientation="Horizontal">
+            <Button x:Name="Add" Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101"  Margin="25,0,0,0" Click="Add_Click">
+                <materialDesign:PackIcon Kind="Add" />
+            </Button>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101"  Margin="25,0,0,0" Click="Update_Click">
+                <materialDesign:PackIcon Kind="Edit" />
+            </Button>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="25,0,0,0" Click="Delete_Click">
+                <materialDesign:PackIcon Kind="Delete" />
+            </Button>
+        </StackPanel>
+        <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="742,77,10,324.6" Click="Refresh_Click">
+            <materialDesign:PackIcon Kind="Refresh" />
+        </Button>
+        <DataGrid x:Name="datastaff" IsReadOnly="True" HorizontalAlignment="Left" Height="273" Margin="258,130,0,0" BorderThickness="1" BorderBrush="Black" VerticalAlignment="Top" Width="532" SelectionChanged="datastaff_SelectionChanged"/>
+        <Button Style="{StaticResource MaterialDesignIconButton}"  Margin="10,10,742,391.6" Click="Back">
+            <materialDesign:PackIcon Kind="Backburger"  Foreground="#010101"/>
+        </Button>
+        <Button x:Name="WinMin" Style="{StaticResource MaterialDesignIconButton}" Margin="694,10,58,391.6" Click="WinMin_Click">
+            <materialDesign:PackIcon Kind="WindowMinimize" Foreground="#010101"/>
+        </Button>
+        <Button x:Name="Exit" Style="{StaticResource MaterialDesignIconButton}" Margin="742,10,10,391.6" Click="Exit_Click">
+            <materialDesign:PackIcon Kind="WindowClose" Foreground="#010101"/>
+        </Button>
+    </Grid>
+</Window>

+ 317 - 0
SkladProject/WindowAdmin.xaml.cs

@@ -0,0 +1,317 @@
+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;
+using System.Data.SqlClient;
+using System.Data;
+
+namespace SkladProject
+{
+    /// <summary>
+    /// Логика взаимодействия для WindowAdmin.xaml
+    /// </summary>
+    public partial class WindowAdmin : Window
+    {
+        public WindowAdmin()
+        {
+            InitializeComponent();
+        }
+
+        SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=praktika;Integrated Security=True");
+
+        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            DragMove();
+        }
+
+        private void datastaff_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            try
+            {
+                DataGrid gd = (DataGrid)sender;
+                DataRowView rowView = gd.SelectedItem as DataRowView;
+                if (rowView != null)
+                {
+                    idusertxt.Text = rowView["ID_User"].ToString();
+                    nametxt.Text = rowView["FirstName"].ToString();
+                    familiyatxt.Text = rowView["LastName"].ToString();
+                    otchestvotxt.Text = rowView["MiddleName"].ToString();
+                    logintxt.Text = rowView["Login"].ToString();
+                    passwordtxt.Password = rowView["Password"].ToString();
+                    rolecombo.Text = rowView["NameRole"].ToString();
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+        }
+
+        private void Back(object sender, RoutedEventArgs e)
+        {
+            MainWindow mainWindow = new MainWindow();
+            mainWindow.Show();
+            this.Close();
+        }
+
+        private void WinMin_Click(object sender, RoutedEventArgs e)
+        {
+            this.WindowState = WindowState.Minimized;
+        }
+
+        void fillcombo()
+        {
+            try
+            {
+                rolecombo.Items.Clear();
+                con.Open();
+                SqlCommand sql = con.CreateCommand();
+                sql.CommandType = CommandType.Text;
+                sql.CommandText = "Select NameRole from Roles";
+                sql.ExecuteNonQuery();
+                DataTable dt = new DataTable();
+                SqlDataAdapter da = new SqlDataAdapter(sql);
+                da.Fill(dt);
+                foreach (DataRow dr in dt.Rows)
+                {
+                    rolecombo.Items.Add(dr["NameRole"].ToString());
+                }
+                con.Close();
+            }
+            catch (Exception ex)
+            {
+                con.Close();
+                MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+        }
+
+        void showgrid()
+        {
+            try
+            {
+                con.Open();
+                string sql = "SELECT ID_User,LastName, FirstName, MiddleName, Login, Password, [NameRole]  From Users inner join Roles on Users.ID_RoleUser = Roles.ID_Role";
+                SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, con);
+                DataTable data = new DataTable("Users");
+                dataAdapter.Fill(data);
+                datastaff.ItemsSource = data.DefaultView;
+                dataAdapter.Update(data);
+                con.Close();
+                datastaff.Columns[0].Header = "ID";
+                datastaff.Columns[1].Header = "Фамилия";
+                datastaff.Columns[2].Header = "Имя";
+                datastaff.Columns[3].Header = "Отчество";
+                datastaff.Columns[4].Header = "Логин";
+                datastaff.Columns[6].Header = "Роль";
+                datastaff.Columns[5].Visibility = Visibility.Collapsed;
+                datastaff.Columns[0].Visibility = Visibility.Collapsed;
+            }
+            catch (Exception ex)
+            {
+                con.Close();
+                MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+            }
+        }
+
+        private void Add_Click(object sender, RoutedEventArgs e)
+        {
+            if (familiyatxt.Text == "" || nametxt.Text == "" || otchestvotxt.Text == "" || logintxt.Text == "" || passwordtxt.Password == "" || rolecombo.Text == "")
+            {
+                MessageBox.Show("Заполните все поля!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else
+            {
+                try
+                {
+                    con.Open();
+                    SqlCommand cmd = new SqlCommand("Select * from Users where Login ='" + logintxt.Text + "'", con);
+                    cmd.CommandType = CommandType.Text;
+                    SqlDataAdapter adapter = new SqlDataAdapter();
+                    adapter.SelectCommand = cmd;
+                    DataSet dataSet = new DataSet();
+                    adapter.Fill(dataSet);
+                    if (dataSet.Tables[0].Rows.Count > 0)
+                    {
+                        MessageBox.Show("Пользователь с таким логиным уже создан!", "Информация", MessageBoxButton.OK, MessageBoxImage.Information);
+                        con.Close();
+                    }
+                    else
+                    {
+                        string idrole = "";
+                        if (rolecombo.Text == "Администратор")
+                            idrole = "1";
+                        else
+                            idrole = "2";
+                        string sql = "INSERT INTO Users (LastName,FirstName,MiddleName,Login,Password,ID_RoleUser) VALUES('" + familiyatxt.Text + "','" + nametxt.Text + "','" + otchestvotxt.Text + "','" + logintxt.Text + "','" + passwordtxt.Password + "', '" + idrole.ToString() + "')";
+                        SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, con);
+                        dataAdapter.SelectCommand.ExecuteNonQuery();
+                        con.Close();
+                        showgrid();
+                        idusertxt.Text = "";
+                        nametxt.Text = "";
+                        familiyatxt.Text = "";
+                        otchestvotxt.Text = "";
+                        logintxt.Text = "";
+                        passwordtxt.Password = "";
+                        rolecombo.Text = "";
+                    }
+                }
+                catch (Exception ex)
+                {
+                    con.Close();
+                    MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+                }
+            }
+        }
+
+        private void Update_Click(object sender, RoutedEventArgs e)
+        {
+            if(idusertxt.Text == "")
+            {
+                MessageBox.Show("Поле не выбрано! Выберите нужное поле!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else if (familiyatxt.Text == "" || nametxt.Text == "" || otchestvotxt.Text == "" || logintxt.Text == "" || passwordtxt.Password == "" || rolecombo.Text == "")
+            {
+                MessageBox.Show("Заполните все поля!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else
+            {
+                try
+                {          
+                    con.Open();
+                        string idrole = "";
+                        if (rolecombo.Text == "Администратор")
+                            idrole = "1";
+                        else
+                            idrole = "2";
+                        string sql = "Update Users set FirstName ='" + nametxt.Text + "', LastName = '" + familiyatxt.Text + "', MiddleName = '" + otchestvotxt.Text + "', Login = '" + logintxt.Text + "', Password = '" + passwordtxt.Password + "', ID_RoleUser = '" + idrole.ToString() + "' where ID_User = '" + idusertxt.Text + "'";
+                        SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, con);
+                        dataAdapter.SelectCommand.ExecuteNonQuery();
+                        con.Close();
+                        idusertxt.Text = "";
+                        nametxt.Text = "";
+                        familiyatxt.Text = "";
+                        otchestvotxt.Text = "";
+                        logintxt.Text = "";
+                        passwordtxt.Password = "";
+                        rolecombo.Text = "";
+                        showgrid();                                     
+                }
+                catch (Exception ex)
+                {
+                    con.Close();
+                    MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+                }
+            }
+        }
+
+        private void Delete_Click(object sender, RoutedEventArgs e)
+        {
+            if (idusertxt.Text == "")
+            {
+                MessageBox.Show("Поле не выбрано! Выберите нужное поле!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else
+            {
+                try
+                {
+                    con.Open();
+                    string sql = "DELETE FROM Users WHERE ID_User = '" + idusertxt.Text + "'";
+                    SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, con);
+                    dataAdapter.SelectCommand.ExecuteNonQuery();
+                    con.Close();
+                    idusertxt.Text = "";
+                    nametxt.Text = "";
+                    familiyatxt.Text = "";
+                    otchestvotxt.Text = "";
+                    logintxt.Text = "";
+                    passwordtxt.Password = "";
+                    rolecombo.Text = "";
+                    showgrid();
+                }
+                catch (Exception ex)
+                {
+                    con.Close();
+                    MessageBox.Show("Возникла ошибка! " + ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+                }
+            }
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            fillcombo();
+            showgrid();
+        }
+
+        private void Refresh_Click(object sender, RoutedEventArgs e)
+        {
+            idusertxt.Text = "";
+            nametxt.Text = "";
+            familiyatxt.Text = "";
+            otchestvotxt.Text = "";
+            logintxt.Text = "";
+            passwordtxt.Password = "";
+            rolecombo.Text = "";
+            showgrid();
+        }
+
+        private void Exit_Click(object sender, RoutedEventArgs e)
+        {
+            Application.Current.Shutdown();
+        }
+
+        private void familiyatxt_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'А' && ch <= 'Я') || (ch >= 'а' && ch <= 'я')).ToArray());
+            }
+        }
+
+        private void nametxt_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'А' && ch <= 'Я') || (ch >= 'а' && ch <= 'я')).ToArray());
+            }
+        }
+
+        private void otchestvotxt_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'А' && ch <= 'Я') || (ch >= 'а' && ch <= 'я')).ToArray());
+            }
+        }
+
+        private void logintxt_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')).ToArray());
+            }
+        }
+
+        private void passwordtxt_PasswordChanged(object sender, RoutedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Text = new string
+               (textBox.Text.Where(ch => (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')).ToArray());
+            }
+        }
+    }
+}

+ 132 - 0
SkladProject/WorkerWindow.xaml

@@ -0,0 +1,132 @@
+<Window x:Class="SkladProject.WorkerWindow"
+        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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:SkladProject"
+        mc:Ignorable="d"
+        Title="WorkerWindow" Height="450" Width="800" Icon="Image/icon.png" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Loaded="Window_Loaded">
+    <Grid MouseDown="Grid_MouseDown">
+        <Border Name="background" Background="#FFBEBDBF" CornerRadius="20,20,20,20"/>
+        <TextBlock Name="idusertxt" Visibility="Hidden"/>
+        <TextBlock Name="timetxt" TextAlignment="Center" HorizontalAlignment="Center" Foreground="#010101" FontFamily="Century Gothic" Margin="464,48,87,0" TextWrapping="Wrap" FontSize="22" VerticalAlignment="Top" Height="28" Width="249"/>
+        <StackPanel Margin="0,76,571,111.6" x:Name="panelka">
+            <StackPanel Orientation="Horizontal" Margin="10">
+                <materialDesign:PackIcon Kind="User" Width="25" Height="32" Foreground="#010101"/>
+                <Button FontFamily="Century Gothic" materialDesign:ButtonAssist.CornerRadius="10" Background="#010101" Margin="5 0" BorderThickness="0" Content="Личный кабинет" Width="167" Click="UserInform"/>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="10">
+                <materialDesign:PackIcon Kind="Abacus" Width="25" Height="32" Foreground="#010101"/>
+                <Button FontFamily="Century Gothic" materialDesign:ButtonAssist.CornerRadius="10" Background="#010101" Margin="5 0" BorderThickness="0" Content="Продукция" Width="167" Click="Production"/>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="10">
+                <materialDesign:PackIcon Kind="Book" Width="25" Height="32" Foreground="#010101"/>
+                <Button FontFamily="Century Gothic" materialDesign:ButtonAssist.CornerRadius="10" Background="#010101" Margin="5 0" BorderThickness="0" Content="Документы" Width="167" Click="Document"/>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="10">
+                <materialDesign:PackIcon Kind="SwapHorizontalCircle" Width="25" Height="32" Foreground="#010101"/>
+                <Button FontFamily="Century Gothic" materialDesign:ButtonAssist.CornerRadius="10" Background="#010101" Margin="5 0" BorderThickness="0" Content="Движение" Width="167" Click="Traffic"/>
+            </StackPanel>
+            <StackPanel Orientation="Horizontal" Margin="10">
+                <materialDesign:PackIcon Kind="Information" Width="25" Height="32" Foreground="#010101"/>
+                <Button FontFamily="Century Gothic" materialDesign:ButtonAssist.CornerRadius="10" Background="#010101" Margin="5 0" BorderThickness="0" Content="Инф. Склад" Width="167" Click="SkladInfo"/>
+            </StackPanel>
+        </StackPanel>
+        <Image HorizontalAlignment="Left" Source="Image/icon.png" Stretch="UniformToFill" Height="68" Margin="84,0,0,0" VerticalAlignment="Top" Width="72"/>
+        <Button Style="{StaticResource MaterialDesignIconButton}"  Margin="10,10,742,391.6" Click="Back">
+            <materialDesign:PackIcon Kind="Backburger"  Foreground="#010101"/>
+        </Button>
+        <Button x:Name="WinMin" Style="{StaticResource MaterialDesignIconButton}" Margin="694,10,58,391.6" Click="WinMin_Click">
+            <materialDesign:PackIcon Kind="WindowMinimize" Foreground="#010101"/>
+        </Button>
+        <Button x:Name="Exit" Style="{StaticResource MaterialDesignIconButton}" Margin="742,10,10,391.6" Click="Exit_Click">
+            <materialDesign:PackIcon Kind="WindowClose" Foreground="#010101"/>
+        </Button>
+        <Grid Name="gridlich" Margin="229,76,10,9.6" Visibility="Hidden">
+            <Border BorderBrush="#010101" BorderThickness="1" CornerRadius="20,20,20,20"/>
+            <Label Content="Личный кабинет" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="561" Margin="0,26,0,285"/>
+            <StackPanel Margin="10,114,266,61" Orientation="Vertical">
+                <TextBlock Name="lastnametxt" Margin="10,0,0,0" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Height="30"/>
+                <TextBlock Name="firstnametxt" Margin="10,15,0,0" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Height="30"/>
+                <TextBlock Name="middlename" Margin="10,15,0,0" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Height="30"/>
+                <TextBlock Name="logintxt" Margin="10,15,0,0" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Height="30"/>
+            </StackPanel>
+            <Image Source="Image/kladmen.png" Margin="271,86,24,38"/>
+        </Grid>
+        <Grid Name="gridproduct" Margin="229,76,10,9.6" Visibility="Hidden">
+            <Border BorderBrush="#010101" BorderThickness="1" CornerRadius="20,20,20,20"/>
+            <Label Content="Продукция" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="561" Margin="0,26,0,285"/>
+            <TextBlock Name="idproducttxt" Visibility="Hidden"/>
+            <TextBox Name="productnametxt" Margin="10,122,301,197" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" MaxLength="25"
+                materialDesign:HintAssist.Hint="Наименование продукта" materialDesign:TextFieldAssist.UnderlineBrush="#010101" TextChanged="productnametxt_TextChanged"/>
+            <DatePicker Name="dateproduct" Foreground="#010101" Margin="10,172,301,144" Style="{StaticResource MaterialDesignFloatingHintDatePicker}" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontSize="18" FontFamily="Century Gothic" SelectedDateFormat="Short" materialDesign:HintAssist.Hint="Срок хранения" Height="48"/>
+            <DataGrid Name="dataproduct" BorderBrush="#010101" BorderThickness="1" IsReadOnly="True" HorizontalAlignment="Left" Height="206" Margin="275,122,0,0" VerticalAlignment="Top" Width="268" SelectionChanged="dataproduct_SelectionChanged"/>
+            <StackPanel Margin="10,245,297,58" Orientation="Horizontal">
+                <Button x:Name="Add" Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101"  Margin="25,0,0,0" Click="Add_Click">
+                    <materialDesign:PackIcon Kind="Add" />
+                </Button>
+                <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101"  Margin="25,0,0,0" Click="Update_Click">
+                    <materialDesign:PackIcon Kind="Edit" />
+                </Button>
+                <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="25,0,0,0" Click="Delete_Click">
+                    <materialDesign:PackIcon Kind="Delete" />
+                </Button>
+            </StackPanel>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="495,74,18,242" Click="Refresh_Click">
+                <materialDesign:PackIcon Kind="Refresh" />
+            </Button>
+        </Grid>
+        <Grid Name="gridprivet" Visibility="Hidden" Margin="287,76,36,83.6">
+            <Label Content="Склад готовой продукции" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="477" Margin="0,18,0,216"/>
+            <Image Source="Image/privet.png" Stretch="UniformToFill" Margin="10,-37,20,-66"/>
+        </Grid>
+        <Grid Name="gridskladinfo" Margin="229,76,10,9.6" Visibility="Hidden">
+            <Border BorderBrush="#010101" BorderThickness="1" CornerRadius="20,20,20,20"/>
+            <Label Content="Информация о складе" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="561" Margin="0,26,0,285"/>
+            <TextBlock Margin="10,171,131,121" TextWrapping="Wrap" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101"><Run Text="Юридический адрес: Томская обл., г.Томск,         "/><LineBreak/><Run Text="                                        ул.Мелиоративная 12"/></TextBlock>
+            <TextBlock Margin="9,102,131,190" TextWrapping="Wrap" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101"><Run Text="Полное наименование: Склад готовой "/><LineBreak/><Run Text="                                           продукции"/></TextBlock>
+            <TextBlock Margin="9,243,114,49" TextWrapping="Wrap" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Text="Директор: Александров Дмитрий Даниилович"/>
+            <TextBlock Margin="9,292,114,0" TextWrapping="Wrap" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Text="Контактный телефон: 8(3822)4-15-66"/>
+        </Grid>
+        <Grid Name="griddocument" Margin="229,76,10,9.6" Visibility="Hidden">
+            <Border BorderBrush="#010101" BorderThickness="1" CornerRadius="20,20,20,20"/>
+            <Label Content="Документы" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="561" Margin="0,10,0,301"/>
+            <TextBlock Name="iddocumenttxt" Visibility="Hidden"/>
+            <TextBox Name="lastnamepost" Margin="9,54,334,274" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontSize="18" FontWeight="Bold" FontFamily="Century Gothic" Foreground="#010101" MaxLength="25"
+                materialDesign:HintAssist.Hint="Фамилия поставщика" TextChanged="lastnamepost_TextChanged"/>
+            <TextBox Name="firstnamepost" Margin="9,90,334,239" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontSize="18" FontWeight="Bold" FontFamily="Century Gothic" Foreground="#010101" MaxLength="15"
+                materialDesign:HintAssist.Hint="Имя поставщика" TextChanged="firstnamepost_TextChanged"/>
+            <TextBox Name="middlenamepost" Margin="9,127,334,202" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontSize="18" FontWeight="Bold" FontFamily="Century Gothic" Foreground="#010101" MaxLength="25"
+                materialDesign:HintAssist.Hint="Отчество поставщика" TextChanged="middlenamepost_TextChanged"/>
+            <ComboBox Name="productcombo" Margin="230,45,111,274" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101" Style="{StaticResource MaterialDesignFloatingHintComboBox}"
+              materialDesign:HintAssist.Hint="Продукция" Height="45"/>
+            <TextBox Name="quantitydocument" Margin="232,90,111,239" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontSize="18" FontWeight="Bold" FontFamily="Century Gothic" Foreground="#010101"
+                materialDesign:HintAssist.Hint="Количество" TextChanged="quantitydocument_TextChanged"/>
+            <DatePicker Name="datedocument" Foreground="#010101" materialDesign:TextFieldAssist.UnderlineBrush="#010101" FontWeight="Bold" Margin="230,115,111,202" Style="{StaticResource MaterialDesignFloatingHintDatePicker}" FontSize="18" FontFamily="Century Gothic" SelectedDateFormat="Short" materialDesign:HintAssist.Hint="Дата документа" Height="47"/>
+            <DataGrid Name="datadocument" BorderBrush="#010101" BorderThickness="1" IsReadOnly="True" HorizontalAlignment="Left" Height="135" Margin="10,174,0,0" VerticalAlignment="Top" Width="483" SelectionChanged="datadocument_SelectionChanged"/>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="503,166,10,150" Click="RefreshDocument_Click">
+                <materialDesign:PackIcon Kind="Refresh" />
+            </Button>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101"  Margin="503,214,10,102" Click="AddDocument_Click">
+                <materialDesign:PackIcon Kind="Add" />
+            </Button>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="503,262,10,54" Click="DeleteDocument_Click">
+                <materialDesign:PackIcon Kind="Delete" />
+            </Button>
+            <TextBlock Name="vsegotxt" Margin="10,315,158,10" FontWeight="Bold" FontSize="18" FontFamily="Century Gothic" Foreground="#010101"/>
+        </Grid>
+        <Grid Name="gridtraffic" Margin="229,76,10,9.6" Visibility="Hidden">
+            <Border BorderBrush="#010101" BorderThickness="1" CornerRadius="20,20,20,20"/>
+            <Label Content="Движение" FontWeight="Bold" HorizontalContentAlignment="Center" Foreground="#010101" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center"  Width="561" Margin="0,26,0,285"/>
+            <TextBlock Name="idtraffictxt" Visibility="Hidden"/>
+            <DataGrid Name="datatraffic" IsReadOnly="True" BorderBrush="#010101" BorderThickness="1" HorizontalAlignment="Left" Height="241" Margin="10,113,0,0" VerticalAlignment="Top" Width="493" SelectionChanged="datatraffic_SelectionChanged"/>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="508,192,5,124" Click="RefreshTraffic_Click">
+                <materialDesign:PackIcon Kind="Delete" />
+            </Button>
+            <Button Style="{StaticResource MaterialDesignIconButton}" Foreground="#010101" Margin="508,144,5,172" Click="DeleteTraffic_Click">
+                <materialDesign:PackIcon Kind="Refresh" />
+            </Button>
+        </Grid>
+    </Grid>
+</Window>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 660 - 0
SkladProject/WorkerWindow.xaml.cs


+ 5 - 0
SkladProject/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="MaterialDesignColors" version="2.0.0" targetFramework="net472" />
+  <package id="MaterialDesignThemes" version="4.0.0" targetFramework="net472" />
+</packages>