<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="KadroviYshotModel" 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="Childrens">
    <Key>
      <PropertyRef Name="IdChildren" />
    </Key>
    <Property Name="IdChildren" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="IdEmployee" Type="Int32" />
    <Property Name="Type" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="FullName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
    <Property Name="DateBirth" Type="DateTime" Precision="0" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_Childrens_Employees" FromRole="Childrens" ToRole="Employees" />
  </EntityType>
  <EntityType Name="Dolzhnosts">
    <Key>
      <PropertyRef Name="IdDolzhnost" />
    </Key>
    <Property Name="IdDolzhnost" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="NameDolzhnost" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Salary" Type="Decimal" Precision="19" Scale="4" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_Employees_Dolzhnosts" FromRole="Dolzhnosts" ToRole="Employees" />
    <NavigationProperty Name="OrdersEmployment" Relationship="Self.FK_OrdersEmployment_Dolzhnosts" FromRole="Dolzhnosts" ToRole="OrdersEmployment" />
  </EntityType>
  <EntityType Name="Educations">
    <Key>
      <PropertyRef Name="IdEducation" />
    </Key>
    <Property Name="IdEducation" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Establishment" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="YearEnding" Type="Int32" />
    <Property Name="Qualification" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Speciality" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_Employees_Educations" FromRole="Educations" ToRole="Employees" />
  </EntityType>
  <EntityType Name="Employees">
    <Key>
      <PropertyRef Name="IdEmployee" />
    </Key>
    <Property Name="IdEmployee" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Surname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Otchestvo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="DateBirth" Type="DateTime" Precision="0" />
    <Property Name="IdDolzhnost" Type="Int32" />
    <Property Name="IdFamilyStatus" Type="Int32" />
    <Property Name="AddressResidence" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
    <Property Name="Telephone" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="DateReceipt" Type="DateTime" Precision="0" />
    <Property Name="IdEducation" Type="Int32" />
    <Property Name="IdChildren" Type="Int32" />
    <Property Name="IdMilitaryDuty" Type="Int32" />
    <NavigationProperty Name="Childrens" Relationship="Self.FK_Childrens_Employees" FromRole="Employees" ToRole="Childrens" />
    <NavigationProperty Name="Dolzhnosts" Relationship="Self.FK_Employees_Dolzhnosts" FromRole="Employees" ToRole="Dolzhnosts" />
    <NavigationProperty Name="Educations" Relationship="Self.FK_Employees_Educations" FromRole="Employees" ToRole="Educations" />
    <NavigationProperty Name="FamilyStatuses" Relationship="Self.FK_Employees_FamilyStatuses" FromRole="Employees" ToRole="FamilyStatuses" />
    <NavigationProperty Name="MilitaryDuties" Relationship="Self.FK_Employees_MilitaryDuties" FromRole="Employees" ToRole="MilitaryDuties" />
    <NavigationProperty Name="OrdersDismissal" Relationship="Self.FK_OrdersDismissal_Employees" FromRole="Employees" ToRole="OrdersDismissal" />
    <NavigationProperty Name="OrdersEmployment" Relationship="Self.FK_OrdersEmployment_Employees1" FromRole="Employees" ToRole="OrdersEmployment" />
  </EntityType>
  <EntityType Name="FamilyStatuses">
    <Key>
      <PropertyRef Name="IdFamilyStatus" />
    </Key>
    <Property Name="IdFamilyStatus" Type="Int32" Nullable="false" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_Employees_FamilyStatuses" FromRole="FamilyStatuses" ToRole="Employees" />
  </EntityType>
  <EntityType Name="MilitaryDuties">
    <Key>
      <PropertyRef Name="IdMilitaryDuty" />
    </Key>
    <Property Name="IdMilitaryDuty" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="MilitaryIdNumber" Type="Int32" />
    <Property Name="AccountingGroup" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="MilitaryRank" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Profile" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="ReserveRank" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="DateReceipt" Type="DateTime" Precision="0" />
    <Property Name="DateWithdrawal" Type="DateTime" Precision="0" />
    <Property Name="Base" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="SpecialAccount" Type="Boolean" />
    <Property Name="MilitaryRegistrationNumber" Type="Int32" />
    <Property Name="MilitaryPositionCode" Type="Int32" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_Employees_MilitaryDuties" FromRole="MilitaryDuties" ToRole="Employees" />
  </EntityType>
  <EntityType Name="OrdersDismissal">
    <Key>
      <PropertyRef Name="IdDismissal" />
    </Key>
    <Property Name="IdDismissal" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="IdEmployee" Type="Int32" />
    <Property Name="DateApproval" Type="DateTime" Precision="0" />
    <Property Name="Grounds" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_OrdersDismissal_Employees" FromRole="OrdersDismissal" ToRole="Employees" />
  </EntityType>
  <EntityType Name="OrdersEmployment">
    <Key>
      <PropertyRef Name="IdAcceptanceWork" />
    </Key>
    <Property Name="IdAcceptanceWork" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="IdEmployee" Type="Int32" />
    <Property Name="IdStaffingTable" Type="Int32" />
    <Property Name="IdDolzhnost" Type="Int32" />
    <Property Name="DateApproval" Type="DateTime" Precision="0" />
    <NavigationProperty Name="Dolzhnosts" Relationship="Self.FK_OrdersEmployment_Dolzhnosts" FromRole="OrdersEmployment" ToRole="Dolzhnosts" />
    <NavigationProperty Name="Employees" Relationship="Self.FK_OrdersEmployment_Employees1" FromRole="OrdersEmployment" ToRole="Employees" />
    <NavigationProperty Name="StaffingTables" Relationship="Self.FK_OrdersEmployment_StaffingTables" FromRole="OrdersEmployment" ToRole="StaffingTables" />
  </EntityType>
  <EntityType Name="Roles">
    <Key>
      <PropertyRef Name="IdRole" />
    </Key>
    <Property Name="IdRole" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="Users" Relationship="Self.FK_Users_Roles" FromRole="Roles" ToRole="Users" />
  </EntityType>
  <EntityType Name="StaffingTables">
    <Key>
      <PropertyRef Name="IdStaffingTable" />
    </Key>
    <Property Name="IdStaffingTable" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="IdEmployee" Type="Int32" />
    <Property Name="IdSubdivision" Type="Int32" />
    <NavigationProperty Name="OrdersEmployment" Relationship="Self.FK_OrdersEmployment_StaffingTables" FromRole="StaffingTables" ToRole="OrdersEmployment" />
    <NavigationProperty Name="Subdivisions" Relationship="Self.FK_StaffingTables_Subdivisions" FromRole="StaffingTables" ToRole="Subdivisions" />
  </EntityType>
  <EntityType Name="Subdivisions">
    <Key>
      <PropertyRef Name="IdSubdivision" />
    </Key>
    <Property Name="IdSubdivision" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="NameSubdivision" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <NavigationProperty Name="StaffingTables" Relationship="Self.FK_StaffingTables_Subdivisions" FromRole="Subdivisions" ToRole="StaffingTables" />
  </EntityType>
  <EntityType Name="sysdiagrams">
    <Key>
      <PropertyRef Name="diagram_id" />
    </Key>
    <Property Name="name" Type="String" MaxLength="128" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="principal_id" Type="Int32" Nullable="false" />
    <Property Name="diagram_id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="version" Type="Int32" />
    <Property Name="definition" Type="Binary" MaxLength="Max" FixedLength="false" />
  </EntityType>
  <EntityType Name="Users">
    <Key>
      <PropertyRef Name="IdUser" />
    </Key>
    <Property Name="IdUser" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Login" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
    <Property Name="IdRole" Type="Int32" />
    <NavigationProperty Name="Roles" Relationship="Self.FK_Users_Roles" FromRole="Users" ToRole="Roles" />
  </EntityType>
  <Association Name="FK_Childrens_Employees">
    <End Role="Employees" Type="Self.Employees" Multiplicity="0..1" />
    <End Role="Childrens" Type="Self.Childrens" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Employees">
        <PropertyRef Name="IdEmployee" />
      </Principal>
      <Dependent Role="Childrens">
        <PropertyRef Name="IdEmployee" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Employees_Dolzhnosts">
    <End Role="Dolzhnosts" Type="Self.Dolzhnosts" Multiplicity="0..1" />
    <End Role="Employees" Type="Self.Employees" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Dolzhnosts">
        <PropertyRef Name="IdDolzhnost" />
      </Principal>
      <Dependent Role="Employees">
        <PropertyRef Name="IdDolzhnost" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrdersEmployment_Dolzhnosts">
    <End Role="Dolzhnosts" Type="Self.Dolzhnosts" Multiplicity="0..1" />
    <End Role="OrdersEmployment" Type="Self.OrdersEmployment" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Dolzhnosts">
        <PropertyRef Name="IdDolzhnost" />
      </Principal>
      <Dependent Role="OrdersEmployment">
        <PropertyRef Name="IdDolzhnost" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Employees_Educations">
    <End Role="Educations" Type="Self.Educations" Multiplicity="0..1" />
    <End Role="Employees" Type="Self.Employees" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Educations">
        <PropertyRef Name="IdEducation" />
      </Principal>
      <Dependent Role="Employees">
        <PropertyRef Name="IdEducation" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Employees_FamilyStatuses">
    <End Role="FamilyStatuses" Type="Self.FamilyStatuses" Multiplicity="0..1" />
    <End Role="Employees" Type="Self.Employees" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="FamilyStatuses">
        <PropertyRef Name="IdFamilyStatus" />
      </Principal>
      <Dependent Role="Employees">
        <PropertyRef Name="IdFamilyStatus" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Employees_MilitaryDuties">
    <End Role="MilitaryDuties" Type="Self.MilitaryDuties" Multiplicity="0..1" />
    <End Role="Employees" Type="Self.Employees" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="MilitaryDuties">
        <PropertyRef Name="IdMilitaryDuty" />
      </Principal>
      <Dependent Role="Employees">
        <PropertyRef Name="IdMilitaryDuty" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrdersDismissal_Employees">
    <End Role="Employees" Type="Self.Employees" Multiplicity="0..1" />
    <End Role="OrdersDismissal" Type="Self.OrdersDismissal" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Employees">
        <PropertyRef Name="IdEmployee" />
      </Principal>
      <Dependent Role="OrdersDismissal">
        <PropertyRef Name="IdEmployee" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrdersEmployment_Employees1">
    <End Role="Employees" Type="Self.Employees" Multiplicity="0..1" />
    <End Role="OrdersEmployment" Type="Self.OrdersEmployment" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Employees">
        <PropertyRef Name="IdEmployee" />
      </Principal>
      <Dependent Role="OrdersEmployment">
        <PropertyRef Name="IdEmployee" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_OrdersEmployment_StaffingTables">
    <End Role="StaffingTables" Type="Self.StaffingTables" Multiplicity="0..1" />
    <End Role="OrdersEmployment" Type="Self.OrdersEmployment" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="StaffingTables">
        <PropertyRef Name="IdStaffingTable" />
      </Principal>
      <Dependent Role="OrdersEmployment">
        <PropertyRef Name="IdStaffingTable" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Users_Roles">
    <End Role="Roles" Type="Self.Roles" Multiplicity="0..1" />
    <End Role="Users" Type="Self.Users" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Roles">
        <PropertyRef Name="IdRole" />
      </Principal>
      <Dependent Role="Users">
        <PropertyRef Name="IdRole" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_StaffingTables_Subdivisions">
    <End Role="Subdivisions" Type="Self.Subdivisions" Multiplicity="0..1" />
    <End Role="StaffingTables" Type="Self.StaffingTables" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Subdivisions">
        <PropertyRef Name="IdSubdivision" />
      </Principal>
      <Dependent Role="StaffingTables">
        <PropertyRef Name="IdSubdivision" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="KadroviYshotEntities" annotation:LazyLoadingEnabled="true">
    <EntitySet Name="Childrens" EntityType="Self.Childrens" />
    <EntitySet Name="Dolzhnosts" EntityType="Self.Dolzhnosts" />
    <EntitySet Name="Educations" EntityType="Self.Educations" />
    <EntitySet Name="Employees" EntityType="Self.Employees" />
    <EntitySet Name="FamilyStatuses" EntityType="Self.FamilyStatuses" />
    <EntitySet Name="MilitaryDuties" EntityType="Self.MilitaryDuties" />
    <EntitySet Name="OrdersDismissal" EntityType="Self.OrdersDismissal" />
    <EntitySet Name="OrdersEmployment" EntityType="Self.OrdersEmployment" />
    <EntitySet Name="Roles" EntityType="Self.Roles" />
    <EntitySet Name="StaffingTables" EntityType="Self.StaffingTables" />
    <EntitySet Name="Subdivisions" EntityType="Self.Subdivisions" />
    <EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" />
    <EntitySet Name="Users" EntityType="Self.Users" />
    <AssociationSet Name="FK_Childrens_Employees" Association="Self.FK_Childrens_Employees">
      <End Role="Employees" EntitySet="Employees" />
      <End Role="Childrens" EntitySet="Childrens" />
    </AssociationSet>
    <AssociationSet Name="FK_Employees_Dolzhnosts" Association="Self.FK_Employees_Dolzhnosts">
      <End Role="Dolzhnosts" EntitySet="Dolzhnosts" />
      <End Role="Employees" EntitySet="Employees" />
    </AssociationSet>
    <AssociationSet Name="FK_OrdersEmployment_Dolzhnosts" Association="Self.FK_OrdersEmployment_Dolzhnosts">
      <End Role="Dolzhnosts" EntitySet="Dolzhnosts" />
      <End Role="OrdersEmployment" EntitySet="OrdersEmployment" />
    </AssociationSet>
    <AssociationSet Name="FK_Employees_Educations" Association="Self.FK_Employees_Educations">
      <End Role="Educations" EntitySet="Educations" />
      <End Role="Employees" EntitySet="Employees" />
    </AssociationSet>
    <AssociationSet Name="FK_Employees_FamilyStatuses" Association="Self.FK_Employees_FamilyStatuses">
      <End Role="FamilyStatuses" EntitySet="FamilyStatuses" />
      <End Role="Employees" EntitySet="Employees" />
    </AssociationSet>
    <AssociationSet Name="FK_Employees_MilitaryDuties" Association="Self.FK_Employees_MilitaryDuties">
      <End Role="MilitaryDuties" EntitySet="MilitaryDuties" />
      <End Role="Employees" EntitySet="Employees" />
    </AssociationSet>
    <AssociationSet Name="FK_OrdersDismissal_Employees" Association="Self.FK_OrdersDismissal_Employees">
      <End Role="Employees" EntitySet="Employees" />
      <End Role="OrdersDismissal" EntitySet="OrdersDismissal" />
    </AssociationSet>
    <AssociationSet Name="FK_OrdersEmployment_Employees1" Association="Self.FK_OrdersEmployment_Employees1">
      <End Role="Employees" EntitySet="Employees" />
      <End Role="OrdersEmployment" EntitySet="OrdersEmployment" />
    </AssociationSet>
    <AssociationSet Name="FK_OrdersEmployment_StaffingTables" Association="Self.FK_OrdersEmployment_StaffingTables">
      <End Role="StaffingTables" EntitySet="StaffingTables" />
      <End Role="OrdersEmployment" EntitySet="OrdersEmployment" />
    </AssociationSet>
    <AssociationSet Name="FK_Users_Roles" Association="Self.FK_Users_Roles">
      <End Role="Roles" EntitySet="Roles" />
      <End Role="Users" EntitySet="Users" />
    </AssociationSet>
    <AssociationSet Name="FK_StaffingTables_Subdivisions" Association="Self.FK_StaffingTables_Subdivisions">
      <End Role="Subdivisions" EntitySet="Subdivisions" />
      <End Role="StaffingTables" EntitySet="StaffingTables" />
    </AssociationSet>
    <FunctionImport Name="sp_alterdiagram">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
      <Parameter Name="version" Mode="In" Type="Int32" />
      <Parameter Name="definition" Mode="In" Type="Binary" />
    </FunctionImport>
    <FunctionImport Name="sp_creatediagram">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
      <Parameter Name="version" Mode="In" Type="Int32" />
      <Parameter Name="definition" Mode="In" Type="Binary" />
    </FunctionImport>
    <FunctionImport Name="sp_dropdiagram">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
    </FunctionImport>
    <FunctionImport Name="sp_helpdiagramdefinition" ReturnType="Collection(KadroviYshotModel.sp_helpdiagramdefinition_Result)">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
    </FunctionImport>
    <FunctionImport Name="sp_helpdiagrams" ReturnType="Collection(KadroviYshotModel.sp_helpdiagrams_Result)">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
    </FunctionImport>
    <FunctionImport Name="sp_renamediagram">
      <Parameter Name="diagramname" Mode="In" Type="String" />
      <Parameter Name="owner_id" Mode="In" Type="Int32" />
      <Parameter Name="new_diagramname" Mode="In" Type="String" />
    </FunctionImport>
    <FunctionImport Name="sp_upgraddiagrams" />
  </EntityContainer>
  <ComplexType Name="sp_helpdiagramdefinition_Result">
    <Property Type="Int32" Name="version" Nullable="true" />
    <Property Type="Binary" Name="definition" Nullable="true" />
  </ComplexType>
  <ComplexType Name="sp_helpdiagrams_Result">
    <Property Type="String" Name="Database" Nullable="true" MaxLength="128" />
    <Property Type="String" Name="Name" Nullable="false" MaxLength="128" />
    <Property Type="Int32" Name="ID" Nullable="false" />
    <Property Type="String" Name="Owner" Nullable="true" MaxLength="128" />
    <Property Type="Int32" Name="OwnerID" Nullable="false" />
  </ComplexType>
</Schema>