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="WorkShift" Relationship="Self.FK_Order_WorkShift" FromRole="Order" ToRole="WorkShift" />
  23. <NavigationProperty Name="PaymentOrder" Relationship="Self.FK_PaymentOrder_Order" FromRole="Order" ToRole="PaymentOrder" />
  24. <NavigationProperty Name="ProductInOrder" Relationship="Self.FK_ProductInOrder_Order" FromRole="Order" ToRole="ProductInOrder" />
  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. <EntityType Name="WorkShift">
  90. <Key>
  91. <PropertyRef Name="WorkShiftID" />
  92. </Key>
  93. <Property Name="WorkShiftID" Type="Int32" Nullable="false" />
  94. <Property Name="IDCashier" Type="Int32" Nullable="false" />
  95. <Property Name="IDEmployee" Type="Int32" Nullable="false" />
  96. <Property Name="StartDateAndTimeWork" Type="DateTime" Nullable="false" Precision="3" />
  97. <Property Name="EndDateAndTimeWork" Type="DateTime" Precision="3" />
  98. <NavigationProperty Name="Order" Relationship="Self.FK_Order_WorkShift" FromRole="WorkShift" ToRole="Order" />
  99. <NavigationProperty Name="Cashier" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="WorkShift" ToRole="Cashier" />
  100. <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="WorkShift" ToRole="EmployeeInStore" />
  101. </EntityType>
  102. <Association Name="FK_Order_WorkShift">
  103. <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="1" />
  104. <End Role="Order" Type="Self.Order" Multiplicity="*" />
  105. <ReferentialConstraint>
  106. <Principal Role="WorkShift">
  107. <PropertyRef Name="WorkShiftID" />
  108. </Principal>
  109. <Dependent Role="Order">
  110. <PropertyRef Name="IDWorkShift" />
  111. </Dependent>
  112. </ReferentialConstraint>
  113. </Association>
  114. <Association Name="FK_PaymentOrder_Order">
  115. <End Role="Order" Type="Self.Order" Multiplicity="1" />
  116. <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
  117. <ReferentialConstraint>
  118. <Principal Role="Order">
  119. <PropertyRef Name="OrderID" />
  120. </Principal>
  121. <Dependent Role="PaymentOrder">
  122. <PropertyRef Name="IDOrder" />
  123. </Dependent>
  124. </ReferentialConstraint>
  125. </Association>
  126. <Association Name="FK_ProductInOrder_Order">
  127. <End Role="Order" Type="Self.Order" Multiplicity="1" />
  128. <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
  129. <ReferentialConstraint>
  130. <Principal Role="Order">
  131. <PropertyRef Name="OrderID" />
  132. </Principal>
  133. <Dependent Role="ProductInOrder">
  134. <PropertyRef Name="IDOrder" />
  135. </Dependent>
  136. </ReferentialConstraint>
  137. </Association>
  138. <Association Name="FK_PaymentOrder_PaymentMetod">
  139. <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="1" />
  140. <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
  141. <ReferentialConstraint>
  142. <Principal Role="PaymentMetod">
  143. <PropertyRef Name="PaymentMetodID" />
  144. </Principal>
  145. <Dependent Role="PaymentOrder">
  146. <PropertyRef Name="IDPaymentMetod" />
  147. </Dependent>
  148. </ReferentialConstraint>
  149. </Association>
  150. <Association Name="FK_ProductInStore_Product">
  151. <End Role="Product" Type="Self.Product" Multiplicity="1" />
  152. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
  153. <ReferentialConstraint>
  154. <Principal Role="Product">
  155. <PropertyRef Name="ProductID" />
  156. </Principal>
  157. <Dependent Role="ProductInStore">
  158. <PropertyRef Name="IDProduct" />
  159. </Dependent>
  160. </ReferentialConstraint>
  161. </Association>
  162. <Association Name="FK_ProductInOrder_ProductInStore">
  163. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="1" />
  164. <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
  165. <ReferentialConstraint>
  166. <Principal Role="ProductInStore">
  167. <PropertyRef Name="ProductInStoreID" />
  168. </Principal>
  169. <Dependent Role="ProductInOrder">
  170. <PropertyRef Name="IDProduct" />
  171. </Dependent>
  172. </ReferentialConstraint>
  173. </Association>
  174. <Association Name="FK_ProductInStore_Store">
  175. <End Role="Store" Type="Self.Store" Multiplicity="1" />
  176. <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
  177. <ReferentialConstraint>
  178. <Principal Role="Store">
  179. <PropertyRef Name="StoreID" />
  180. </Principal>
  181. <Dependent Role="ProductInStore">
  182. <PropertyRef Name="IDStore" />
  183. </Dependent>
  184. </ReferentialConstraint>
  185. </Association>
  186. <EntityContainer Name="gr672_pgvEntities" annotation:LazyLoadingEnabled="true">
  187. <EntitySet Name="Employee" EntityType="Self.Employee" />
  188. <EntitySet Name="Order" EntityType="Self.Order" />
  189. <EntitySet Name="PaymentMetod" EntityType="Self.PaymentMetod" />
  190. <EntitySet Name="PaymentOrder" EntityType="Self.PaymentOrder" />
  191. <EntitySet Name="Product" EntityType="Self.Product" />
  192. <EntitySet Name="ProductInOrder" EntityType="Self.ProductInOrder" />
  193. <EntitySet Name="ProductInStore" EntityType="Self.ProductInStore" />
  194. <EntitySet Name="Store" EntityType="Self.Store" />
  195. <EntitySet Name="WorkShift" EntityType="Self.WorkShift" />
  196. <AssociationSet Name="FK_Order_WorkShift" Association="Self.FK_Order_WorkShift">
  197. <End Role="WorkShift" EntitySet="WorkShift" />
  198. <End Role="Order" EntitySet="Order" />
  199. </AssociationSet>
  200. <AssociationSet Name="FK_PaymentOrder_Order" Association="Self.FK_PaymentOrder_Order">
  201. <End Role="Order" EntitySet="Order" />
  202. <End Role="PaymentOrder" EntitySet="PaymentOrder" />
  203. </AssociationSet>
  204. <AssociationSet Name="FK_ProductInOrder_Order" Association="Self.FK_ProductInOrder_Order">
  205. <End Role="Order" EntitySet="Order" />
  206. <End Role="ProductInOrder" EntitySet="ProductInOrder" />
  207. </AssociationSet>
  208. <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="Self.FK_PaymentOrder_PaymentMetod">
  209. <End Role="PaymentMetod" EntitySet="PaymentMetod" />
  210. <End Role="PaymentOrder" EntitySet="PaymentOrder" />
  211. </AssociationSet>
  212. <AssociationSet Name="FK_ProductInStore_Product" Association="Self.FK_ProductInStore_Product">
  213. <End Role="Product" EntitySet="Product" />
  214. <End Role="ProductInStore" EntitySet="ProductInStore" />
  215. </AssociationSet>
  216. <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="Self.FK_ProductInOrder_ProductInStore">
  217. <End Role="ProductInStore" EntitySet="ProductInStore" />
  218. <End Role="ProductInOrder" EntitySet="ProductInOrder" />
  219. </AssociationSet>
  220. <AssociationSet Name="FK_ProductInStore_Store" Association="Self.FK_ProductInStore_Store">
  221. <End Role="Store" EntitySet="Store" />
  222. <End Role="ProductInStore" EntitySet="ProductInStore" />
  223. </AssociationSet>
  224. <EntitySet Name="Cashier" EntityType="gr672_pgvModel.Cashier" />
  225. <AssociationSet Name="FK_Cashier_Store" Association="gr672_pgvModel.FK_Cashier_Store">
  226. <End Role="Store" EntitySet="Store" />
  227. <End Role="Cashier" EntitySet="Cashier" />
  228. </AssociationSet>
  229. <AssociationSet Name="FK_WorkShift_Cashier" Association="gr672_pgvModel.FK_WorkShift_Cashier">
  230. <End Role="Cashier" EntitySet="Cashier" />
  231. <End Role="WorkShift" EntitySet="WorkShift" />
  232. </AssociationSet>
  233. <EntitySet Name="EmployeeInStore" EntityType="gr672_pgvModel.EmployeeInStore" />
  234. <AssociationSet Name="FK_EmployeeInStore_Employee" Association="gr672_pgvModel.FK_EmployeeInStore_Employee">
  235. <End Role="Employee" EntitySet="Employee" />
  236. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  237. </AssociationSet>
  238. <AssociationSet Name="FK_EmployeeInStore_Store" Association="gr672_pgvModel.FK_EmployeeInStore_Store">
  239. <End Role="Store" EntitySet="Store" />
  240. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  241. </AssociationSet>
  242. <AssociationSet Name="FK_WorkShift_EmployeeInStore" Association="gr672_pgvModel.FK_WorkShift_EmployeeInStore">
  243. <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
  244. <End Role="WorkShift" EntitySet="WorkShift" />
  245. </AssociationSet>
  246. </EntityContainer>
  247. <EntityType Name="Cashier">
  248. <Key>
  249. <PropertyRef Name="CashierID" />
  250. </Key>
  251. <Property Name="CashierID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  252. <Property Name="IDStore" Type="Int32" Nullable="false" />
  253. <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Cashier" ToRole="Store" />
  254. <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="Cashier" ToRole="WorkShift" />
  255. </EntityType>
  256. <Association Name="FK_Cashier_Store">
  257. <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
  258. <End Type="gr672_pgvModel.Cashier" Role="Cashier" Multiplicity="*" />
  259. <ReferentialConstraint>
  260. <Principal Role="Store">
  261. <PropertyRef Name="StoreID" />
  262. </Principal>
  263. <Dependent Role="Cashier">
  264. <PropertyRef Name="IDStore" />
  265. </Dependent>
  266. </ReferentialConstraint>
  267. </Association>
  268. <Association Name="FK_WorkShift_Cashier">
  269. <End Type="gr672_pgvModel.Cashier" Role="Cashier" Multiplicity="1" />
  270. <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
  271. <ReferentialConstraint>
  272. <Principal Role="Cashier">
  273. <PropertyRef Name="CashierID" />
  274. </Principal>
  275. <Dependent Role="WorkShift">
  276. <PropertyRef Name="IDCashier" />
  277. </Dependent>
  278. </ReferentialConstraint>
  279. </Association>
  280. <EntityType Name="EmployeeInStore">
  281. <Key>
  282. <PropertyRef Name="IDEmployeeInStore" />
  283. </Key>
  284. <Property Name="IDStore" Type="Int32" Nullable="false" />
  285. <Property Name="IDEmployee" Type="Int32" Nullable="false" />
  286. <Property Name="IDEmployeeInStore" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  287. <NavigationProperty Name="Employee" Relationship="gr672_pgvModel.FK_EmployeeInStore_Employee" FromRole="EmployeeInStore" ToRole="Employee" />
  288. <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_EmployeeInStore_Store" FromRole="EmployeeInStore" ToRole="Store" />
  289. <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="EmployeeInStore" ToRole="WorkShift" />
  290. </EntityType>
  291. <Association Name="FK_EmployeeInStore_Employee">
  292. <End Type="gr672_pgvModel.Employee" Role="Employee" Multiplicity="1" />
  293. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
  294. <ReferentialConstraint>
  295. <Principal Role="Employee">
  296. <PropertyRef Name="EmployeeID" />
  297. </Principal>
  298. <Dependent Role="EmployeeInStore">
  299. <PropertyRef Name="IDEmployee" />
  300. </Dependent>
  301. </ReferentialConstraint>
  302. </Association>
  303. <Association Name="FK_EmployeeInStore_Store">
  304. <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
  305. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
  306. <ReferentialConstraint>
  307. <Principal Role="Store">
  308. <PropertyRef Name="StoreID" />
  309. </Principal>
  310. <Dependent Role="EmployeeInStore">
  311. <PropertyRef Name="IDStore" />
  312. </Dependent>
  313. </ReferentialConstraint>
  314. </Association>
  315. <Association Name="FK_WorkShift_EmployeeInStore">
  316. <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="1" />
  317. <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
  318. <ReferentialConstraint>
  319. <Principal Role="EmployeeInStore">
  320. <PropertyRef Name="IDEmployeeInStore" />
  321. </Principal>
  322. <Dependent Role="WorkShift">
  323. <PropertyRef Name="IDEmployee" />
  324. </Dependent>
  325. </ReferentialConstraint>
  326. </Association>
  327. </Schema>