Model1.csdl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="Goiman_A_AModel" 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="Agent">
  4. <Key>
  5. <PropertyRef Name="ID" />
  6. </Key>
  7. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  8. <Property Name="Title" Type="String" MaxLength="150" FixedLength="false" Unicode="true" Nullable="false" />
  9. <Property Name="AgentTypeID" Type="Int32" Nullable="false" />
  10. <Property Name="Address" Type="String" MaxLength="300" FixedLength="false" Unicode="true" />
  11. <Property Name="INN" Type="String" MaxLength="12" FixedLength="false" Unicode="false" Nullable="false" />
  12. <Property Name="KPP" Type="String" MaxLength="9" FixedLength="false" Unicode="false" />
  13. <Property Name="DirectorName" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
  14. <Property Name="Phone" Type="String" MaxLength="20" FixedLength="false" Unicode="true" Nullable="false" />
  15. <Property Name="Email" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
  16. <Property Name="Logo" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
  17. <Property Name="Priority" Type="Int32" Nullable="false" />
  18. <NavigationProperty Name="AgentType" Relationship="Self.FK_Agent_AgentType" FromRole="Agent" ToRole="AgentType" />
  19. <NavigationProperty Name="AgentPriorityHistory" Relationship="Self.FK_AgentPriorityHistory_Agent" FromRole="Agent" ToRole="AgentPriorityHistory" />
  20. <NavigationProperty Name="ProductSale" Relationship="Self.FK_ProductSale_Agent" FromRole="Agent" ToRole="ProductSale" />
  21. <NavigationProperty Name="Shop" Relationship="Self.FK_Shop_Agent" FromRole="Agent" ToRole="Shop" />
  22. </EntityType>
  23. <EntityType Name="AgentPriorityHistory">
  24. <Key>
  25. <PropertyRef Name="ID" />
  26. </Key>
  27. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  28. <Property Name="AgentID" Type="Int32" Nullable="false" />
  29. <Property Name="ChangeDate" Type="DateTime" Nullable="false" Precision="3" />
  30. <Property Name="PriorityValue" Type="Int32" Nullable="false" />
  31. <NavigationProperty Name="Agent" Relationship="Self.FK_AgentPriorityHistory_Agent" FromRole="AgentPriorityHistory" ToRole="Agent" />
  32. </EntityType>
  33. <EntityType Name="AgentType">
  34. <Key>
  35. <PropertyRef Name="ID" />
  36. </Key>
  37. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  38. <Property Name="Title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  39. <Property Name="Image" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
  40. <NavigationProperty Name="Agent" Relationship="Self.FK_Agent_AgentType" FromRole="AgentType" ToRole="Agent" />
  41. </EntityType>
  42. <EntityType Name="Material">
  43. <Key>
  44. <PropertyRef Name="ID" />
  45. </Key>
  46. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  47. <Property Name="Title" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
  48. <Property Name="CountInPack" Type="Int32" Nullable="false" />
  49. <Property Name="Unit" Type="String" MaxLength="10" FixedLength="false" Unicode="true" Nullable="false" />
  50. <Property Name="CountInStock" Type="Double" />
  51. <Property Name="MinCount" Type="Double" Nullable="false" />
  52. <Property Name="Description" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
  53. <Property Name="Cost" Type="Decimal" Precision="10" Scale="2" Nullable="false" />
  54. <Property Name="Image" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
  55. <Property Name="MaterialTypeID" Type="Int32" Nullable="false" />
  56. <NavigationProperty Name="MaterialType" Relationship="Self.FK_Material_MaterialType" FromRole="Material" ToRole="MaterialType" />
  57. <NavigationProperty Name="MaterialCountHistory" Relationship="Self.FK_MaterialCountHistory_Material" FromRole="Material" ToRole="MaterialCountHistory" />
  58. <NavigationProperty Name="ProductMaterial" Relationship="Self.FK_ProductMaterial_Material" FromRole="Material" ToRole="ProductMaterial" />
  59. <NavigationProperty Name="Supplier" Relationship="Self.MaterialSupplier" FromRole="Material" ToRole="Supplier" />
  60. </EntityType>
  61. <EntityType Name="MaterialCountHistory">
  62. <Key>
  63. <PropertyRef Name="ID" />
  64. </Key>
  65. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  66. <Property Name="MaterialID" Type="Int32" Nullable="false" />
  67. <Property Name="ChangeDate" Type="DateTime" Nullable="false" Precision="3" />
  68. <Property Name="CountValue" Type="Double" Nullable="false" />
  69. <NavigationProperty Name="Material" Relationship="Self.FK_MaterialCountHistory_Material" FromRole="MaterialCountHistory" ToRole="Material" />
  70. </EntityType>
  71. <EntityType Name="MaterialType">
  72. <Key>
  73. <PropertyRef Name="ID" />
  74. </Key>
  75. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  76. <Property Name="Title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  77. <Property Name="DefectedPercent" Type="Double" />
  78. <NavigationProperty Name="Material" Relationship="Self.FK_Material_MaterialType" FromRole="MaterialType" ToRole="Material" />
  79. </EntityType>
  80. <EntityType Name="Product">
  81. <Key>
  82. <PropertyRef Name="ID" />
  83. </Key>
  84. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  85. <Property Name="Title" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" />
  86. <Property Name="ProductTypeID" Type="Int32" />
  87. <Property Name="ArticleNumber" Type="String" MaxLength="10" FixedLength="false" Unicode="true" Nullable="false" />
  88. <Property Name="Description" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
  89. <Property Name="Image" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
  90. <Property Name="ProductionPersonCount" Type="Int32" />
  91. <Property Name="ProductionWorkshopNumber" Type="Int32" />
  92. <Property Name="MinCostForAgent" Type="Decimal" Precision="10" Scale="2" Nullable="false" />
  93. <NavigationProperty Name="ProductType" Relationship="Self.FK_Product_ProductType" FromRole="Product" ToRole="ProductType" />
  94. <NavigationProperty Name="ProductCostHistory" Relationship="Self.FK_ProductCostHistory_Product" FromRole="Product" ToRole="ProductCostHistory" />
  95. <NavigationProperty Name="ProductMaterial" Relationship="Self.FK_ProductMaterial_Product" FromRole="Product" ToRole="ProductMaterial" />
  96. <NavigationProperty Name="ProductSale" Relationship="Self.FK_ProductSale_Product" FromRole="Product" ToRole="ProductSale" />
  97. </EntityType>
  98. <EntityType Name="ProductCostHistory">
  99. <Key>
  100. <PropertyRef Name="ID" />
  101. </Key>
  102. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  103. <Property Name="ProductID" Type="Int32" Nullable="false" />
  104. <Property Name="ChangeDate" Type="DateTime" Nullable="false" Precision="3" />
  105. <Property Name="CostValue" Type="Decimal" Precision="10" Scale="2" Nullable="false" />
  106. <NavigationProperty Name="Product" Relationship="Self.FK_ProductCostHistory_Product" FromRole="ProductCostHistory" ToRole="Product" />
  107. </EntityType>
  108. <EntityType Name="ProductMaterial">
  109. <Key>
  110. <PropertyRef Name="ProductID" />
  111. <PropertyRef Name="MaterialID" />
  112. </Key>
  113. <Property Name="ProductID" Type="Int32" Nullable="false" />
  114. <Property Name="MaterialID" Type="Int32" Nullable="false" />
  115. <Property Name="Count" Type="Double" />
  116. <NavigationProperty Name="Material" Relationship="Self.FK_ProductMaterial_Material" FromRole="ProductMaterial" ToRole="Material" />
  117. <NavigationProperty Name="Product" Relationship="Self.FK_ProductMaterial_Product" FromRole="ProductMaterial" ToRole="Product" />
  118. </EntityType>
  119. <EntityType Name="ProductSale">
  120. <Key>
  121. <PropertyRef Name="ID" />
  122. </Key>
  123. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  124. <Property Name="AgentID" Type="Int32" Nullable="false" />
  125. <Property Name="ProductID" Type="Int32" Nullable="false" />
  126. <Property Name="SaleDate" Type="DateTime" Nullable="false" Precision="0" />
  127. <Property Name="ProductCount" Type="Int32" Nullable="false" />
  128. <NavigationProperty Name="Agent" Relationship="Self.FK_ProductSale_Agent" FromRole="ProductSale" ToRole="Agent" />
  129. <NavigationProperty Name="Product" Relationship="Self.FK_ProductSale_Product" FromRole="ProductSale" ToRole="Product" />
  130. </EntityType>
  131. <EntityType Name="ProductType">
  132. <Key>
  133. <PropertyRef Name="ID" />
  134. </Key>
  135. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  136. <Property Name="Title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  137. <Property Name="DefectedPercent" Type="Double" />
  138. <NavigationProperty Name="Product" Relationship="Self.FK_Product_ProductType" FromRole="ProductType" ToRole="Product" />
  139. </EntityType>
  140. <EntityType Name="Shop">
  141. <Key>
  142. <PropertyRef Name="ID" />
  143. </Key>
  144. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  145. <Property Name="Title" Type="String" MaxLength="150" FixedLength="false" Unicode="true" Nullable="false" />
  146. <Property Name="Address" Type="String" MaxLength="300" FixedLength="false" Unicode="true" />
  147. <Property Name="AgentID" Type="Int32" Nullable="false" />
  148. <NavigationProperty Name="Agent" Relationship="Self.FK_Shop_Agent" FromRole="Shop" ToRole="Agent" />
  149. </EntityType>
  150. <EntityType Name="Supplier">
  151. <Key>
  152. <PropertyRef Name="ID" />
  153. </Key>
  154. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  155. <Property Name="Title" Type="String" MaxLength="150" FixedLength="false" Unicode="true" Nullable="false" />
  156. <Property Name="INN" Type="String" MaxLength="12" FixedLength="false" Unicode="false" Nullable="false" />
  157. <Property Name="StartDate" Type="DateTime" Nullable="false" Precision="0" />
  158. <Property Name="QualityRating" Type="Int32" />
  159. <Property Name="SupplierType" Type="String" MaxLength="20" FixedLength="false" Unicode="true" />
  160. <NavigationProperty Name="Material" Relationship="Self.MaterialSupplier" FromRole="Supplier" ToRole="Material" />
  161. </EntityType>
  162. <Association Name="FK_Agent_AgentType">
  163. <End Role="AgentType" Type="Self.AgentType" Multiplicity="1" />
  164. <End Role="Agent" Type="Self.Agent" Multiplicity="*" />
  165. <ReferentialConstraint>
  166. <Principal Role="AgentType">
  167. <PropertyRef Name="ID" />
  168. </Principal>
  169. <Dependent Role="Agent">
  170. <PropertyRef Name="AgentTypeID" />
  171. </Dependent>
  172. </ReferentialConstraint>
  173. </Association>
  174. <Association Name="FK_AgentPriorityHistory_Agent">
  175. <End Role="Agent" Type="Self.Agent" Multiplicity="1" />
  176. <End Role="AgentPriorityHistory" Type="Self.AgentPriorityHistory" Multiplicity="*" />
  177. <ReferentialConstraint>
  178. <Principal Role="Agent">
  179. <PropertyRef Name="ID" />
  180. </Principal>
  181. <Dependent Role="AgentPriorityHistory">
  182. <PropertyRef Name="AgentID" />
  183. </Dependent>
  184. </ReferentialConstraint>
  185. </Association>
  186. <Association Name="FK_ProductSale_Agent">
  187. <End Role="Agent" Type="Self.Agent" Multiplicity="1" />
  188. <End Role="ProductSale" Type="Self.ProductSale" Multiplicity="*" />
  189. <ReferentialConstraint>
  190. <Principal Role="Agent">
  191. <PropertyRef Name="ID" />
  192. </Principal>
  193. <Dependent Role="ProductSale">
  194. <PropertyRef Name="AgentID" />
  195. </Dependent>
  196. </ReferentialConstraint>
  197. </Association>
  198. <Association Name="FK_Shop_Agent">
  199. <End Role="Agent" Type="Self.Agent" Multiplicity="1" />
  200. <End Role="Shop" Type="Self.Shop" Multiplicity="*" />
  201. <ReferentialConstraint>
  202. <Principal Role="Agent">
  203. <PropertyRef Name="ID" />
  204. </Principal>
  205. <Dependent Role="Shop">
  206. <PropertyRef Name="AgentID" />
  207. </Dependent>
  208. </ReferentialConstraint>
  209. </Association>
  210. <Association Name="FK_Material_MaterialType">
  211. <End Role="MaterialType" Type="Self.MaterialType" Multiplicity="1" />
  212. <End Role="Material" Type="Self.Material" Multiplicity="*" />
  213. <ReferentialConstraint>
  214. <Principal Role="MaterialType">
  215. <PropertyRef Name="ID" />
  216. </Principal>
  217. <Dependent Role="Material">
  218. <PropertyRef Name="MaterialTypeID" />
  219. </Dependent>
  220. </ReferentialConstraint>
  221. </Association>
  222. <Association Name="FK_MaterialCountHistory_Material">
  223. <End Role="Material" Type="Self.Material" Multiplicity="1" />
  224. <End Role="MaterialCountHistory" Type="Self.MaterialCountHistory" Multiplicity="*" />
  225. <ReferentialConstraint>
  226. <Principal Role="Material">
  227. <PropertyRef Name="ID" />
  228. </Principal>
  229. <Dependent Role="MaterialCountHistory">
  230. <PropertyRef Name="MaterialID" />
  231. </Dependent>
  232. </ReferentialConstraint>
  233. </Association>
  234. <Association Name="FK_ProductMaterial_Material">
  235. <End Role="Material" Type="Self.Material" Multiplicity="1" />
  236. <End Role="ProductMaterial" Type="Self.ProductMaterial" Multiplicity="*" />
  237. <ReferentialConstraint>
  238. <Principal Role="Material">
  239. <PropertyRef Name="ID" />
  240. </Principal>
  241. <Dependent Role="ProductMaterial">
  242. <PropertyRef Name="MaterialID" />
  243. </Dependent>
  244. </ReferentialConstraint>
  245. </Association>
  246. <Association Name="FK_Product_ProductType">
  247. <End Role="ProductType" Type="Self.ProductType" Multiplicity="0..1" />
  248. <End Role="Product" Type="Self.Product" Multiplicity="*" />
  249. <ReferentialConstraint>
  250. <Principal Role="ProductType">
  251. <PropertyRef Name="ID" />
  252. </Principal>
  253. <Dependent Role="Product">
  254. <PropertyRef Name="ProductTypeID" />
  255. </Dependent>
  256. </ReferentialConstraint>
  257. </Association>
  258. <Association Name="FK_ProductCostHistory_Product">
  259. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  260. <End Role="ProductCostHistory" Type="Self.ProductCostHistory" Multiplicity="*" />
  261. <ReferentialConstraint>
  262. <Principal Role="Product">
  263. <PropertyRef Name="ID" />
  264. </Principal>
  265. <Dependent Role="ProductCostHistory">
  266. <PropertyRef Name="ProductID" />
  267. </Dependent>
  268. </ReferentialConstraint>
  269. </Association>
  270. <Association Name="FK_ProductMaterial_Product">
  271. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  272. <End Role="ProductMaterial" Type="Self.ProductMaterial" Multiplicity="*" />
  273. <ReferentialConstraint>
  274. <Principal Role="Product">
  275. <PropertyRef Name="ID" />
  276. </Principal>
  277. <Dependent Role="ProductMaterial">
  278. <PropertyRef Name="ProductID" />
  279. </Dependent>
  280. </ReferentialConstraint>
  281. </Association>
  282. <Association Name="FK_ProductSale_Product">
  283. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  284. <End Role="ProductSale" Type="Self.ProductSale" Multiplicity="*" />
  285. <ReferentialConstraint>
  286. <Principal Role="Product">
  287. <PropertyRef Name="ID" />
  288. </Principal>
  289. <Dependent Role="ProductSale">
  290. <PropertyRef Name="ProductID" />
  291. </Dependent>
  292. </ReferentialConstraint>
  293. </Association>
  294. <Association Name="MaterialSupplier">
  295. <End Role="Material" Type="Self.Material" Multiplicity="*" />
  296. <End Role="Supplier" Type="Self.Supplier" Multiplicity="*" />
  297. </Association>
  298. <EntityContainer Name="Goiman_A_AEntities" annotation:LazyLoadingEnabled="true">
  299. <EntitySet Name="Agent" EntityType="Self.Agent" />
  300. <EntitySet Name="AgentPriorityHistory" EntityType="Self.AgentPriorityHistory" />
  301. <EntitySet Name="AgentType" EntityType="Self.AgentType" />
  302. <EntitySet Name="Material" EntityType="Self.Material" />
  303. <EntitySet Name="MaterialCountHistory" EntityType="Self.MaterialCountHistory" />
  304. <EntitySet Name="MaterialType" EntityType="Self.MaterialType" />
  305. <EntitySet Name="Product" EntityType="Self.Product" />
  306. <EntitySet Name="ProductCostHistory" EntityType="Self.ProductCostHistory" />
  307. <EntitySet Name="ProductMaterial" EntityType="Self.ProductMaterial" />
  308. <EntitySet Name="ProductSale" EntityType="Self.ProductSale" />
  309. <EntitySet Name="ProductType" EntityType="Self.ProductType" />
  310. <EntitySet Name="Shop" EntityType="Self.Shop" />
  311. <EntitySet Name="Supplier" EntityType="Self.Supplier" />
  312. <AssociationSet Name="FK_Agent_AgentType" Association="Self.FK_Agent_AgentType">
  313. <End Role="AgentType" EntitySet="AgentType" />
  314. <End Role="Agent" EntitySet="Agent" />
  315. </AssociationSet>
  316. <AssociationSet Name="FK_AgentPriorityHistory_Agent" Association="Self.FK_AgentPriorityHistory_Agent">
  317. <End Role="Agent" EntitySet="Agent" />
  318. <End Role="AgentPriorityHistory" EntitySet="AgentPriorityHistory" />
  319. </AssociationSet>
  320. <AssociationSet Name="FK_ProductSale_Agent" Association="Self.FK_ProductSale_Agent">
  321. <End Role="Agent" EntitySet="Agent" />
  322. <End Role="ProductSale" EntitySet="ProductSale" />
  323. </AssociationSet>
  324. <AssociationSet Name="FK_Shop_Agent" Association="Self.FK_Shop_Agent">
  325. <End Role="Agent" EntitySet="Agent" />
  326. <End Role="Shop" EntitySet="Shop" />
  327. </AssociationSet>
  328. <AssociationSet Name="FK_Material_MaterialType" Association="Self.FK_Material_MaterialType">
  329. <End Role="MaterialType" EntitySet="MaterialType" />
  330. <End Role="Material" EntitySet="Material" />
  331. </AssociationSet>
  332. <AssociationSet Name="FK_MaterialCountHistory_Material" Association="Self.FK_MaterialCountHistory_Material">
  333. <End Role="Material" EntitySet="Material" />
  334. <End Role="MaterialCountHistory" EntitySet="MaterialCountHistory" />
  335. </AssociationSet>
  336. <AssociationSet Name="FK_ProductMaterial_Material" Association="Self.FK_ProductMaterial_Material">
  337. <End Role="Material" EntitySet="Material" />
  338. <End Role="ProductMaterial" EntitySet="ProductMaterial" />
  339. </AssociationSet>
  340. <AssociationSet Name="FK_Product_ProductType" Association="Self.FK_Product_ProductType">
  341. <End Role="ProductType" EntitySet="ProductType" />
  342. <End Role="Product" EntitySet="Product" />
  343. </AssociationSet>
  344. <AssociationSet Name="FK_ProductCostHistory_Product" Association="Self.FK_ProductCostHistory_Product">
  345. <End Role="Product" EntitySet="Product" />
  346. <End Role="ProductCostHistory" EntitySet="ProductCostHistory" />
  347. </AssociationSet>
  348. <AssociationSet Name="FK_ProductMaterial_Product" Association="Self.FK_ProductMaterial_Product">
  349. <End Role="Product" EntitySet="Product" />
  350. <End Role="ProductMaterial" EntitySet="ProductMaterial" />
  351. </AssociationSet>
  352. <AssociationSet Name="FK_ProductSale_Product" Association="Self.FK_ProductSale_Product">
  353. <End Role="Product" EntitySet="Product" />
  354. <End Role="ProductSale" EntitySet="ProductSale" />
  355. </AssociationSet>
  356. <AssociationSet Name="MaterialSupplier" Association="Self.MaterialSupplier">
  357. <End Role="Material" EntitySet="Material" />
  358. <End Role="Supplier" EntitySet="Supplier" />
  359. </AssociationSet>
  360. <EntitySet Name="Role" EntityType="Goiman_A_AModel.Role" />
  361. <EntitySet Name="User" EntityType="Goiman_A_AModel.User" />
  362. <AssociationSet Name="FK_User_Role" Association="Goiman_A_AModel.FK_User_Role">
  363. <End Role="Role" EntitySet="Role" />
  364. <End Role="User" EntitySet="User" />
  365. </AssociationSet>
  366. </EntityContainer>
  367. <EntityType Name="Role">
  368. <Key>
  369. <PropertyRef Name="Role_ID" />
  370. </Key>
  371. <Property Name="Role_ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  372. <Property Name="RoleName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
  373. <NavigationProperty Name="User" Relationship="Goiman_A_AModel.FK_User_Role" FromRole="Role" ToRole="User" />
  374. </EntityType>
  375. <EntityType Name="User">
  376. <Key>
  377. <PropertyRef Name="User_ID" />
  378. </Key>
  379. <Property Name="User_ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  380. <Property Name="Login" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
  381. <Property Name="Password" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
  382. <Property Name="SurName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
  383. <Property Name="FirstName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
  384. <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
  385. <Property Name="Role_id" Type="Int32" Nullable="false" />
  386. <NavigationProperty Name="Role" Relationship="Goiman_A_AModel.FK_User_Role" FromRole="User" ToRole="Role" />
  387. </EntityType>
  388. <Association Name="FK_User_Role">
  389. <End Type="Goiman_A_AModel.Role" Role="Role" Multiplicity="1">
  390. <OnDelete Action="Cascade" />
  391. </End>
  392. <End Type="Goiman_A_AModel.User" Role="User" Multiplicity="*" />
  393. <ReferentialConstraint>
  394. <Principal Role="Role">
  395. <PropertyRef Name="Role_ID" />
  396. </Principal>
  397. <Dependent Role="User">
  398. <PropertyRef Name="Role_id" />
  399. </Dependent>
  400. </ReferentialConstraint>
  401. </Association>
  402. </Schema>