Model1.ssdl 16 KB

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