Imagara před 2 roky
rodič
revize
13ace1a54e

+ 1 - 1
RaspisKusach/EDM.Designer.cs

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

+ 263 - 263
RaspisKusach/EDM.edmx

@@ -4,187 +4,187 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-    <Schema Namespace="RouteScheduleDataBaseModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
-        <EntityType Name="Carriages">
-          <Key>
-            <PropertyRef Name="IdCarriage" />
-          </Key>
-          <Property Name="IdCarriage" Type="int" Nullable="false" />
-          <Property Name="Count" Type="int" Nullable="false" />
-        </EntityType>
-        <EntityType Name="Routes">
-          <Key>
-            <PropertyRef Name="IdRoute" />
-          </Key>
-          <Property Name="IdRoute" Type="int" Nullable="false" />
-          <Property Name="IdTrain" Type="int" Nullable="false" />
-          <Property Name="Departure_Date" Type="datetime" Nullable="false" />
-          <Property Name="Arrival_Date" Type="datetime" Nullable="false" />
-        </EntityType>
-        <EntityType Name="RoutesStations">
-          <Key>
-            <PropertyRef Name="IdRouteStation" />
-          </Key>
-          <Property Name="IdRouteStation" Type="int" Nullable="false" />
-          <Property Name="IdRoute" Type="int" Nullable="false" />
-          <Property Name="IdStation" Type="int" Nullable="false" />
-        </EntityType>
-        <EntityType Name="Station">
-          <Key>
-            <PropertyRef Name="IdStation" />
-          </Key>
-          <Property Name="IdStation" Type="int" Nullable="false" />
-          <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="Location" Type="nvarchar" MaxLength="50" Nullable="false" />
-        </EntityType>
-        <EntityType Name="sysdiagrams">
-          <Key>
-            <PropertyRef Name="diagram_id" />
-          </Key>
-          <Property Name="name" Type="nvarchar" MaxLength="128" Nullable="false" />
-          <Property Name="principal_id" Type="int" Nullable="false" />
-          <Property Name="diagram_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="version" Type="int" />
-          <Property Name="definition" Type="varbinary(max)" />
-        </EntityType>
-        <EntityType Name="Tickets">
-          <Key>
-            <PropertyRef Name="IdTicket" />
-          </Key>
-          <Property Name="IdTicket" Type="int" Nullable="false" />
-          <Property Name="IdUser" Type="int" Nullable="false" />
-          <Property Name="IdRoute" Type="int" Nullable="false" />
-          <Property Name="IdCarriage" Type="int" Nullable="false" />
-          <Property Name="PlaceNumber" Type="int" Nullable="false" />
-          <Property Name="Category" Type="int" Nullable="false" />
-          <Property Name="BuyDate" Type="datetime" Nullable="false" />
-        </EntityType>
-        <EntityType Name="Trains">
-          <Key>
-            <PropertyRef Name="IdTrain" />
-          </Key>
-          <Property Name="IdTrain" Type="int" Nullable="false" />
-          <Property Name="NameOfTrain" Type="nvarchar" MaxLength="50" Nullable="false" />
-        </EntityType>
-        <EntityType Name="Users">
-          <Key>
-            <PropertyRef Name="IdUser" />
-          </Key>
-          <Property Name="IdUser" Type="int" Nullable="false" />
-          <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="Passport" Type="nvarchar" MaxLength="10" />
-          <Property Name="Surname" Type="nvarchar" MaxLength="50" />
-          <Property Name="Name" Type="nvarchar" MaxLength="50" />
-          <Property Name="Patronymic" Type="nvarchar" MaxLength="50" />
-        </EntityType>
-        <Association Name="FK_Routes_Trains">
-          <End Role="Trains" Type="Self.Trains" Multiplicity="1" />
-          <End Role="Routes" Type="Self.Routes" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Trains">
-              <PropertyRef Name="IdTrain" />
-            </Principal>
-            <Dependent Role="Routes">
-              <PropertyRef Name="IdTrain" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_RoutesStations_Routes">
-          <End Role="Routes" Type="Self.Routes" Multiplicity="1" />
-          <End Role="RoutesStations" Type="Self.RoutesStations" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Routes">
-              <PropertyRef Name="IdRoute" />
-            </Principal>
-            <Dependent Role="RoutesStations">
-              <PropertyRef Name="IdRoute" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_RoutesStations_Station">
-          <End Role="Station" Type="Self.Station" Multiplicity="1" />
-          <End Role="RoutesStations" Type="Self.RoutesStations" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Station">
-              <PropertyRef Name="IdStation" />
-            </Principal>
-            <Dependent Role="RoutesStations">
-              <PropertyRef Name="IdStation" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_Tickets_Carriages">
-          <End Role="Carriages" Type="Self.Carriages" Multiplicity="1" />
-          <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Carriages">
-              <PropertyRef Name="IdCarriage" />
-            </Principal>
-            <Dependent Role="Tickets">
-              <PropertyRef Name="IdCarriage" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_Tickets_Routes">
-          <End Role="Routes" Type="Self.Routes" Multiplicity="1" />
-          <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Routes">
-              <PropertyRef Name="IdRoute" />
-            </Principal>
-            <Dependent Role="Tickets">
-              <PropertyRef Name="IdRoute" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_Tickets_Users">
-          <End Role="Users" Type="Self.Users" Multiplicity="1" />
-          <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Users">
-              <PropertyRef Name="IdUser" />
-            </Principal>
-            <Dependent Role="Tickets">
-              <PropertyRef Name="IdUser" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <EntityContainer Name="RouteScheduleDataBaseModelStoreContainer">
-          <EntitySet Name="Carriages" EntityType="Self.Carriages" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="Routes" EntityType="Self.Routes" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="RoutesStations" EntityType="Self.RoutesStations" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="Station" EntityType="Self.Station" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="Tickets" EntityType="Self.Tickets" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="Trains" EntityType="Self.Trains" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="Users" EntityType="Self.Users" Schema="dbo" store:Type="Tables" />
-          <AssociationSet Name="FK_Routes_Trains" Association="Self.FK_Routes_Trains">
-            <End Role="Trains" EntitySet="Trains" />
-            <End Role="Routes" EntitySet="Routes" />
-          </AssociationSet>
-          <AssociationSet Name="FK_RoutesStations_Routes" Association="Self.FK_RoutesStations_Routes">
-            <End Role="Routes" EntitySet="Routes" />
-            <End Role="RoutesStations" EntitySet="RoutesStations" />
-          </AssociationSet>
-          <AssociationSet Name="FK_RoutesStations_Station" Association="Self.FK_RoutesStations_Station">
-            <End Role="Station" EntitySet="Station" />
-            <End Role="RoutesStations" EntitySet="RoutesStations" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Tickets_Carriages" Association="Self.FK_Tickets_Carriages">
-            <End Role="Carriages" EntitySet="Carriages" />
-            <End Role="Tickets" EntitySet="Tickets" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Tickets_Routes" Association="Self.FK_Tickets_Routes">
-            <End Role="Routes" EntitySet="Routes" />
-            <End Role="Tickets" EntitySet="Tickets" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Tickets_Users" Association="Self.FK_Tickets_Users">
-            <End Role="Users" EntitySet="Users" />
-            <End Role="Tickets" EntitySet="Tickets" />
-          </AssociationSet>
-        </EntityContainer>
-      </Schema></edmx:StorageModels>
+    <Schema Namespace="RouteScheduleDataBaseModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2012" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
+  <EntityContainer Name="RouteScheduleDataBaseModelStoreContainer">
+    <EntitySet Name="Carriages" EntityType="RouteScheduleDataBaseModel.Store.Carriages" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="Routes" EntityType="RouteScheduleDataBaseModel.Store.Routes" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="RoutesStations" EntityType="RouteScheduleDataBaseModel.Store.RoutesStations" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="Station" EntityType="RouteScheduleDataBaseModel.Store.Station" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="sysdiagrams" EntityType="RouteScheduleDataBaseModel.Store.sysdiagrams" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="Tickets" EntityType="RouteScheduleDataBaseModel.Store.Tickets" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="Trains" EntityType="RouteScheduleDataBaseModel.Store.Trains" store:Type="Tables" Schema="dbo" />
+    <EntitySet Name="Users" EntityType="RouteScheduleDataBaseModel.Store.Users" store:Type="Tables" Schema="dbo" />
+    <AssociationSet Name="FK_Tickets_Carriages" Association="RouteScheduleDataBaseModel.Store.FK_Tickets_Carriages">
+      <End Role="Carriages" EntitySet="Carriages" />
+      <End Role="Tickets" EntitySet="Tickets" />
+    </AssociationSet>
+    <AssociationSet Name="FK_Routes_Trains" Association="RouteScheduleDataBaseModel.Store.FK_Routes_Trains">
+      <End Role="Trains" EntitySet="Trains" />
+      <End Role="Routes" EntitySet="Routes" />
+    </AssociationSet>
+    <AssociationSet Name="FK_RoutesStations_Routes" Association="RouteScheduleDataBaseModel.Store.FK_RoutesStations_Routes">
+      <End Role="Routes" EntitySet="Routes" />
+      <End Role="RoutesStations" EntitySet="RoutesStations" />
+    </AssociationSet>
+    <AssociationSet Name="FK_Tickets_Routes" Association="RouteScheduleDataBaseModel.Store.FK_Tickets_Routes">
+      <End Role="Routes" EntitySet="Routes" />
+      <End Role="Tickets" EntitySet="Tickets" />
+    </AssociationSet>
+    <AssociationSet Name="FK_RoutesStations_Station" Association="RouteScheduleDataBaseModel.Store.FK_RoutesStations_Station">
+      <End Role="Station" EntitySet="Station" />
+      <End Role="RoutesStations" EntitySet="RoutesStations" />
+    </AssociationSet>
+    <AssociationSet Name="FK_Tickets_Users" Association="RouteScheduleDataBaseModel.Store.FK_Tickets_Users">
+      <End Role="Users" EntitySet="Users" />
+      <End Role="Tickets" EntitySet="Tickets" />
+    </AssociationSet>
+  </EntityContainer>
+  <EntityType Name="Carriages">
+    <Key>
+      <PropertyRef Name="IdCarriage" />
+    </Key>
+    <Property Name="IdCarriage" Type="int" Nullable="false" />
+    <Property Name="Count" Type="int" Nullable="false" />
+  </EntityType>
+  <EntityType Name="Routes">
+    <Key>
+      <PropertyRef Name="IdRoute" />
+    </Key>
+    <Property Name="IdRoute" Type="int" Nullable="false" />
+    <Property Name="IdTrain" Type="int" Nullable="false" />
+    <Property Name="Departure_Date" Type="datetime" Nullable="false" />
+    <Property Name="Arrival_Date" Type="datetime" Nullable="false" />
+  </EntityType>
+  <EntityType Name="RoutesStations">
+    <Key>
+      <PropertyRef Name="IdRouteStation" />
+    </Key>
+    <Property Name="IdRouteStation" Type="int" Nullable="false" />
+    <Property Name="IdRoute" Type="int" Nullable="false" />
+    <Property Name="IdStation" Type="int" Nullable="false" />
+  </EntityType>
+  <EntityType Name="Station">
+    <Key>
+      <PropertyRef Name="IdStation" />
+    </Key>
+    <Property Name="IdStation" Type="int" Nullable="false" />
+    <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" />
+    <Property Name="Location" Type="nvarchar" Nullable="false" MaxLength="50" />
+  </EntityType>
+  <EntityType Name="sysdiagrams">
+    <Key>
+      <PropertyRef Name="diagram_id" />
+    </Key>
+    <Property Name="name" Type="nvarchar" Nullable="false" MaxLength="128" />
+    <Property Name="principal_id" Type="int" Nullable="false" />
+    <Property Name="diagram_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+    <Property Name="version" Type="int" Nullable="true" />
+    <Property Name="definition" Type="varbinary(max)" Nullable="true" />
+  </EntityType>
+  <EntityType Name="Tickets">
+    <Key>
+      <PropertyRef Name="IdTicket" />
+    </Key>
+    <Property Name="IdTicket" Type="int" Nullable="false" />
+    <Property Name="IdUser" Type="int" Nullable="false" />
+    <Property Name="IdRoute" Type="int" Nullable="false" />
+    <Property Name="IdCarriage" Type="int" Nullable="false" />
+    <Property Name="PlaceNumber" Type="int" Nullable="false" />
+    <Property Name="Category" Type="int" Nullable="false" />
+    <Property Name="BuyDate" Type="datetime" Nullable="false" />
+  </EntityType>
+  <EntityType Name="Trains">
+    <Key>
+      <PropertyRef Name="IdTrain" />
+    </Key>
+    <Property Name="IdTrain" Type="int" Nullable="false" />
+    <Property Name="NameOfTrain" Type="nvarchar" Nullable="false" MaxLength="50" />
+  </EntityType>
+  <EntityType Name="Users">
+    <Key>
+      <PropertyRef Name="IdUser" />
+    </Key>
+    <Property Name="IdUser" Type="int" Nullable="false" />
+    <Property Name="Login" Type="nvarchar" Nullable="false" MaxLength="50" />
+    <Property Name="Password" Type="nvarchar" Nullable="false" MaxLength="50" />
+    <Property Name="Passport" Type="nvarchar" Nullable="true" MaxLength="10" />
+    <Property Name="Surname" Type="nvarchar" Nullable="true" MaxLength="50" />
+    <Property Name="Name" Type="nvarchar" Nullable="true" MaxLength="50" />
+    <Property Name="Patronymic" Type="nvarchar" Nullable="true" MaxLength="50" />
+  </EntityType>
+  <Association Name="FK_Tickets_Carriages">
+    <End Role="Carriages" Type="RouteScheduleDataBaseModel.Store.Carriages" Multiplicity="1" />
+    <End Role="Tickets" Type="RouteScheduleDataBaseModel.Store.Tickets" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Carriages">
+        <PropertyRef Name="IdCarriage" />
+      </Principal>
+      <Dependent Role="Tickets">
+        <PropertyRef Name="IdCarriage" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_Routes_Trains">
+    <End Role="Trains" Type="RouteScheduleDataBaseModel.Store.Trains" Multiplicity="1" />
+    <End Role="Routes" Type="RouteScheduleDataBaseModel.Store.Routes" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Trains">
+        <PropertyRef Name="IdTrain" />
+      </Principal>
+      <Dependent Role="Routes">
+        <PropertyRef Name="IdTrain" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_RoutesStations_Routes">
+    <End Role="Routes" Type="RouteScheduleDataBaseModel.Store.Routes" Multiplicity="1" />
+    <End Role="RoutesStations" Type="RouteScheduleDataBaseModel.Store.RoutesStations" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Routes">
+        <PropertyRef Name="IdRoute" />
+      </Principal>
+      <Dependent Role="RoutesStations">
+        <PropertyRef Name="IdRoute" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_Tickets_Routes">
+    <End Role="Routes" Type="RouteScheduleDataBaseModel.Store.Routes" Multiplicity="1" />
+    <End Role="Tickets" Type="RouteScheduleDataBaseModel.Store.Tickets" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Routes">
+        <PropertyRef Name="IdRoute" />
+      </Principal>
+      <Dependent Role="Tickets">
+        <PropertyRef Name="IdRoute" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_RoutesStations_Station">
+    <End Role="Station" Type="RouteScheduleDataBaseModel.Store.Station" Multiplicity="1" />
+    <End Role="RoutesStations" Type="RouteScheduleDataBaseModel.Store.RoutesStations" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Station">
+        <PropertyRef Name="IdStation" />
+      </Principal>
+      <Dependent Role="RoutesStations">
+        <PropertyRef Name="IdStation" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_Tickets_Users">
+    <End Role="Users" Type="RouteScheduleDataBaseModel.Store.Users" Multiplicity="1" />
+    <End Role="Tickets" Type="RouteScheduleDataBaseModel.Store.Tickets" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Users">
+        <PropertyRef Name="IdUser" />
+      </Principal>
+      <Dependent Role="Tickets">
+        <PropertyRef Name="IdUser" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+</Schema></edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
       <Schema Namespace="RouteScheduleDataBaseModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
@@ -385,88 +385,88 @@
     <edmx:Mappings>
     <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
   <EntityContainerMapping StorageEntityContainer="RouteScheduleDataBaseModelStoreContainer" CdmEntityContainer="RouteScheduleDataBaseEntities">
-          <EntitySetMapping Name="Carriages">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Carriages">
-              <MappingFragment StoreEntitySet="Carriages">
-                <ScalarProperty Name="Count" ColumnName="Count" />
-                <ScalarProperty Name="IdCarriage" ColumnName="IdCarriage" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Routes">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Routes">
-              <MappingFragment StoreEntitySet="Routes">
-                <ScalarProperty Name="Arrival_Date" ColumnName="Arrival_Date" />
-                <ScalarProperty Name="Departure_Date" ColumnName="Departure_Date" />
-                <ScalarProperty Name="IdTrain" ColumnName="IdTrain" />
-                <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="RoutesStations">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.RoutesStations">
-              <MappingFragment StoreEntitySet="RoutesStations">
-                <ScalarProperty Name="IdStation" ColumnName="IdStation" />
-                <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
-                <ScalarProperty Name="IdRouteStation" ColumnName="IdRouteStation" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Station">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Station">
-              <MappingFragment StoreEntitySet="Station">
-                <ScalarProperty Name="Location" ColumnName="Location" />
-                <ScalarProperty Name="Name" ColumnName="Name" />
-                <ScalarProperty Name="IdStation" ColumnName="IdStation" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="sysdiagrams">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.sysdiagrams">
-              <MappingFragment StoreEntitySet="sysdiagrams">
-                <ScalarProperty Name="definition" ColumnName="definition" />
-                <ScalarProperty Name="version" ColumnName="version" />
-                <ScalarProperty Name="diagram_id" ColumnName="diagram_id" />
-                <ScalarProperty Name="principal_id" ColumnName="principal_id" />
-                <ScalarProperty Name="name" ColumnName="name" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Tickets">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Tickets">
-              <MappingFragment StoreEntitySet="Tickets">
-                <ScalarProperty Name="BuyDate" ColumnName="BuyDate" />
-                <ScalarProperty Name="Category" ColumnName="Category" />
-                <ScalarProperty Name="PlaceNumber" ColumnName="PlaceNumber" />
-                <ScalarProperty Name="IdCarriage" ColumnName="IdCarriage" />
-                <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
-                <ScalarProperty Name="IdUser" ColumnName="IdUser" />
-                <ScalarProperty Name="IdTicket" ColumnName="IdTicket" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Trains">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Trains">
-              <MappingFragment StoreEntitySet="Trains">
-                <ScalarProperty Name="NameOfTrain" ColumnName="NameOfTrain" />
-                <ScalarProperty Name="IdTrain" ColumnName="IdTrain" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Users">
-            <EntityTypeMapping TypeName="RouteScheduleDataBaseModel.Users">
-              <MappingFragment StoreEntitySet="Users">
-                <ScalarProperty Name="Patronymic" ColumnName="Patronymic" />
-                <ScalarProperty Name="Name" ColumnName="Name" />
-                <ScalarProperty Name="Surname" ColumnName="Surname" />
-                <ScalarProperty Name="Passport" ColumnName="Passport" />
-                <ScalarProperty Name="Password" ColumnName="Password" />
-                <ScalarProperty Name="Login" ColumnName="Login" />
-                <ScalarProperty Name="IdUser" ColumnName="IdUser" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-        </EntityContainerMapping>
+    <EntitySetMapping Name="Carriages">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Carriages)">
+        <MappingFragment StoreEntitySet="Carriages">
+          <ScalarProperty Name="IdCarriage" ColumnName="IdCarriage" />
+          <ScalarProperty Name="Count" ColumnName="Count" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Routes">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Routes)">
+        <MappingFragment StoreEntitySet="Routes">
+          <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
+          <ScalarProperty Name="IdTrain" ColumnName="IdTrain" />
+          <ScalarProperty Name="Departure_Date" ColumnName="Departure_Date" />
+          <ScalarProperty Name="Arrival_Date" ColumnName="Arrival_Date" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="RoutesStations">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.RoutesStations)">
+        <MappingFragment StoreEntitySet="RoutesStations">
+          <ScalarProperty Name="IdRouteStation" ColumnName="IdRouteStation" />
+          <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
+          <ScalarProperty Name="IdStation" ColumnName="IdStation" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Station">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Station)">
+        <MappingFragment StoreEntitySet="Station">
+          <ScalarProperty Name="IdStation" ColumnName="IdStation" />
+          <ScalarProperty Name="Name" ColumnName="Name" />
+          <ScalarProperty Name="Location" ColumnName="Location" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="sysdiagrams">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.sysdiagrams)">
+        <MappingFragment StoreEntitySet="sysdiagrams">
+          <ScalarProperty Name="diagram_id" ColumnName="diagram_id" />
+          <ScalarProperty Name="name" ColumnName="name" />
+          <ScalarProperty Name="principal_id" ColumnName="principal_id" />
+          <ScalarProperty Name="version" ColumnName="version" />
+          <ScalarProperty Name="definition" ColumnName="definition" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Tickets">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Tickets)">
+        <MappingFragment StoreEntitySet="Tickets">
+          <ScalarProperty Name="IdTicket" ColumnName="IdTicket" />
+          <ScalarProperty Name="IdUser" ColumnName="IdUser" />
+          <ScalarProperty Name="IdRoute" ColumnName="IdRoute" />
+          <ScalarProperty Name="IdCarriage" ColumnName="IdCarriage" />
+          <ScalarProperty Name="PlaceNumber" ColumnName="PlaceNumber" />
+          <ScalarProperty Name="Category" ColumnName="Category" />
+          <ScalarProperty Name="BuyDate" ColumnName="BuyDate" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Trains">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Trains)">
+        <MappingFragment StoreEntitySet="Trains">
+          <ScalarProperty Name="IdTrain" ColumnName="IdTrain" />
+          <ScalarProperty Name="NameOfTrain" ColumnName="NameOfTrain" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Users">
+      <EntityTypeMapping TypeName="IsTypeOf(RouteScheduleDataBaseModel.Users)">
+        <MappingFragment StoreEntitySet="Users">
+          <ScalarProperty Name="IdUser" ColumnName="IdUser" />
+          <ScalarProperty Name="Login" ColumnName="Login" />
+          <ScalarProperty Name="Password" ColumnName="Password" />
+          <ScalarProperty Name="Passport" ColumnName="Passport" />
+          <ScalarProperty Name="Surname" ColumnName="Surname" />
+          <ScalarProperty Name="Name" ColumnName="Name" />
+          <ScalarProperty Name="Patronymic" ColumnName="Patronymic" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+  </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>
   <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->

+ 173 - 28
RaspisKusach/EDM.edmx.sql

@@ -2,8 +2,8 @@
 -- --------------------------------------------------
 -- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
 -- --------------------------------------------------
+-- Date Created: 07/24/2022 19:15:44
+-- Generated from EDMX file: C:\Users\pc\source\repos\RaspisKusach\RaspisKusach\EDM.edmx
 -- --------------------------------------------------
 
 SET QUOTED_IDENTIFIER OFF;
@@ -17,16 +17,43 @@ GO
 -- Dropping existing FOREIGN KEY constraints
 -- --------------------------------------------------
 
+IF OBJECT_ID(N'[dbo].[FK_Routes_Trains]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Routes] DROP CONSTRAINT [FK_Routes_Trains];
+GO
+IF OBJECT_ID(N'[dbo].[FK_RoutesStations_Routes]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[RoutesStations] DROP CONSTRAINT [FK_RoutesStations_Routes];
+GO
+IF OBJECT_ID(N'[dbo].[FK_RoutesStations_Station]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[RoutesStations] DROP CONSTRAINT [FK_RoutesStations_Station];
+GO
+IF OBJECT_ID(N'[dbo].[FK_Tickets_Carriages]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Tickets] DROP CONSTRAINT [FK_Tickets_Carriages];
+GO
+IF OBJECT_ID(N'[dbo].[FK_Tickets_Routes]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Tickets] DROP CONSTRAINT [FK_Tickets_Routes];
+GO
+IF OBJECT_ID(N'[dbo].[FK_Tickets_Users]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Tickets] DROP CONSTRAINT [FK_Tickets_Users];
+GO
 
 -- --------------------------------------------------
 -- Dropping existing tables
 -- --------------------------------------------------
 
+IF OBJECT_ID(N'[dbo].[Carriages]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Carriages];
+GO
 IF OBJECT_ID(N'[dbo].[Routes]', 'U') IS NOT NULL
     DROP TABLE [dbo].[Routes];
 GO
-IF OBJECT_ID(N'[dbo].[TestTable]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[TestTable];
+IF OBJECT_ID(N'[dbo].[RoutesStations]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[RoutesStations];
+GO
+IF OBJECT_ID(N'[dbo].[Station]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Station];
+GO
+IF OBJECT_ID(N'[dbo].[sysdiagrams]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[sysdiagrams];
 GO
 IF OBJECT_ID(N'[dbo].[Tickets]', 'U') IS NOT NULL
     DROP TABLE [dbo].[Tickets];
@@ -34,9 +61,6 @@ GO
 IF OBJECT_ID(N'[dbo].[Trains]', 'U') IS NOT NULL
     DROP TABLE [dbo].[Trains];
 GO
-IF OBJECT_ID(N'[dbo].[TrainsCarriages]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[TrainsCarriages];
-GO
 IF OBJECT_ID(N'[dbo].[Users]', 'U') IS NOT NULL
     DROP TABLE [dbo].[Users];
 GO
@@ -45,25 +69,45 @@ GO
 -- Creating all tables
 -- --------------------------------------------------
 
+-- Creating table 'Carriages'
+CREATE TABLE [dbo].[Carriages] (
+    [IdCarriage] int  NOT NULL,
+    [Count] int  NOT NULL
+);
+GO
+
 -- Creating table 'Routes'
 CREATE TABLE [dbo].[Routes] (
     [IdRoute] int  NOT NULL,
     [IdTrain] int  NOT NULL,
-    [Departure_Station] nvarchar(50)  NOT NULL,
-    [Arrival_Station] nvarchar(50)  NOT NULL,
     [Departure_Date] datetime  NOT NULL,
     [Arrival_Date] datetime  NOT NULL
 );
 GO
 
-CREATE TABLE [dbo].[TestTable] (
+-- Creating table 'RoutesStations'
+CREATE TABLE [dbo].[RoutesStations] (
+    [IdRouteStation] int  NOT NULL,
     [IdRoute] int  NOT NULL,
-    [IdTrain] int  NOT NULL,
-    [Departure] nvarchar(50)  NOT NULL,
-    [Arrival] nvarchar(50)  NOT NULL,
-    [DepartureDate] datetime  NOT NULL,
-    [ArrivalDate] datetime  NOT NULL
+    [IdStation] int  NOT NULL
+);
+GO
+
+-- Creating table 'Station'
+CREATE TABLE [dbo].[Station] (
+    [IdStation] int  NOT NULL,
+    [Name] nvarchar(50)  NOT NULL,
+    [Location] nvarchar(50)  NOT NULL
+);
+GO
+
+-- Creating table 'sysdiagrams'
+CREATE TABLE [dbo].[sysdiagrams] (
+    [name] nvarchar(128)  NOT NULL,
+    [principal_id] int  NOT NULL,
+    [diagram_id] int IDENTITY(1,1) NOT NULL,
+    [version] int  NULL,
+    [definition] varbinary(max)  NULL
 );
 GO
 
@@ -72,7 +116,7 @@ CREATE TABLE [dbo].[Tickets] (
     [IdTicket] int  NOT NULL,
     [IdUser] int  NOT NULL,
     [IdRoute] int  NOT NULL,
-    [IdTrainCarriage] int  NOT NULL,
+    [IdCarriage] int  NOT NULL,
     [PlaceNumber] int  NOT NULL,
     [Category] int  NOT NULL,
     [BuyDate] datetime  NOT NULL
@@ -86,13 +130,6 @@ CREATE TABLE [dbo].[Trains] (
 );
 GO
 
-CREATE TABLE [dbo].[TrainsCarriages] (
-    [IdCarriage] int  NOT NULL,
-    [Count] int  NOT NULL
-);
-GO
-
 -- Creating table 'Users'
 CREATE TABLE [dbo].[Users] (
     [IdUser] int  NOT NULL,
@@ -109,16 +146,34 @@ GO
 -- Creating all PRIMARY KEY constraints
 -- --------------------------------------------------
 
+-- Creating primary key on [IdCarriage] in table 'Carriages'
+ALTER TABLE [dbo].[Carriages]
+ADD CONSTRAINT [PK_Carriages]
+    PRIMARY KEY CLUSTERED ([IdCarriage] ASC);
+GO
+
 -- Creating primary key on [IdRoute] in table 'Routes'
 ALTER TABLE [dbo].[Routes]
 ADD CONSTRAINT [PK_Routes]
     PRIMARY KEY CLUSTERED ([IdRoute] ASC);
 GO
 
-ALTER TABLE [dbo].[TestTable]
-ADD CONSTRAINT [PK_TestTable]
-    PRIMARY KEY CLUSTERED ([IdRoute] ASC);
+-- Creating primary key on [IdRouteStation] in table 'RoutesStations'
+ALTER TABLE [dbo].[RoutesStations]
+ADD CONSTRAINT [PK_RoutesStations]
+    PRIMARY KEY CLUSTERED ([IdRouteStation] ASC);
+GO
+
+-- Creating primary key on [IdStation] in table 'Station'
+ALTER TABLE [dbo].[Station]
+ADD CONSTRAINT [PK_Station]
+    PRIMARY KEY CLUSTERED ([IdStation] ASC);
+GO
+
+-- Creating primary key on [diagram_id] in table 'sysdiagrams'
+ALTER TABLE [dbo].[sysdiagrams]
+ADD CONSTRAINT [PK_sysdiagrams]
+    PRIMARY KEY CLUSTERED ([diagram_id] ASC);
 GO
 
 -- Creating primary key on [IdTicket] in table 'Tickets'
@@ -133,12 +188,6 @@ ADD CONSTRAINT [PK_Trains]
     PRIMARY KEY CLUSTERED ([IdTrain] ASC);
 GO
 
-ALTER TABLE [dbo].[TrainsCarriages]
-ADD CONSTRAINT [PK_TrainsCarriages]
-    PRIMARY KEY CLUSTERED ([IdCarriage] ASC);
-GO
-
 -- Creating primary key on [IdUser] in table 'Users'
 ALTER TABLE [dbo].[Users]
 ADD CONSTRAINT [PK_Users]
@@ -149,6 +198,96 @@ GO
 -- Creating all FOREIGN KEY constraints
 -- --------------------------------------------------
 
+-- Creating foreign key on [IdCarriage] in table 'Tickets'
+ALTER TABLE [dbo].[Tickets]
+ADD CONSTRAINT [FK_Tickets_Carriages]
+    FOREIGN KEY ([IdCarriage])
+    REFERENCES [dbo].[Carriages]
+        ([IdCarriage])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Tickets_Carriages'
+CREATE INDEX [IX_FK_Tickets_Carriages]
+ON [dbo].[Tickets]
+    ([IdCarriage]);
+GO
+
+-- Creating foreign key on [IdTrain] in table 'Routes'
+ALTER TABLE [dbo].[Routes]
+ADD CONSTRAINT [FK_Routes_Trains]
+    FOREIGN KEY ([IdTrain])
+    REFERENCES [dbo].[Trains]
+        ([IdTrain])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Routes_Trains'
+CREATE INDEX [IX_FK_Routes_Trains]
+ON [dbo].[Routes]
+    ([IdTrain]);
+GO
+
+-- Creating foreign key on [IdRoute] in table 'RoutesStations'
+ALTER TABLE [dbo].[RoutesStations]
+ADD CONSTRAINT [FK_RoutesStations_Routes]
+    FOREIGN KEY ([IdRoute])
+    REFERENCES [dbo].[Routes]
+        ([IdRoute])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_RoutesStations_Routes'
+CREATE INDEX [IX_FK_RoutesStations_Routes]
+ON [dbo].[RoutesStations]
+    ([IdRoute]);
+GO
+
+-- Creating foreign key on [IdRoute] in table 'Tickets'
+ALTER TABLE [dbo].[Tickets]
+ADD CONSTRAINT [FK_Tickets_Routes]
+    FOREIGN KEY ([IdRoute])
+    REFERENCES [dbo].[Routes]
+        ([IdRoute])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Tickets_Routes'
+CREATE INDEX [IX_FK_Tickets_Routes]
+ON [dbo].[Tickets]
+    ([IdRoute]);
+GO
+
+-- Creating foreign key on [IdStation] in table 'RoutesStations'
+ALTER TABLE [dbo].[RoutesStations]
+ADD CONSTRAINT [FK_RoutesStations_Station]
+    FOREIGN KEY ([IdStation])
+    REFERENCES [dbo].[Station]
+        ([IdStation])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_RoutesStations_Station'
+CREATE INDEX [IX_FK_RoutesStations_Station]
+ON [dbo].[RoutesStations]
+    ([IdStation]);
+GO
+
+-- Creating foreign key on [IdUser] in table 'Tickets'
+ALTER TABLE [dbo].[Tickets]
+ADD CONSTRAINT [FK_Tickets_Users]
+    FOREIGN KEY ([IdUser])
+    REFERENCES [dbo].[Users]
+        ([IdUser])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Tickets_Users'
+CREATE INDEX [IX_FK_Tickets_Users]
+ON [dbo].[Tickets]
+    ([IdUser]);
+GO
+
 -- --------------------------------------------------
 -- Script has ended
 -- --------------------------------------------------

+ 35 - 0
RaspisKusach/ErrorWindow.xaml

@@ -0,0 +1,35 @@
+<Window x:Class="RaspisKusach.ErrorWindow"
+        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:RaspisKusach"
+        mc:Ignorable="d"
+        Title="ErrorWindow" 
+        MinHeight="120" 
+        Height="120"
+        Width="300" 
+        WindowStartupLocation="CenterScreen" 
+        WindowStyle="None" 
+        ResizeMode="NoResize">
+    <Border Background="{StaticResource Color2}"
+            MouseDown="Border_MouseDown">
+        <StackPanel>
+            <TextBlock Name="ErrorLabel" 
+               Text="Ошибка." 
+               TextWrapping="Wrap"
+               HorizontalAlignment="Center" 
+               Margin="19,10,19,0" 
+               VerticalAlignment="Top" 
+               Width="262">
+            </TextBlock>
+            <Button Content="Закрыть" 
+                VerticalAlignment="Bottom" 
+                HorizontalAlignment="Center" 
+                Height="30" 
+                Width="130" 
+                Margin="0,0,0,15" 
+                Click="BackClick"/>
+        </StackPanel>
+    </Border>
+</Window>

+ 24 - 0
RaspisKusach/ErrorWindow.xaml.cs

@@ -0,0 +1,24 @@
+using System.Windows;
+using System.Windows.Input;
+namespace RaspisKusach
+{
+    public partial class ErrorWindow : Window
+    {
+        public ErrorWindow(string error)
+        {
+            InitializeComponent();
+            ErrorLabel.Text = error;
+        }
+        private void BackClick(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed)
+                DragMove();
+        }
+    }
+}
+

+ 8 - 8
RaspisKusach/Functions.cs

@@ -59,14 +59,14 @@ namespace RaspisKusach
             else
                 return true;
         }
-        //// Проверка на правильность введеных данных при входе
-        //public static bool LoginCheck(string login, string password)
-        //{
-        //    if (cnt.db.User.Select(item => item.NickName + item.Password).Contains(login + Encrypt.GetHash(password)))
-        //        return true;
-        //    else
-        //        return false;
-        //}
+        // Проверка на правильность введеных данных при входе
+        public static bool LoginCheck(string login, string password)
+        {
+            if (cnt.db.Users.Select(item => item.Login + item.Password).Contains(login + Encrypt.GetHash(password)))
+                return true;
+            else
+                return false;
+        }
         //// Проверка на уникальность логина
         //public static bool IsLoginAlreadyTaken(string login)
         //{

+ 22 - 1
RaspisKusach/Pages/LoginPage.xaml.cs

@@ -20,6 +20,7 @@ namespace RaspisKusach.Pages
     /// </summary>
     public partial class LoginPage : Page
     {
+        bool Test = true;
         public LoginPage()
         {
             InitializeComponent();
@@ -32,7 +33,27 @@ namespace RaspisKusach.Pages
 
         private void LogButton_Click(object sender, RoutedEventArgs e)
         {
-            NavigationService.Navigate(new Pages.MainPage());
+            if (Test)
+                NavigationService.Navigate(new Pages.MainPage());
+            else
+            {
+                try
+                {
+                    if (!Functions.IsValidLogAndPass(LogBox.Text, PassBox.Password))
+                        new ErrorWindow("Поля не могут быть пустыми").Show();
+                    else if (!Functions.LoginCheck(LogBox.Text, PassBox.Password))
+                        new ErrorWindow("Неверный логин или пароль").Show();
+                    else
+                    {
+                        //Profile.userId = cnt.db.User.Where(item => item.NickName == LogBox.Text).Select(item => item.Id).FirstOrDefault();
+                        NavigationService.Navigate(new Pages.MainPage());
+                    }
+                }
+                catch
+                {
+                    new ErrorWindow("Ошибка входа").ShowDialog();
+                }
+            }
         }
     }
 }

+ 116 - 23
RaspisKusach/Pages/MainPage.xaml

@@ -22,7 +22,7 @@
                 BorderBrush="{StaticResource Selection}"
                 Margin="5"
                 Grid.Column="0">
-            
+
             <Grid Background="{x:Null}">
                 <StackPanel>
                     <Label Content="Направление"
@@ -63,7 +63,7 @@
                         </TextBox>
                     </StackPanel>
                 </StackPanel>
-                
+
             </Grid>
         </Border>
 
@@ -72,6 +72,7 @@
               Background="{x:Null}"
               Grid.Column="1"
               Visibility="Collapsed">
+            
             <Border Height="120"
                     CornerRadius="10"
                     Background="{StaticResource Color2}"
@@ -79,6 +80,7 @@
                     BorderBrush="{StaticResource Selection}"
                     Margin="10,2,10,2"
                     MouseDown="Border_MouseDown">
+                
                 <Grid Background="{x:Null}">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition/>
@@ -89,6 +91,7 @@
                         <RowDefinition/>
                     </Grid.RowDefinitions>
 
+                    <!--UPLEFT-->
                     <StackPanel Orientation="Horizontal"
                             Grid.Column="0">
                         <Image Width="35"
@@ -103,9 +106,9 @@
                                    Margin="0,-7,0,0"/>
                         </StackPanel>
                     </StackPanel>
-
+                    <!--UPRIGHT-->
                     <StackPanel Orientation="Horizontal"
-                                    Grid.Column="1"
+                                Grid.Column="1"
                                 HorizontalAlignment="Right">
                         <Image Source="/Resources/Train.png"
                                        Margin="3">
@@ -119,9 +122,39 @@
 
                     </StackPanel>
 
-                    <Grid Grid.Row="1" Grid.ColumnSpan="2">
-                        <StackPanel>
-                            <Label Name="FROML"
+                    <!--DOWNLEFT-->
+                    <Grid Grid.Row="1" Grid.Column="0"
+                          Background="{x:Null}">
+                        <Grid Background="{x:Null}">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition/>
+                                <ColumnDefinition/>
+                                <ColumnDefinition/>
+                            </Grid.ColumnDefinitions>
+                            
+                            <StackPanel>
+                                <Label Content="City">
+
+                                </Label>
+                                <Label Content="Time">
+
+                                </Label>
+                            </StackPanel>
+
+                            <Label Content="TimeBetween" Grid.Column="1">
+
+                            </Label>
+
+                            <StackPanel Grid.Column="2">
+                                <Label Content="City">
+
+                                </Label>
+                                <Label Content="Time">
+
+                                </Label>
+                            </StackPanel>
+                            
+                            <!--<Label Name="FROML"
                                    Content="{Binding Station.Name}">
                                 
                             </Label>
@@ -131,12 +164,26 @@
                             <Label Name="ToL"
                                    Content="{Binding Station.Name}">
                                 
-                            </Label>
-                        </StackPanel>
+                            </Label>-->
+                        </Grid>
                     </Grid>
+
+                    <ListBox Grid.Row="1" Grid.Column="1"
+                          Background="{x:Null}">
+                        <Grid Width="260" Height="20" Background="Black">
+                            
+                        </Grid>
+                        <Grid Width="260" Height="20" Background="Black">
+                            
+                        </Grid>
+                        <Grid Width="260" Height="20" Background="Black">
+                            
+                        </Grid>
+                    </ListBox>
+                    
                 </Grid>
 
-                
+
             </Border>
         </Grid>
 
@@ -150,8 +197,9 @@
                     Background="{StaticResource Color2}"
                     BorderThickness="1.5"
                     BorderBrush="{StaticResource Selection}"
-                    Margin="10,5,10,5"
+                    Margin="10,2,10,2"
                     MouseDown="Border_MouseDown">
+
                         <Grid Background="{x:Null}">
                             <Grid.ColumnDefinitions>
                                 <ColumnDefinition/>
@@ -162,6 +210,7 @@
                                 <RowDefinition/>
                             </Grid.RowDefinitions>
 
+                            <!--UPLEFT-->
                             <StackPanel Orientation="Horizontal"
                             Grid.Column="0">
                                 <Image Width="35"
@@ -176,9 +225,9 @@
                                    Margin="0,-7,0,0"/>
                                 </StackPanel>
                             </StackPanel>
-
+                            <!--UPRIGHT-->
                             <StackPanel Orientation="Horizontal"
-                                    Grid.Column="1"
+                                Grid.Column="1"
                                 HorizontalAlignment="Right">
                                 <Image Source="/Resources/Train.png"
                                        Margin="3">
@@ -192,21 +241,65 @@
 
                             </StackPanel>
 
-                            <Grid Grid.Row="1" Grid.ColumnSpan="2">
-                                <StackPanel>
-                                    <Label Name="FROML"
-                                   Content="{Binding Station.Name}">
+                            <!--DOWNLEFT-->
+                            <Grid Grid.Row="1" Grid.Column="0"
+                          Background="{x:Null}">
+                                <Grid Background="{x:Null}">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition/>
+                                        <ColumnDefinition/>
+                                        <ColumnDefinition/>
+                                    </Grid.ColumnDefinitions>
 
-                                    </Label>
-                                    <Label Content="To">
+                                    <StackPanel>
+                                        <Label Content="City">
 
-                                    </Label>
-                                    <Label Name="ToL"
-                                   Content="{Binding Station.Name}">
+                                        </Label>
+                                        <Label Content="Time">
+
+                                        </Label>
+                                    </StackPanel>
+
+                                    <Label Content="TimeBetween" Grid.Column="1">
 
                                     </Label>
-                                </StackPanel>
+
+                                    <StackPanel Grid.Column="2">
+                                        <Label Content="City">
+
+                                        </Label>
+                                        <Label Content="Time">
+
+                                        </Label>
+                                    </StackPanel>
+
+                                    <!--<Label Name="FROML"
+                                   Content="{Binding Station.Name}">
+                                
+                            </Label>
+                            <Label Content="To">
+                                
+                            </Label>
+                            <Label Name="ToL"
+                                   Content="{Binding Station.Name}">
+                                
+                            </Label>-->
+                                </Grid>
                             </Grid>
+
+                            <ListBox Grid.Row="1" Grid.Column="1"
+                          Background="{x:Null}">
+                                <Grid Width="260" Height="20" Background="Black">
+
+                                </Grid>
+                                <Grid Width="260" Height="20" Background="Black">
+
+                                </Grid>
+                                <Grid Width="260" Height="20" Background="Black">
+
+                                </Grid>
+                            </ListBox>
+
                         </Grid>
 
 

+ 7 - 0
RaspisKusach/Pages/MainPage.xaml.cs

@@ -20,7 +20,14 @@ namespace RaspisKusach.Pages
         public MainPage()
         {
             InitializeComponent();
+            //List<Routes> lst = cnt.db.Routes.ToList();
+            //foreach (Routes r in lst)
+            //{
+                
+            //}
+
             ListBox.ItemsSource = cnt.db.Routes.ToList();
+
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)

+ 7 - 0
RaspisKusach/RaspisKusach.csproj

@@ -84,6 +84,9 @@
       <DependentUpon>EDM.edmx</DependentUpon>
     </Compile>
     <Compile Include="Encrypt.cs" />
+    <Compile Include="ErrorWindow.xaml.cs">
+      <DependentUpon>ErrorWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Functions.cs" />
     <Compile Include="Pages\LoginPage.xaml.cs">
       <DependentUpon>LoginPage.xaml</DependentUpon>
@@ -117,6 +120,10 @@
     <Compile Include="Users.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
+    <Page Include="ErrorWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>