Model1.ssdl 17 KB

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