BaseSchool.csdl 16 KB

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