Bläddra i källkod

Добавил окно Авторизации, изменил его стиль.

gr672_lii 5 år sedan
förälder
incheckning
7733c48c04

+ 1 - 1
CopyCenter/App.xaml

@@ -4,6 +4,6 @@
              xmlns:local="clr-namespace:CopyCenter"
              StartupUri="MainWindow.xaml">
     <Application.Resources>
-         
+        <ResourceDictionary Source="Style.xaml"/>
     </Application.Resources>
 </Application>

+ 29 - 0
CopyCenter/CategoryService.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CopyCenter
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class CategoryService
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public CategoryService()
+        {
+            this.Service = new HashSet<Service>();
+        }
+    
+        public int idCategory { get; set; }
+        public string NameCategory { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<Service> Service { get; set; }
+    }
+}

+ 4 - 0
CopyCenter/CopyCenter.csproj

@@ -115,6 +115,10 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="Style.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">

+ 1 - 1
CopyCenter/DataBase.Designer.cs

@@ -1,4 +1,4 @@
-// Создание кода T4 для модели "Z:\ТИС\CopyCenter\CopyCenter\DataBase.edmx" включено. 
+// Создание кода T4 для модели "C:\Users\gr672_lii\Source\Repos\CopyCenter\CopyCenter\DataBase.edmx" включено. 
 // Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
 // на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
 // открыта в конструкторе.

+ 1 - 1
CopyCenter/DataBase.edmx

@@ -332,7 +332,7 @@
           <Property Name="Password" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
           <Property Name="LastName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
           <Property Name="FirstName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="true" />
           <Property Name="ContactNumber" Type="Int32" Nullable="false" />
           <Property Name="Role" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
           <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Order_User" FromRole="User" ToRole="Order" />

+ 8 - 8
CopyCenter/DataBase.edmx.diagram

@@ -5,14 +5,14 @@
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
       <Diagram DiagramId="6fd677cfeb9943bcb0063ba440d527c7" Name="Diagram1">
-        <EntityTypeShape EntityType="gr672_liiModel.Card" Width="1.5" PointX="3" PointY="7.875" />
-        <EntityTypeShape EntityType="gr672_liiModel.CategoryService" Width="1.5" PointX="3.25" PointY="11.875" />
-        <EntityTypeShape EntityType="gr672_liiModel.Client" Width="1.5" PointX="3.375" PointY="3.75" />
-        <EntityTypeShape EntityType="gr672_liiModel.Discount" Width="1.5" PointX="8" PointY="3.5" />
-        <EntityTypeShape EntityType="gr672_liiModel.Order" Width="1.5" PointX="6.25" PointY="1.375" />
-        <EntityTypeShape EntityType="gr672_liiModel.Payment" Width="1.5" PointX="8.375" PointY="8.875" />
-        <EntityTypeShape EntityType="gr672_liiModel.Service" Width="1.5" PointX="6.5" PointY="9.5" />
-        <EntityTypeShape EntityType="gr672_liiModel.User" Width="1.5" PointX="0.75" PointY="7.875" />
+        <EntityTypeShape EntityType="gr672_liiModel.Card" Width="1.5" PointX="4.375" PointY="0.625" />
+        <EntityTypeShape EntityType="gr672_liiModel.CategoryService" Width="1.5" PointX="1.125" PointY="10.375" />
+        <EntityTypeShape EntityType="gr672_liiModel.Client" Width="1.5" PointX="1.375" PointY="3.875" />
+        <EntityTypeShape EntityType="gr672_liiModel.Discount" Width="1.5" PointX="10" PointY="2" />
+        <EntityTypeShape EntityType="gr672_liiModel.Order" Width="1.5" PointX="6.375" PointY="4" />
+        <EntityTypeShape EntityType="gr672_liiModel.Payment" Width="1.5" PointX="7.875" PointY="8.25" />
+        <EntityTypeShape EntityType="gr672_liiModel.Service" Width="1.5" PointX="4.125" PointY="9.875" />
+        <EntityTypeShape EntityType="gr672_liiModel.User" Width="1.5" PointX="11" PointY="8.875" />
         <AssociationConnector Association="gr672_liiModel.FK_Card_Client" />
         <AssociationConnector Association="gr672_liiModel.FK_Service_CategoryService" />
         <AssociationConnector Association="gr672_liiModel.FK_Order_Client" />

+ 16 - 2
CopyCenter/MainWindow.xaml

@@ -5,8 +5,22 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:CopyCenter"
         mc:Ignorable="d"
-        Title="MainWindow" Height="350" Width="800">
+        Title="Авторизация" Height="150" Width="300" WindowStartupLocation="CenterScreen">
     <Grid>
-        
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <TextBlock Text="Логин"/>
+        <TextBlock Text="Пароль" Grid.Row="1"/>
+        <TextBox Name="login" Grid.Column="1" Grid.Row="0"/>
+        <PasswordBox Name="password" Grid.Column="1" Grid.Row="1"/>
+        <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Content="Войти" Click="AuthorizationClick"/>
+
     </Grid>
 </Window>

+ 24 - 0
CopyCenter/Style.xaml

@@ -0,0 +1,24 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:CopyCenter">
+
+    <Style TargetType="Button">
+        <Setter Property="Margin" Value="5"/>
+    </Style>
+    <Style TargetType="TextBox">
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Margin" Value="5"/>
+    </Style>
+    <Style TargetType="PasswordBox">
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Margin" Value="5"/>
+    </Style>
+    <Style TargetType="TextBlock">
+        <Setter Property="HorizontalAlignment" Value="Center"/>
+        <Setter Property="VerticalAlignment" Value="Center"/>
+        <Setter Property="Margin" Value="5"/>
+    </Style>
+    
+</ResourceDictionary>