BaseModel.ssdl 17 KB

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