BaseSchool.ssdl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="Хранилище school18Model" 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">
  3. <EntityType Name="AttachedProduct">
  4. <Key>
  5. <PropertyRef Name="MainProductID" />
  6. <PropertyRef Name="AttachedProductID" />
  7. </Key>
  8. <Property Name="MainProductID" Type="int" Nullable="false" />
  9. <Property Name="AttachedProductID" Type="int" Nullable="false" />
  10. </EntityType>
  11. <EntityType Name="Client">
  12. <Key>
  13. <PropertyRef Name="ID" />
  14. </Key>
  15. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  16. <Property Name="FirstName" Type="nvarchar" MaxLength="50" Nullable="false" />
  17. <Property Name="LastName" Type="nvarchar" MaxLength="50" Nullable="false" />
  18. <Property Name="Patronymic" Type="nvarchar" MaxLength="50" />
  19. <Property Name="Birthday" Type="date" />
  20. <Property Name="RegistrationDate" Type="datetime" Nullable="false" />
  21. <Property Name="Email" Type="nvarchar" MaxLength="255" />
  22. <Property Name="Phone" Type="nvarchar" MaxLength="20" Nullable="false" />
  23. <Property Name="GenderCode" Type="nchar" MaxLength="1" Nullable="false" />
  24. <Property Name="PhotoPath" Type="nvarchar" MaxLength="1000" />
  25. </EntityType>
  26. <EntityType Name="ClientService">
  27. <Key>
  28. <PropertyRef Name="ID" />
  29. </Key>
  30. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  31. <Property Name="ClientID" Type="int" Nullable="false" />
  32. <Property Name="ServiceID" Type="int" Nullable="false" />
  33. <Property Name="StartTime" Type="datetime" Nullable="false" />
  34. <Property Name="Comment" Type="nvarchar(max)" />
  35. </EntityType>
  36. <EntityType Name="DocumentByService">
  37. <Key>
  38. <PropertyRef Name="ID" />
  39. </Key>
  40. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  41. <Property Name="ClientServiceID" Type="int" Nullable="false" />
  42. <Property Name="DocumentPath" Type="nvarchar" MaxLength="1000" Nullable="false" />
  43. </EntityType>
  44. <EntityType Name="Gender">
  45. <Key>
  46. <PropertyRef Name="Code" />
  47. </Key>
  48. <Property Name="Code" Type="nchar" MaxLength="1" Nullable="false" />
  49. <Property Name="Name" Type="nvarchar" MaxLength="10" />
  50. </EntityType>
  51. <EntityType Name="Manufacturer">
  52. <Key>
  53. <PropertyRef Name="ID" />
  54. </Key>
  55. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  56. <Property Name="Name" Type="nvarchar" MaxLength="100" Nullable="false" />
  57. <Property Name="StartDate" Type="date" />
  58. </EntityType>
  59. <EntityType Name="Product">
  60. <Key>
  61. <PropertyRef Name="ID" />
  62. </Key>
  63. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  64. <Property Name="Title" Type="nvarchar" MaxLength="100" Nullable="false" />
  65. <Property Name="Cost" Type="money" Nullable="false" />
  66. <Property Name="Description" Type="nvarchar(max)" />
  67. <Property Name="MainImagePath" Type="nvarchar" MaxLength="1000" />
  68. <Property Name="IsActive" Type="bit" Nullable="false" />
  69. <Property Name="ManufacturerID" Type="int" />
  70. </EntityType>
  71. <EntityType Name="ProductPhoto">
  72. <Key>
  73. <PropertyRef Name="ID" />
  74. </Key>
  75. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  76. <Property Name="ProductID" Type="int" Nullable="false" />
  77. <Property Name="PhotoPath" Type="nvarchar" MaxLength="1000" Nullable="false" />
  78. </EntityType>
  79. <EntityType Name="ProductSale">
  80. <Key>
  81. <PropertyRef Name="ID" />
  82. </Key>
  83. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  84. <Property Name="SaleDate" Type="datetime" Nullable="false" />
  85. <Property Name="ProductID" Type="int" Nullable="false" />
  86. <Property Name="Quantity" Type="int" Nullable="false" />
  87. <Property Name="ClientServiceID" Type="int" />
  88. </EntityType>
  89. <EntityType Name="Service">
  90. <Key>
  91. <PropertyRef Name="ID" />
  92. </Key>
  93. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  94. <Property Name="Title" Type="nvarchar" MaxLength="100" Nullable="false" />
  95. <Property Name="Cost" Type="money" Nullable="false" />
  96. <Property Name="DurationInSeconds" Type="int" Nullable="false" />
  97. <Property Name="Description" Type="nvarchar(max)" />
  98. <Property Name="Discount" Type="float" />
  99. <Property Name="MainImagePath" Type="nvarchar" MaxLength="1000" />
  100. </EntityType>
  101. <EntityType Name="ServicePhoto">
  102. <Key>
  103. <PropertyRef Name="ID" />
  104. </Key>
  105. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  106. <Property Name="ServiceID" Type="int" Nullable="false" />
  107. <Property Name="PhotoPath" Type="nvarchar" MaxLength="1000" Nullable="false" />
  108. </EntityType>
  109. <EntityType Name="Tag">
  110. <Key>
  111. <PropertyRef Name="ID" />
  112. </Key>
  113. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  114. <Property Name="Title" Type="nvarchar" MaxLength="30" Nullable="false" />
  115. <Property Name="Color" Type="nchar" MaxLength="6" Nullable="false" />
  116. </EntityType>
  117. <EntityType Name="TagOfClient">
  118. <Key>
  119. <PropertyRef Name="ClientID" />
  120. <PropertyRef Name="TagID" />
  121. </Key>
  122. <Property Name="ClientID" Type="int" Nullable="false" />
  123. <Property Name="TagID" Type="int" Nullable="false" />
  124. </EntityType>
  125. <Association Name="FK_AttachedProduct_Product">
  126. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  127. <End Role="AttachedProduct" Type="Self.AttachedProduct" Multiplicity="*" />
  128. <ReferentialConstraint>
  129. <Principal Role="Product">
  130. <PropertyRef Name="ID" />
  131. </Principal>
  132. <Dependent Role="AttachedProduct">
  133. <PropertyRef Name="MainProductID" />
  134. </Dependent>
  135. </ReferentialConstraint>
  136. </Association>
  137. <Association Name="FK_AttachedProduct_Product1">
  138. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  139. <End Role="AttachedProduct" Type="Self.AttachedProduct" Multiplicity="*" />
  140. <ReferentialConstraint>
  141. <Principal Role="Product">
  142. <PropertyRef Name="ID" />
  143. </Principal>
  144. <Dependent Role="AttachedProduct">
  145. <PropertyRef Name="AttachedProductID" />
  146. </Dependent>
  147. </ReferentialConstraint>
  148. </Association>
  149. <Association Name="FK_Client_Gender">
  150. <End Role="Gender" Type="Self.Gender" Multiplicity="1" />
  151. <End Role="Client" Type="Self.Client" Multiplicity="*" />
  152. <ReferentialConstraint>
  153. <Principal Role="Gender">
  154. <PropertyRef Name="Code" />
  155. </Principal>
  156. <Dependent Role="Client">
  157. <PropertyRef Name="GenderCode" />
  158. </Dependent>
  159. </ReferentialConstraint>
  160. </Association>
  161. <Association Name="FK_ClientService_Client">
  162. <End Role="Client" Type="Self.Client" Multiplicity="1" />
  163. <End Role="ClientService" Type="Self.ClientService" Multiplicity="*" />
  164. <ReferentialConstraint>
  165. <Principal Role="Client">
  166. <PropertyRef Name="ID" />
  167. </Principal>
  168. <Dependent Role="ClientService">
  169. <PropertyRef Name="ClientID" />
  170. </Dependent>
  171. </ReferentialConstraint>
  172. </Association>
  173. <Association Name="FK_ClientService_Service">
  174. <End Role="Service" Type="Self.Service" Multiplicity="1" />
  175. <End Role="ClientService" Type="Self.ClientService" Multiplicity="*" />
  176. <ReferentialConstraint>
  177. <Principal Role="Service">
  178. <PropertyRef Name="ID" />
  179. </Principal>
  180. <Dependent Role="ClientService">
  181. <PropertyRef Name="ServiceID" />
  182. </Dependent>
  183. </ReferentialConstraint>
  184. </Association>
  185. <Association Name="FK_DocumentByService_ClientService">
  186. <End Role="ClientService" Type="Self.ClientService" Multiplicity="1" />
  187. <End Role="DocumentByService" Type="Self.DocumentByService" Multiplicity="*" />
  188. <ReferentialConstraint>
  189. <Principal Role="ClientService">
  190. <PropertyRef Name="ID" />
  191. </Principal>
  192. <Dependent Role="DocumentByService">
  193. <PropertyRef Name="ClientServiceID" />
  194. </Dependent>
  195. </ReferentialConstraint>
  196. </Association>
  197. <Association Name="FK_Product_Manufacturer">
  198. <End Role="Manufacturer" Type="Self.Manufacturer" Multiplicity="0..1" />
  199. <End Role="Product" Type="Self.Product" Multiplicity="*" />
  200. <ReferentialConstraint>
  201. <Principal Role="Manufacturer">
  202. <PropertyRef Name="ID" />
  203. </Principal>
  204. <Dependent Role="Product">
  205. <PropertyRef Name="ManufacturerID" />
  206. </Dependent>
  207. </ReferentialConstraint>
  208. </Association>
  209. <Association Name="FK_ProductPhoto_Product">
  210. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  211. <End Role="ProductPhoto" Type="Self.ProductPhoto" Multiplicity="*" />
  212. <ReferentialConstraint>
  213. <Principal Role="Product">
  214. <PropertyRef Name="ID" />
  215. </Principal>
  216. <Dependent Role="ProductPhoto">
  217. <PropertyRef Name="ProductID" />
  218. </Dependent>
  219. </ReferentialConstraint>
  220. </Association>
  221. <Association Name="FK_ProductSale_ClientService">
  222. <End Role="ClientService" Type="Self.ClientService" Multiplicity="0..1" />
  223. <End Role="ProductSale" Type="Self.ProductSale" Multiplicity="*" />
  224. <ReferentialConstraint>
  225. <Principal Role="ClientService">
  226. <PropertyRef Name="ID" />
  227. </Principal>
  228. <Dependent Role="ProductSale">
  229. <PropertyRef Name="ClientServiceID" />
  230. </Dependent>
  231. </ReferentialConstraint>
  232. </Association>
  233. <Association Name="FK_ProductSale_Product">
  234. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  235. <End Role="ProductSale" Type="Self.ProductSale" Multiplicity="*" />
  236. <ReferentialConstraint>
  237. <Principal Role="Product">
  238. <PropertyRef Name="ID" />
  239. </Principal>
  240. <Dependent Role="ProductSale">
  241. <PropertyRef Name="ProductID" />
  242. </Dependent>
  243. </ReferentialConstraint>
  244. </Association>
  245. <Association Name="FK_ServicePhoto_Service">
  246. <End Role="Service" Type="Self.Service" Multiplicity="1" />
  247. <End Role="ServicePhoto" Type="Self.ServicePhoto" Multiplicity="*" />
  248. <ReferentialConstraint>
  249. <Principal Role="Service">
  250. <PropertyRef Name="ID" />
  251. </Principal>
  252. <Dependent Role="ServicePhoto">
  253. <PropertyRef Name="ServiceID" />
  254. </Dependent>
  255. </ReferentialConstraint>
  256. </Association>
  257. <Association Name="FK_TagOfClient_Client">
  258. <End Role="Client" Type="Self.Client" Multiplicity="1" />
  259. <End Role="TagOfClient" Type="Self.TagOfClient" Multiplicity="*" />
  260. <ReferentialConstraint>
  261. <Principal Role="Client">
  262. <PropertyRef Name="ID" />
  263. </Principal>
  264. <Dependent Role="TagOfClient">
  265. <PropertyRef Name="ClientID" />
  266. </Dependent>
  267. </ReferentialConstraint>
  268. </Association>
  269. <Association Name="FK_TagOfClient_Tag">
  270. <End Role="Tag" Type="Self.Tag" Multiplicity="1" />
  271. <End Role="TagOfClient" Type="Self.TagOfClient" Multiplicity="*" />
  272. <ReferentialConstraint>
  273. <Principal Role="Tag">
  274. <PropertyRef Name="ID" />
  275. </Principal>
  276. <Dependent Role="TagOfClient">
  277. <PropertyRef Name="TagID" />
  278. </Dependent>
  279. </ReferentialConstraint>
  280. </Association>
  281. <EntityContainer Name="Хранилище school18ModelContainer">
  282. <EntitySet Name="AttachedProduct" EntityType="Self.AttachedProduct" Schema="dbo" store:Type="Tables" />
  283. <EntitySet Name="Client" EntityType="Self.Client" Schema="dbo" store:Type="Tables" />
  284. <EntitySet Name="ClientService" EntityType="Self.ClientService" Schema="dbo" store:Type="Tables" />
  285. <EntitySet Name="DocumentByService" EntityType="Self.DocumentByService" Schema="dbo" store:Type="Tables" />
  286. <EntitySet Name="Gender" EntityType="Self.Gender" Schema="dbo" store:Type="Tables" />
  287. <EntitySet Name="Manufacturer" EntityType="Self.Manufacturer" Schema="dbo" store:Type="Tables" />
  288. <EntitySet Name="Product" EntityType="Self.Product" Schema="dbo" store:Type="Tables" />
  289. <EntitySet Name="ProductPhoto" EntityType="Self.ProductPhoto" Schema="dbo" store:Type="Tables" />
  290. <EntitySet Name="ProductSale" EntityType="Self.ProductSale" Schema="dbo" store:Type="Tables" />
  291. <EntitySet Name="Service" EntityType="Self.Service" Schema="dbo" store:Type="Tables" />
  292. <EntitySet Name="ServicePhoto" EntityType="Self.ServicePhoto" Schema="dbo" store:Type="Tables" />
  293. <EntitySet Name="Tag" EntityType="Self.Tag" Schema="dbo" store:Type="Tables" />
  294. <EntitySet Name="TagOfClient" EntityType="Self.TagOfClient" Schema="dbo" store:Type="Tables" />
  295. <AssociationSet Name="FK_AttachedProduct_Product" Association="Self.FK_AttachedProduct_Product">
  296. <End Role="Product" EntitySet="Product" />
  297. <End Role="AttachedProduct" EntitySet="AttachedProduct" />
  298. </AssociationSet>
  299. <AssociationSet Name="FK_AttachedProduct_Product1" Association="Self.FK_AttachedProduct_Product1">
  300. <End Role="Product" EntitySet="Product" />
  301. <End Role="AttachedProduct" EntitySet="AttachedProduct" />
  302. </AssociationSet>
  303. <AssociationSet Name="FK_Client_Gender" Association="Self.FK_Client_Gender">
  304. <End Role="Gender" EntitySet="Gender" />
  305. <End Role="Client" EntitySet="Client" />
  306. </AssociationSet>
  307. <AssociationSet Name="FK_ClientService_Client" Association="Self.FK_ClientService_Client">
  308. <End Role="Client" EntitySet="Client" />
  309. <End Role="ClientService" EntitySet="ClientService" />
  310. </AssociationSet>
  311. <AssociationSet Name="FK_ClientService_Service" Association="Self.FK_ClientService_Service">
  312. <End Role="Service" EntitySet="Service" />
  313. <End Role="ClientService" EntitySet="ClientService" />
  314. </AssociationSet>
  315. <AssociationSet Name="FK_DocumentByService_ClientService" Association="Self.FK_DocumentByService_ClientService">
  316. <End Role="ClientService" EntitySet="ClientService" />
  317. <End Role="DocumentByService" EntitySet="DocumentByService" />
  318. </AssociationSet>
  319. <AssociationSet Name="FK_Product_Manufacturer" Association="Self.FK_Product_Manufacturer">
  320. <End Role="Manufacturer" EntitySet="Manufacturer" />
  321. <End Role="Product" EntitySet="Product" />
  322. </AssociationSet>
  323. <AssociationSet Name="FK_ProductPhoto_Product" Association="Self.FK_ProductPhoto_Product">
  324. <End Role="Product" EntitySet="Product" />
  325. <End Role="ProductPhoto" EntitySet="ProductPhoto" />
  326. </AssociationSet>
  327. <AssociationSet Name="FK_ProductSale_ClientService" Association="Self.FK_ProductSale_ClientService">
  328. <End Role="ClientService" EntitySet="ClientService" />
  329. <End Role="ProductSale" EntitySet="ProductSale" />
  330. </AssociationSet>
  331. <AssociationSet Name="FK_ProductSale_Product" Association="Self.FK_ProductSale_Product">
  332. <End Role="Product" EntitySet="Product" />
  333. <End Role="ProductSale" EntitySet="ProductSale" />
  334. </AssociationSet>
  335. <AssociationSet Name="FK_ServicePhoto_Service" Association="Self.FK_ServicePhoto_Service">
  336. <End Role="Service" EntitySet="Service" />
  337. <End Role="ServicePhoto" EntitySet="ServicePhoto" />
  338. </AssociationSet>
  339. <AssociationSet Name="FK_TagOfClient_Client" Association="Self.FK_TagOfClient_Client">
  340. <End Role="Client" EntitySet="Client" />
  341. <End Role="TagOfClient" EntitySet="TagOfClient" />
  342. </AssociationSet>
  343. <AssociationSet Name="FK_TagOfClient_Tag" Association="Self.FK_TagOfClient_Tag">
  344. <End Role="Tag" EntitySet="Tag" />
  345. <End Role="TagOfClient" EntitySet="TagOfClient" />
  346. </AssociationSet>
  347. </EntityContainer>
  348. </Schema>