ModelStore.csdl 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="gr672_pgvModel" 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="Employee">
  4. <Key>
  5. <PropertyRef Name="EmployeeID" />
  6. </Key>
  7. <Property Name="EmployeeID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  8. <Property Name="LastName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  9. <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  10. <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  11. <Property Name="Code" Type="String" MaxLength="5" FixedLength="false" Unicode="true" Nullable="false" />
  12. <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_EmployeeInStore_Employee" FromRole="Employee" ToRole="EmployeeInStore" />
  13. </EntityType>
  14. <EntityType Name="Order">
  15. <Key>
  16. <PropertyRef Name="OrderID" />
  17. </Key>
  18. <Property Name="OrderID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  19. <Property Name="Date" Type="DateTime" Nullable="false" Precision="0" />
  20. <Property Name="IDWorkShift" Type="Int32" Nullable="false" />
  21. <Property Name="State" Type="Boolean" Nullable="false" />
  22. <NavigationProperty Name="PaymentOrder" Relationship="Self.FK_PaymentOrder_Order" FromRole="Order" ToRole="PaymentOrder" />
  23. <NavigationProperty Name="ProductInOrder" Relationship="Self.FK_ProductInOrder_Order" FromRole="Order" ToRole="ProductInOrder" />
  24. <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_Order_WorkShift" FromRole="Order" ToRole="WorkShift" />
  25. </EntityType>
  26. <EntityType Name="PaymentMetod">
  27. <Key>
  28. <PropertyRef Name="PaymentMetodID" />
  29. </Key>
  30. <Property Name="PaymentMetodID" Type="Int32" Nullable="false" />
  31. <Property Name="PaymentMetodName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  32. <NavigationProperty Name="PaymentOrder" Relationship="Self.FK_PaymentOrder_PaymentMetod" FromRole="PaymentMetod" ToRole="PaymentOrder" />
  33. </EntityType>
  34. <EntityType Name="PaymentOrder">
  35. <Key>
  36. <PropertyRef Name="PaymentID" />
  37. </Key>
  38. <Property Name="PaymentID" Type="Int32" Nullable="false" />
  39. <Property Name="IDPaymentMetod" Type="Int32" Nullable="false" />
  40. <Property Name="IDOrder" Type="Int32" Nullable="false" />
  41. <NavigationProperty Name="Order" Relationship="Self.FK_PaymentOrder_Order" FromRole="PaymentOrder" ToRole="Order" />
  42. <NavigationProperty Name="PaymentMetod" Relationship="Self.FK_PaymentOrder_PaymentMetod" FromRole="PaymentOrder" ToRole="PaymentMetod" />
  43. </EntityType>
  44. <EntityType Name="Product">
  45. <Key>
  46. <PropertyRef Name="ProductID" />
  47. </Key>
  48. <Property Name="ProductID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  49. <Property Name="NameProduct" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
  50. <Property Name="Weight" Type="Int32" Nullable="false" />
  51. <Property Name="Packaging" Type="Int32" Nullable="false" />
  52. <Property Name="PriceOfOne" Type="Decimal" Precision="19" Scale="4" Nullable="false" />
  53. <Property Name="BarCode" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
  54. <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInStore_Product" FromRole="Product" ToRole="ProductInStore" />
  55. </EntityType>
  56. <EntityType Name="ProductInOrder">
  57. <Key>
  58. <PropertyRef Name="IDOrder" />
  59. <PropertyRef Name="IDProduct" />
  60. </Key>
  61. <Property Name="IDOrder" Type="Int32" Nullable="false" />
  62. <Property Name="IDProduct" Type="Int32" Nullable="false" />
  63. <Property Name="AmountProduct" Type="Int32" Nullable="false" />
  64. <NavigationProperty Name="Order" Relationship="Self.FK_ProductInOrder_Order" FromRole="ProductInOrder" ToRole="Order" />
  65. <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInOrder_ProductInStore" FromRole="ProductInOrder" ToRole="ProductInStore" />
  66. </EntityType>
  67. <EntityType Name="ProductInStore">
  68. <Key>
  69. <PropertyRef Name="ProductInStoreID" />
  70. </Key>
  71. <Property Name="ProductInStoreID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  72. <Property Name="IDStore" Type="Int32" Nullable="false" />
  73. <Property Name="IDProduct" Type="Int32" Nullable="false" />
  74. <Property Name="RemainsProduct" Type="Int32" Nullable="false" />
  75. <NavigationProperty Name="Product" Relationship="Self.FK_ProductInStore_Product" FromRole="ProductInStore" ToRole="Product" />
  76. <NavigationProperty Name="ProductInOrder" Relationship="Self.FK_ProductInOrder_ProductInStore" FromRole="ProductInStore" ToRole="ProductInOrder" />
  77. <NavigationProperty Name="Store" Relationship="Self.FK_ProductInStore_Store" FromRole="ProductInStore" ToRole="Store" />
  78. </EntityType>
  79. <EntityType Name="Store">
  80. <Key>
  81. <PropertyRef Name="StoreID" />
  82. </Key>
  83. <Property Name="StoreID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  84. <Property Name="Address" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
  85. <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInStore_Store" FromRole="Store" ToRole="ProductInStore" />
  86. <NavigationProperty Name="Cashier" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Store" ToRole="Cashier" />
  87. <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_EmployeeInStore_Store" FromRole="Store" ToRole="EmployeeInStore" />
  88. </EntityType>
  89. <Association Name="FK_PaymentOrder_Order">
  90. <End Role="Order" Type="Self.Order" Multiplicity="1" />
  91. <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
  92. <ReferentialConstraint>
  93. <Principal Role="Order">
  94. <PropertyRef Name="OrderID" />
  95. </Principal>
  96. <Dependent Role="PaymentOrder">
  97. <PropertyRef Name="IDOrder" />
  98. </Dependent>
  99. </ReferentialConstraint>
  100. </Association>
  101. <Association Name="FK_ProductInOrder_Order">
  102. <End Role="Order" Type="Self.Order" Multiplicity="1" />
  103. <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
  104. <ReferentialConstraint>
  105. <Principal Role="Order">
  106. <PropertyRef Name="OrderID" />
  107. </Principal>
  108. <Dependent Role="ProductInOrder">
  109. <PropertyRef Name="IDOrder" />
  110. </Dependent>
  111. </ReferentialConstraint>
  112. </Association>
  113. <Association Name="FK_PaymentOrder_PaymentMetod">
  114. <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="1" />
  115. <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
  116. <ReferentialConstraint>
  117. <Principal Role="PaymentMetod">
  118. <PropertyRef Name="PaymentMetodID" />
  119. </Principal>
  120. <Dependent Role="PaymentOrder">
  121. <PropertyRef Name="IDPaymentMetod" />
  122. </Dependent>
  123. </ReferentialConstraint>
  124. </Association>
  125. <Association Name="FK_ProductInStore_Product">
  126. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  127. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
  128. <ReferentialConstraint>
  129. <Principal Role="Product">
  130. <PropertyRef Name="ProductID" />
  131. </Principal>
  132. <Dependent Role="ProductInStore">
  133. <PropertyRef Name="IDProduct" />
  134. </Dependent>
  135. </ReferentialConstraint>
  136. </Association>
  137. <Association Name="FK_ProductInOrder_ProductInStore">
  138. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="1" />
  139. <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
  140. <ReferentialConstraint>
  141. <Principal Role="ProductInStore">
  142. <PropertyRef Name="ProductInStoreID" />
  143. </Principal>
  144. <Dependent Role="ProductInOrder">
  145. <PropertyRef Name="IDProduct" />
  146. </Dependent>
  147. </ReferentialConstraint>
  148. </Association>
  149. <Association Name="FK_ProductInStore_Store">
  150. <End Role="Store" Type="Self.Store" Multiplicity="1" />
  151. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
  152. <ReferentialConstraint>
  153. <Principal Role="Store">
  154. <PropertyRef Name="StoreID" />
  155. </Principal>
  156. <Dependent Role="ProductInStore">
  157. <PropertyRef Name="IDStore" />
  158. </Dependent>
  159. </ReferentialConstraint>
  160. </Association>
  161. <EntityContainer Name="gr672_pgvEntities" annotation:LazyLoadingEnabled="true">
  162. <EntitySet Name="Employee" EntityType="Self.Employee" />
  163. <EntitySet Name="Order" EntityType="Self.Order" />
  164. <EntitySet Name="PaymentMetod" EntityType="Self.PaymentMetod" />
  165. <EntitySet Name="PaymentOrder" EntityType="Self.PaymentOrder" />
  166. <EntitySet Name="Product" EntityType="Self.Product" />
  167. <EntitySet Name="ProductInOrder" EntityType="Self.ProductInOrder" />
  168. <EntitySet Name="ProductInStore" EntityType="Self.ProductInStore" />
  169. <EntitySet Name="Store" EntityType="Self.Store" />
  170. <AssociationSet Name="FK_PaymentOrder_Order" Association="Self.FK_PaymentOrder_Order">
  171. <End Role="Order" EntitySet="Order" />
  172. <End Role="PaymentOrder" EntitySet="PaymentOrder" />
  173. </AssociationSet>
  174. <AssociationSet Name="FK_ProductInOrder_Order" Association="Self.FK_ProductInOrder_Order">
  175. <End Role="Order" EntitySet="Order" />
  176. <End Role="ProductInOrder" EntitySet="ProductInOrder" />
  177. </AssociationSet>
  178. <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="Self.FK_PaymentOrder_PaymentMetod">
  179. <End Role="PaymentMetod" EntitySet="PaymentMetod" />
  180. <End Role="PaymentOrder" EntitySet="PaymentOrder" />
  181. </AssociationSet>
  182. <AssociationSet Name="FK_ProductInStore_Product" Association="Self.FK_ProductInStore_Product">
  183. <End Role="Product" EntitySet="Product" />
  184. <End Role="ProductInStore" EntitySet="ProductInStore" />
  185. </AssociationSet>
  186. <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="Self.FK_ProductInOrder_ProductInStore">
  187. <End Role="ProductInStore" EntitySet="ProductInStore" />
  188. <End Role="ProductInOrder" EntitySet="ProductInOrder" />
  189. </AssociationSet>
  190. <AssociationSet Name="FK_ProductInStore_Store" Association="Self.FK_ProductInStore_Store">
  191. <End Role="Store" EntitySet="Store" />
  192. <End Role="ProductInStore" EntitySet="ProductInStore" />
  193. </AssociationSet>
  194. <EntitySet Name="Cashier" EntityType="gr672_pgvModel.Cashier" />
  195. <AssociationSet Name="FK_Cashier_Store" Association="gr672_pgvModel.FK_Cashier_Store">
  196. <End Role="Store" EntitySet="Store" />
  197. <End Role="Cashier" EntitySet="Cashier" />
  198. </AssociationSet>
  199. <EntitySet Name="EmployeeInStore" EntityType="gr672_pgvModel.EmployeeInStore" />
  200. <AssociationSet Name="FK_EmployeeInStore_Employee" Association="gr672_pgvModel.FK_EmployeeInStore_Employee">
  201. <End Role="Employee" EntitySet="Employee" />
  202. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  203. </AssociationSet>
  204. <AssociationSet Name="FK_EmployeeInStore_Store" Association="gr672_pgvModel.FK_EmployeeInStore_Store">
  205. <End Role="Store" EntitySet="Store" />
  206. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  207. </AssociationSet>
  208. <EntitySet Name="WorkShift" EntityType="gr672_pgvModel.WorkShift" />
  209. <AssociationSet Name="FK_WorkShift_Cashier" Association="gr672_pgvModel.FK_WorkShift_Cashier">
  210. <End Role="Cashier" EntitySet="Cashier" />
  211. <End Role="WorkShift" EntitySet="WorkShift" />
  212. </AssociationSet>
  213. <AssociationSet Name="FK_WorkShift_EmployeeInStore" Association="gr672_pgvModel.FK_WorkShift_EmployeeInStore">
  214. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  215. <End Role="WorkShift" EntitySet="WorkShift" />
  216. </AssociationSet>
  217. <AssociationSet Name="FK_Order_WorkShift" Association="gr672_pgvModel.FK_Order_WorkShift">
  218. <End Role="WorkShift" EntitySet="WorkShift" />
  219. <End Role="Order" EntitySet="Order" />
  220. </AssociationSet>
  221. </EntityContainer>
  222. <EntityType Name="Cashier">
  223. <Key>
  224. <PropertyRef Name="CashierID" />
  225. </Key>
  226. <Property Name="CashierID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  227. <Property Name="IDStore" Type="Int32" Nullable="false" />
  228. <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Cashier" ToRole="Store" />
  229. <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="Cashier" ToRole="WorkShift" />
  230. </EntityType>
  231. <Association Name="FK_Cashier_Store">
  232. <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
  233. <End Type="gr672_pgvModel.Cashier" Role="Cashier" Multiplicity="*" />
  234. <ReferentialConstraint>
  235. <Principal Role="Store">
  236. <PropertyRef Name="StoreID" />
  237. </Principal>
  238. <Dependent Role="Cashier">
  239. <PropertyRef Name="IDStore" />
  240. </Dependent>
  241. </ReferentialConstraint>
  242. </Association>
  243. <EntityType Name="EmployeeInStore">
  244. <Key>
  245. <PropertyRef Name="IDEmployeeInStore" />
  246. </Key>
  247. <Property Name="IDStore" Type="Int32" Nullable="false" />
  248. <Property Name="IDEmployee" Type="Int32" Nullable="false" />
  249. <Property Name="IDEmployeeInStore" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  250. <NavigationProperty Name="Employee" Relationship="gr672_pgvModel.FK_EmployeeInStore_Employee" FromRole="EmployeeInStore" ToRole="Employee" />
  251. <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_EmployeeInStore_Store" FromRole="EmployeeInStore" ToRole="Store" />
  252. <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="EmployeeInStore" ToRole="WorkShift" />
  253. </EntityType>
  254. <Association Name="FK_EmployeeInStore_Employee">
  255. <End Type="gr672_pgvModel.Employee" Role="Employee" Multiplicity="1" />
  256. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
  257. <ReferentialConstraint>
  258. <Principal Role="Employee">
  259. <PropertyRef Name="EmployeeID" />
  260. </Principal>
  261. <Dependent Role="EmployeeInStore">
  262. <PropertyRef Name="IDEmployee" />
  263. </Dependent>
  264. </ReferentialConstraint>
  265. </Association>
  266. <Association Name="FK_EmployeeInStore_Store">
  267. <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
  268. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
  269. <ReferentialConstraint>
  270. <Principal Role="Store">
  271. <PropertyRef Name="StoreID" />
  272. </Principal>
  273. <Dependent Role="EmployeeInStore">
  274. <PropertyRef Name="IDStore" />
  275. </Dependent>
  276. </ReferentialConstraint>
  277. </Association>
  278. <EntityType Name="WorkShift">
  279. <Key>
  280. <PropertyRef Name="WorkShiftID" />
  281. </Key>
  282. <Property Name="WorkShiftID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  283. <Property Name="IDCashier" Type="Int32" Nullable="false" />
  284. <Property Name="IDEmployee" Type="Int32" Nullable="false" />
  285. <Property Name="StartDateAndTimeWork" Type="DateTime" Precision="3" />
  286. <Property Name="EndDateAndTimeWork" Type="DateTime" Precision="3" />
  287. <NavigationProperty Name="Cashier" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="WorkShift" ToRole="Cashier" />
  288. <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="WorkShift" ToRole="EmployeeInStore" />
  289. <NavigationProperty Name="Order" Relationship="gr672_pgvModel.FK_Order_WorkShift" FromRole="WorkShift" ToRole="Order" />
  290. </EntityType>
  291. <Association Name="FK_WorkShift_Cashier">
  292. <End Type="gr672_pgvModel.Cashier" Role="Cashier" Multiplicity="1" />
  293. <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
  294. <ReferentialConstraint>
  295. <Principal Role="Cashier">
  296. <PropertyRef Name="CashierID" />
  297. </Principal>
  298. <Dependent Role="WorkShift">
  299. <PropertyRef Name="IDCashier" />
  300. </Dependent>
  301. </ReferentialConstraint>
  302. </Association>
  303. <Association Name="FK_WorkShift_EmployeeInStore">
  304. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="1" />
  305. <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
  306. <ReferentialConstraint>
  307. <Principal Role="EmployeeInStore">
  308. <PropertyRef Name="IDEmployeeInStore" />
  309. </Principal>
  310. <Dependent Role="WorkShift">
  311. <PropertyRef Name="IDEmployee" />
  312. </Dependent>
  313. </ReferentialConstraint>
  314. </Association>
  315. <Association Name="FK_Order_WorkShift">
  316. <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="1" />
  317. <End Type="gr672_pgvModel.Order" Role="Order" Multiplicity="*" />
  318. <ReferentialConstraint>
  319. <Principal Role="WorkShift">
  320. <PropertyRef Name="WorkShiftID" />
  321. </Principal>
  322. <Dependent Role="Order">
  323. <PropertyRef Name="IDWorkShift" />
  324. </Dependent>
  325. </ReferentialConstraint>
  326. </Association>
  327. </Schema>