<?xml version="1.0" encoding="utf-8"?>
<Database Name="Wierszowki" Class="WierszowkiDataContext" Serialization="Unidirectional" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
  <Connection Mode="AppSettings" ConnectionString="Data Source=sql.ct.com.pl;Initial Catalog=Wierszowki;Persist Security Info=True;User ID=wwwadmin" SettingsObjectName="Wierszowki.Core.Properties.Settings" SettingsPropertyName="WierszowkiConnectionString" Provider="System.Data.SqlClient" />
  <Table Name="dbo.[User]" Member="Users">
    <Type Name="User">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
      <Column Name="Login" Type="System.String" DbType="VarChar(50) NOT NULL" CanBeNull="false" />
      <Column Name="Password" Type="System.String" DbType="VarChar(50) NOT NULL" CanBeNull="false" />
      <Column Name="FirstName" Type="System.String" DbType="NVarChar(50)" CanBeNull="true" />
      <Column Name="LastName" Type="System.String" DbType="NVarChar(50)" CanBeNull="true" />
    </Type>
  </Table>
  <Table Name="dbo.Author" Member="Authors">
    <Type Name="Author">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
      <Column Name="EmploymentTypeId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="FirstName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Column Name="LastName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Association Name="Author_MagazineItem" Member="MagazineItems" ThisKey="Id" OtherKey="AuthorId" Type="MagazineItem" />
      <Association Name="EmploymentType_Author" Member="EmploymentType" ThisKey="EmploymentTypeId" OtherKey="Id" Type="EmploymentType" IsForeignKey="true" />
    </Type>
  </Table>
  <Table Name="dbo.ItemType" Member="ItemTypes">
    <Type Name="ItemType">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
      <Column Name="Name" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
      <Association Name="ItemType_MagazineItem" Member="MagazineItems" ThisKey="Id" OtherKey="ItemTypeId" Type="MagazineItem" />
    </Type>
  </Table>
  <Table Name="dbo.Magazine" Member="Magazines">
    <Type Name="Magazine">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
      <Column Name="Name" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
      <Column Name="NickName" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
      <Association Name="Magazine_Issue" Member="Issues" ThisKey="Id" OtherKey="MagazineId" Type="Issue" />
    </Type>
  </Table>
  <Table Name="dbo.Issue" Member="Issues">
    <Type Name="Issue">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
      <Column Name="MagazineId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="Number" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="Date" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
      <Association Name="Issue_MagazineItem" Member="MagazineItems" ThisKey="Id" OtherKey="IssueId" Type="MagazineItem" />
      <Association Name="Magazine_Issue" Member="Magazine" ThisKey="MagazineId" OtherKey="Id" Type="Magazine" IsForeignKey="true" />
    </Type>
  </Table>
  <Table Name="dbo.MagazineItem" Member="MagazineItems">
    <Type Name="MagazineItem">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
      <Column Name="AuthorId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="IssueId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="ItemTypeId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="Caption" Type="System.String" DbType="NVarChar(255) NOT NULL" CanBeNull="false" />
      <Column Name="Description" Type="System.String" DbType="NVarChar(255)" CanBeNull="true" />
      <Column Name="Price" Type="System.Decimal" DbType="Decimal(9,2) NOT NULL" CanBeNull="false" />
      <Column Name="Bonus" Type="System.Decimal" DbType="Decimal(9,2) NOT NULL" CanBeNull="false" />
      <Column Name="CreatedBy" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="CreatedOn" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
      <Column Name="UpdatedBy" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="UpdatedOn" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
      <Column Name="Date" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
      <Association Name="Author_MagazineItem" Member="Author" ThisKey="AuthorId" OtherKey="Id" Type="Author" IsForeignKey="true" />
      <Association Name="User_MagazineItem" Member="CreatedByUser" Storage="_User" ThisKey="CreatedBy" OtherKey="Id" Type="User" IsForeignKey="true" />
      <Association Name="Issue_MagazineItem" Member="Issue" ThisKey="IssueId" OtherKey="Id" Type="Issue" IsForeignKey="true" />
      <Association Name="ItemType_MagazineItem" Member="ItemType" ThisKey="ItemTypeId" OtherKey="Id" Type="ItemType" IsForeignKey="true" />
      <Association Name="User_MagazineItem1" Member="UpdatedByUser" Storage="_User1" ThisKey="UpdatedBy" OtherKey="Id" Type="User" IsForeignKey="true" />
    </Type>
  </Table>
  <Table Name="dbo.EmploymentType" Member="EmploymentTypes">
    <Type Name="EmploymentType">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
      <Column Name="Name" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
      <Association Name="EmploymentType_Author" Member="Authors" ThisKey="Id" OtherKey="EmploymentTypeId" Type="Author" />
    </Type>
  </Table>
  <Function Name="dbo.GetAuthors" Method="GetAuthors">
    <Parameter Name="year" Type="System.Int32" DbType="Int" />
    <Parameter Name="month" Type="System.Int32" DbType="Int" />
    <ElementType Name="GetAuthorsResult">
      <Column Name="FirstName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Column Name="LastName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Column Name="Price" Type="System.Decimal" DbType="Decimal(0,0)" CanBeNull="true" />
      <Column Name="Bonus" Type="System.Decimal" DbType="Decimal(0,0)" CanBeNull="true" />
    </ElementType>
  </Function>
  <Function Name="dbo.GetAuthorsByMagzines" Method="GetAuthorsByMagzines">
    <Parameter Name="year" Type="System.Int32" DbType="Int" />
    <Parameter Name="month" Type="System.Int32" DbType="Int" />
    <ElementType Name="GetAuthorsByMagzinesResult">
      <Column Name="Id" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
      <Column Name="FirstName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Column Name="LastName" Type="System.String" DbType="NVarChar(100) NOT NULL" CanBeNull="false" />
      <Column Name="NickName" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
      <Column Name="Price" Type="System.Decimal" DbType="Decimal(0,0)" CanBeNull="true" />
      <Column Name="Bonus" Type="System.Decimal" DbType="Decimal(0,0)" CanBeNull="true" />
    </ElementType>
  </Function>
</Database>