<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="UP_ShechkovaModel" 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">
  <EntityType Name="Manufacturer">
    <Key>
      <PropertyRef Name="ManufacturerId" />
    </Key>
    <Property Name="ManufacturerId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Manufacturer1" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_Manufacturer" FromRole="Manufacturer" ToRole="Product" />
  </EntityType>
  <EntityType Name="Order">
    <Key>
      <PropertyRef Name="OrderID" />
    </Key>
    <Property Name="OrderID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="OrderStatus" Type="Int32" Nullable="false" />
    <Property Name="OrderDate" Type="DateTime" Nullable="false" Precision="3" />
    <Property Name="OrderDeliveryDate" Type="DateTime" Precision="3" />
    <Property Name="OrderPickupPoint" Type="Int32" Nullable="false" />
    <Property Name="UserID" Type="Int32" />
    <Property Name="IssueCode" Type="Int32" Nullable="false" />
    <NavigationProperty Name="OrderProduct" Relationship="Self.FK__OrderProd__Order__1CBC4616" FromRole="Order" ToRole="OrderProduct" />
    <NavigationProperty Name="PointsOfIssue" Relationship="Self.FK_Order_PointsOfIssue" FromRole="Order" ToRole="PointsOfIssue" />
    <NavigationProperty Name="StatusOrder" Relationship="Self.FK_Order_StateOrder" FromRole="Order" ToRole="StatusOrder" />
    <NavigationProperty Name="User" Relationship="Self.FK_Order_User" FromRole="Order" ToRole="User" />
  </EntityType>
  <EntityType Name="OrderProduct">
    <Key>
      <PropertyRef Name="OrderID" />
      <PropertyRef Name="ProductArticleNumber" />
    </Key>
    <Property Name="OrderID" Type="Int32" Nullable="false" />
    <Property Name="ProductArticleNumber" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ProductCount" Type="Int32" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK__OrderProd__Order__1CBC4616" FromRole="OrderProduct" ToRole="Order" />
    <NavigationProperty Name="Product" Relationship="Self.FK__OrderProd__Produ__1DB06A4F" FromRole="OrderProduct" ToRole="Product" />
  </EntityType>
  <EntityType Name="PointsOfIssue">
    <Key>
      <PropertyRef Name="PointID" />
    </Key>
    <Property Name="PointID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="PointName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_PointsOfIssue" FromRole="PointsOfIssue" ToRole="Order" />
  </EntityType>
  <EntityType Name="Product">
    <Key>
      <PropertyRef Name="ProductArticleNumber" />
    </Key>
    <Property Name="ProductArticleNumber" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ProductName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ProductDescription" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="ProductCategory" Type="Int32" Nullable="false" />
    <Property Name="ProductPhoto" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
    <Property Name="ProductManufacturer" Type="Int32" Nullable="false" />
    <Property Name="ProductProvider" Type="Int32" Nullable="false" />
    <Property Name="ProductCost" Type="Decimal" Precision="19" Scale="4" Nullable="false" />
    <Property Name="ProductDiscountAmount" Type="Byte" />
    <Property Name="ProductQuantityInStock" Type="Int32" />
    <NavigationProperty Name="Manufacturer" Relationship="Self.FK_Product_Manufacturer" FromRole="Product" ToRole="Manufacturer" />
    <NavigationProperty Name="OrderProduct" Relationship="Self.FK__OrderProd__Produ__1DB06A4F" FromRole="Product" ToRole="OrderProduct" />
    <NavigationProperty Name="ProductCategory1" Relationship="Self.FK_Product_ProductCategory" FromRole="Product" ToRole="ProductCategory" />
    <NavigationProperty Name="Provider" Relationship="Self.FK_Product_Provider" FromRole="Product" ToRole="Provider" />
  </EntityType>
  <EntityType Name="ProductCategory">
    <Key>
      <PropertyRef Name="CategoryId" />
    </Key>
    <Property Name="CategoryId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="CategoryTitle" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_ProductCategory" FromRole="ProductCategory" ToRole="Product" />
  </EntityType>
  <EntityType Name="Provider">
    <Key>
      <PropertyRef Name="ProviderId" />
    </Key>
    <Property Name="ProviderId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Provider1" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Product" Relationship="Self.FK_Product_Provider" FromRole="Provider" ToRole="Product" />
  </EntityType>
  <EntityType Name="Role">
    <Key>
      <PropertyRef Name="RoleID" />
    </Key>
    <Property Name="RoleID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="RoleName" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="User" Relationship="Self.FK__User__UserRole__398D8EEE" FromRole="Role" ToRole="User" />
  </EntityType>
  <EntityType Name="StatusOrder">
    <Key>
      <PropertyRef Name="StatusId" />
    </Key>
    <Property Name="StatusId" Type="Int32" Nullable="false" />
    <Property Name="StatusTitle" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_StateOrder" FromRole="StatusOrder" ToRole="Order" />
  </EntityType>
  <EntityType Name="User">
    <Key>
      <PropertyRef Name="UserID" />
    </Key>
    <Property Name="UserID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="UserSurname" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="UserName" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="UserPatronymic" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
    <Property Name="UserLogin" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="UserPassword" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="UserRole" Type="Int32" Nullable="false" />
    <NavigationProperty Name="Order" Relationship="Self.FK_Order_User" FromRole="User" ToRole="Order" />
    <NavigationProperty Name="Role" Relationship="Self.FK__User__UserRole__398D8EEE" FromRole="User" ToRole="Role" />
  </EntityType>
  <Association Name="FK_Product_Manufacturer">
    <End Role="Manufacturer" Type="Self.Manufacturer" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Manufacturer">
        <PropertyRef Name="ManufacturerId" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ProductManufacturer" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK__OrderProd__Order__1CBC4616">
    <End Role="Order" Type="Self.Order" Multiplicity="1" />
    <End Role="OrderProduct" Type="Self.OrderProduct" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Order">
        <PropertyRef Name="OrderID" />
      </Principal>
      <Dependent Role="OrderProduct">
        <PropertyRef Name="OrderID" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_PointsOfIssue">
    <End Role="PointsOfIssue" Type="Self.PointsOfIssue" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="PointsOfIssue">
        <PropertyRef Name="PointID" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="OrderPickupPoint" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_StateOrder">
    <End Role="StatusOrder" Type="Self.StatusOrder" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="StatusOrder">
        <PropertyRef Name="StatusId" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="OrderStatus" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_User">
    <End Role="User" Type="Self.User" Multiplicity="0..1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="User">
        <PropertyRef Name="UserID" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="UserID" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK__OrderProd__Produ__1DB06A4F">
    <End Role="Product" Type="Self.Product" Multiplicity="1" />
    <End Role="OrderProduct" Type="Self.OrderProduct" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Product">
        <PropertyRef Name="ProductArticleNumber" />
      </Principal>
      <Dependent Role="OrderProduct">
        <PropertyRef Name="ProductArticleNumber" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Product_ProductCategory">
    <End Role="ProductCategory" Type="Self.ProductCategory" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="ProductCategory">
        <PropertyRef Name="CategoryId" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ProductProvider" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Product_Provider">
    <End Role="Provider" Type="Self.Provider" Multiplicity="1" />
    <End Role="Product" Type="Self.Product" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Provider">
        <PropertyRef Name="ProviderId" />
      </Principal>
      <Dependent Role="Product">
        <PropertyRef Name="ProductProvider" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK__User__UserRole__398D8EEE">
    <End Role="Role" Type="Self.Role" Multiplicity="1" />
    <End Role="User" Type="Self.User" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Role">
        <PropertyRef Name="RoleID" />
      </Principal>
      <Dependent Role="User">
        <PropertyRef Name="UserRole" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="BaseU" annotation:LazyLoadingEnabled="true">
    <EntitySet Name="Manufacturer" EntityType="Self.Manufacturer" />
    <EntitySet Name="Order" EntityType="Self.Order" />
    <EntitySet Name="OrderProduct" EntityType="Self.OrderProduct" />
    <EntitySet Name="PointsOfIssue" EntityType="Self.PointsOfIssue" />
    <EntitySet Name="Product" EntityType="Self.Product" />
    <EntitySet Name="ProductCategory" EntityType="Self.ProductCategory" />
    <EntitySet Name="Provider" EntityType="Self.Provider" />
    <EntitySet Name="Role" EntityType="Self.Role" />
    <EntitySet Name="StatusOrder" EntityType="Self.StatusOrder" />
    <EntitySet Name="User" EntityType="Self.User" />
    <AssociationSet Name="FK_Product_Manufacturer" Association="Self.FK_Product_Manufacturer">
      <End Role="Manufacturer" EntitySet="Manufacturer" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK__OrderProd__Order__1CBC4616" Association="Self.FK__OrderProd__Order__1CBC4616">
      <End Role="Order" EntitySet="Order" />
      <End Role="OrderProduct" EntitySet="OrderProduct" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_PointsOfIssue" Association="Self.FK_Order_PointsOfIssue">
      <End Role="PointsOfIssue" EntitySet="PointsOfIssue" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_StateOrder" Association="Self.FK_Order_StateOrder">
      <End Role="StatusOrder" EntitySet="StatusOrder" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_User" Association="Self.FK_Order_User">
      <End Role="User" EntitySet="User" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK__OrderProd__Produ__1DB06A4F" Association="Self.FK__OrderProd__Produ__1DB06A4F">
      <End Role="Product" EntitySet="Product" />
      <End Role="OrderProduct" EntitySet="OrderProduct" />
    </AssociationSet>
    <AssociationSet Name="FK_Product_ProductCategory" Association="Self.FK_Product_ProductCategory">
      <End Role="ProductCategory" EntitySet="ProductCategory" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK_Product_Provider" Association="Self.FK_Product_Provider">
      <End Role="Provider" EntitySet="Provider" />
      <End Role="Product" EntitySet="Product" />
    </AssociationSet>
    <AssociationSet Name="FK__User__UserRole__398D8EEE" Association="Self.FK__User__UserRole__398D8EEE">
      <End Role="Role" EntitySet="Role" />
      <End Role="User" EntitySet="User" />
    </AssociationSet>
  </EntityContainer>
</Schema>