Jelajahi Sumber

мелкие правки, добавление вопроса "забыл пароль"

Oleg Kireev 3 tahun lalu
induk
melakukan
2d306c3f38

+ 2 - 1
Hotel_Course_Project/AuthorizationWindow.xaml

@@ -22,6 +22,7 @@
         <TextBlock Grid.Row="1">Пароль</TextBlock>
         <TextBox x:Name="Login" Grid.Column="1"></TextBox>
         <PasswordBox x:Name="Password" Grid.Column="1" Grid.Row="1"></PasswordBox>
-        <Button Grid.Row="2" Grid.ColumnSpan="2" Name="AuthBtn" Click="AuthBtn_Click" IsDefault="True">Авторизоваться</Button>
+        <Button Grid.Row="2" Name="AuthBtn" Click="AuthBtn_Click" IsDefault="True">Войти</Button>
+        <Button Grid.Row="2" Grid.Column="1" Name="LostPass" Click="LostPass_Click" >Забыли пароль?</Button>
     </Grid>
 </Window>

+ 5 - 2
Hotel_Course_Project/AuthorizationWindow.xaml.cs

@@ -56,11 +56,14 @@ namespace Hotel_Course_Project
                 return false;
             }
         }
-
-
         private void Window_Loaded(object sender, RoutedEventArgs e)
         {
             Login.Focus();
         }
+
+        private void LostPass_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 29 - 0
Hotel_Course_Project/HelpQuestion.cs

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

+ 3 - 0
Hotel_Course_Project/Hotel_Course_Project.csproj

@@ -83,6 +83,9 @@
     </Compile>
     <Compile Include="DataBase.cs" />
     <Compile Include="Helper.cs" />
+    <Compile Include="HelpQuestion.cs">
+      <DependentUpon>ModelDB.tt</DependentUpon>
+    </Compile>
     <Compile Include="HostelsPage.xaml.cs">
       <DependentUpon>HostelsPage.xaml</DependentUpon>
     </Compile>

+ 5 - 1
Hotel_Course_Project/MainWindow.xaml.cs

@@ -22,7 +22,11 @@ namespace Hotel_Course_Project
                 case 2:
                     MainFrame.Navigate(new HostelsPage(user));
                     break;
-            }            
+            }
+            if (user.Id_HelpQuestion == null)
+            {
+                
+            }
         }
 
         private void MainFrame_ContentRendered(object sender, EventArgs e)

+ 1 - 0
Hotel_Course_Project/ModelDB.Context.cs

@@ -36,5 +36,6 @@ namespace Hotel_Course_Project
         public virtual DbSet<PayType> PayType { get; set; }
         public virtual DbSet<PersStasus> PersStasus { get; set; }
         public virtual DbSet<OrderStatus> OrderStatus { get; set; }
+        public virtual DbSet<HelpQuestion> HelpQuestion { get; set; }
     }
 }

+ 1 - 1
Hotel_Course_Project/ModelDB.Designer.cs

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

+ 64 - 0
Hotel_Course_Project/ModelDB.edmx

@@ -16,6 +16,13 @@
           <Property Name="Passport" Type="image" />
           <Property Name="Id_PersStatus" Type="int" Nullable="false" />
         </EntityType>
+        <EntityType Name="HelpQuestion">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Name" Type="nvarchar" MaxLength="50" />
+        </EntityType>
         <EntityType Name="Order">
           <Key>
             <PropertyRef Name="Id" />
@@ -89,6 +96,8 @@
           <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Password" Type="nvarchar(max)" Nullable="false" />
           <Property Name="Id_PersStatus" Type="int" Nullable="false" />
+          <Property Name="Id_HelpQuestion" Type="int" />
+          <Property Name="AnswerOnHelpQuestion" Type="nvarchar(max)" />
         </EntityType>
         <EntityType Name="StaffRole">
           <Key>
@@ -203,6 +212,18 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_Staff_HelpQuestion">
+          <End Role="HelpQuestion" Type="Self.HelpQuestion" Multiplicity="0..1" />
+          <End Role="Staff" Type="Self.Staff" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="HelpQuestion">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="Staff">
+              <PropertyRef Name="Id_HelpQuestion" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Staff_PersStasus">
           <End Role="PersStasus" Type="Self.PersStasus" Multiplicity="1" />
           <End Role="Staff" Type="Self.Staff" Multiplicity="*" />
@@ -229,6 +250,7 @@
         </Association>
         <EntityContainer Name="Хранилище gr692_kovModelContainer">
           <EntitySet Name="Client" EntityType="Self.Client" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="HelpQuestion" EntityType="Self.HelpQuestion" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Order" EntityType="Self.Order" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="OrderStatus" EntityType="Self.OrderStatus" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Pay" EntityType="Self.Pay" Schema="dbo" store:Type="Tables" />
@@ -271,6 +293,10 @@
             <End Role="RoomStatus" EntitySet="RoomStatus" />
             <End Role="Room" EntitySet="Room" />
           </AssociationSet>
+          <AssociationSet Name="FK_Staff_HelpQuestion" Association="Self.FK_Staff_HelpQuestion">
+            <End Role="HelpQuestion" EntitySet="HelpQuestion" />
+            <End Role="Staff" EntitySet="Staff" />
+          </AssociationSet>
           <AssociationSet Name="FK_Staff_PersStasus" Association="Self.FK_Staff_PersStasus">
             <End Role="PersStasus" EntitySet="PersStasus" />
             <End Role="Staff" EntitySet="Staff" />
@@ -351,6 +377,9 @@
           <NavigationProperty Name="StaffRole" Relationship="Self.FK_Staff_StaffRole" FromRole="Staff" ToRole="StaffRole" />
           <Property Name="Id_PersStatus" Type="Int32" Nullable="false" />
           <NavigationProperty Name="PersStasus" Relationship="gr692_kovModel.FK_Staff_PersStasus" FromRole="Staff" ToRole="PersStasus" />
+          <Property Name="Id_HelpQuestion" Type="Int32" />
+          <Property Name="AnswerOnHelpQuestion" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="HelpQuestion" Relationship="gr692_kovModel.FK_Staff_HelpQuestion" FromRole="Staff" ToRole="HelpQuestion" />
         </EntityType>
         <EntityType Name="StaffRole">
           <Key>
@@ -482,6 +511,11 @@
             <End Role="OrderStatus" EntitySet="OrderStatus" />
             <End Role="Order" EntitySet="Order" />
           </AssociationSet>
+          <EntitySet Name="HelpQuestion" EntityType="gr692_kovModel.HelpQuestion" />
+          <AssociationSet Name="FK_Staff_HelpQuestion" Association="gr692_kovModel.FK_Staff_HelpQuestion">
+            <End Role="HelpQuestion" EntitySet="HelpQuestion" />
+            <End Role="Staff" EntitySet="Staff" />
+          </AssociationSet>
         </EntityContainer>
         <EntityType Name="Pay">
           <Key>
@@ -579,6 +613,26 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="HelpQuestion">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="Staff" Relationship="gr692_kovModel.FK_Staff_HelpQuestion" FromRole="HelpQuestion" ToRole="Staff" />
+        </EntityType>
+        <Association Name="FK_Staff_HelpQuestion">
+          <End Type="gr692_kovModel.HelpQuestion" Role="HelpQuestion" Multiplicity="0..1" />
+          <End Type="gr692_kovModel.Staff" Role="Staff" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="HelpQuestion">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="Staff">
+              <PropertyRef Name="Id_HelpQuestion" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
       </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
@@ -633,6 +687,8 @@
           <EntitySetMapping Name="Staff">
             <EntityTypeMapping TypeName="gr692_kovModel.Staff">
               <MappingFragment StoreEntitySet="Staff">
+                <ScalarProperty Name="AnswerOnHelpQuestion" ColumnName="AnswerOnHelpQuestion" />
+                <ScalarProperty Name="Id_HelpQuestion" ColumnName="Id_HelpQuestion" />
                 <ScalarProperty Name="Id_PersStatus" ColumnName="Id_PersStatus" />
                 <ScalarProperty Name="Id" ColumnName="Id" />
                 <ScalarProperty Name="LName" ColumnName="LName" />
@@ -698,6 +754,14 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="HelpQuestion">
+            <EntityTypeMapping TypeName="gr692_kovModel.HelpQuestion">
+              <MappingFragment StoreEntitySet="HelpQuestion">
+                <ScalarProperty Name="Name" ColumnName="Name" />
+                <ScalarProperty Name="id" ColumnName="id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
         </EntityContainerMapping>
       </Mapping>
     </edmx:Mappings>

+ 2 - 0
Hotel_Course_Project/ModelDB.edmx.diagram

@@ -26,6 +26,8 @@
         <AssociationConnector Association="gr692_kovModel.FK_Staff_PersStasus" />
         <EntityTypeShape EntityType="gr692_kovModel.OrderStatus" Width="1.5" PointX="7.375" PointY="0.875" />
         <AssociationConnector Association="gr692_kovModel.FK_Order_OrderStatus" />
+        <EntityTypeShape EntityType="gr692_kovModel.HelpQuestion" Width="1.5" PointX="8.375" PointY="3.875" />
+        <AssociationConnector Association="gr692_kovModel.FK_Staff_HelpQuestion" />
       </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 3 - 0
Hotel_Course_Project/Staff.cs

@@ -29,10 +29,13 @@ namespace Hotel_Course_Project
         public string Login { get; set; }
         public string Password { get; set; }
         public int Id_PersStatus { get; set; }
+        public Nullable<int> Id_HelpQuestion { get; set; }
+        public string AnswerOnHelpQuestion { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<Order> Order { get; set; }
         public virtual StaffRole StaffRole { get; set; }
         public virtual PersStasus PersStasus { get; set; }
+        public virtual HelpQuestion HelpQuestion { get; set; }
     }
 }