Compare commits
742 Commits
FixMigrations
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 58c90034af | |||
| c96b2eba1d | |||
| 2a4e46240c | |||
| 3739f888f9 | |||
| e406fce2eb | |||
| aa19832649 | |||
| 25d5ba81d2 | |||
| 822a0fdfb8 | |||
| b4a4db08d1 | |||
| 9d9dcecb1c | |||
| fd5433f3c9 | |||
| 4b365e1760 | |||
| 693687a1ee | |||
| a45b70af9b | |||
| 153438e4d6 | |||
| f63d153d5b | |||
| 85298a16d7 | |||
| 16ccb1c57e | |||
| ecfa85ff38 | |||
| b45b728eb1 | |||
| 1dfd0c60d1 | |||
| 76f6151f75 | |||
| 39559e3151 | |||
| 9625911cf1 | |||
| 3e0b496764 | |||
| cd902129a5 | |||
| 4f14df94bb | |||
| 879e54d194 | |||
| a4a9bb55b6 | |||
| 1eab3ad672 | |||
| bd505ab5ef | |||
| a68471ec6f | |||
| 8f3239b6d6 | |||
| d6e5b07e2d | |||
| 89492349b6 | |||
| 971f2c51e9 | |||
| dbfc13e968 | |||
| cb42c0a7ca | |||
| 06bae1d955 | |||
| 9459492599 | |||
| c208513988 | |||
| f0dc98a4f8 | |||
| 7742d49b08 | |||
| d6ed7c56a4 | |||
| d17175b405 | |||
| 38b89c9a81 | |||
| e31f773b34 | |||
| 74b4c50b00 | |||
| 4fda312aac | |||
| 165c7ebb5f | |||
| b0274e0f33 | |||
| c52a35082f | |||
| c572a9556e | |||
| fb74462ecd | |||
| 003f8792c4 | |||
| 8757528de3 | |||
| 5e3bbc23da | |||
| 2cbe549751 | |||
| a28d7cbc4a | |||
| 9670e170f2 | |||
| b6c514ebe9 | |||
| 50ac4a9e30 | |||
| 4122e27d17 | |||
| 2d8a4db24a | |||
| ac7b284397 | |||
| 70469bc51d | |||
| e84e352795 | |||
| 603e8df10f | |||
| 11751c2adb | |||
| 45ecc0f796 | |||
| b7193732a5 | |||
| e139e98309 | |||
| cc71178b7f | |||
| 43589701fd | |||
| 24e8999f95 | |||
| 5050878708 | |||
| 528f368a99 | |||
| 7c0c172231 | |||
| 2c7c06058b | |||
| eaa75482e0 | |||
| df6fa1ad77 | |||
| d96c9205fa | |||
| c9a845fc81 | |||
| e5325be058 | |||
| 911e8cbd05 | |||
| 01330d3bb2 | |||
| 1effa123fb | |||
| 921582e436 | |||
| d2c549d471 | |||
| 82d8737157 | |||
| 9bd4b07db7 | |||
| cc559063b3 | |||
| 95e9a8ee8a | |||
| 19986dc38d | |||
| 5f8611bf63 | |||
| 9d6e624a77 | |||
| ed54dafcdb | |||
| 64e574bfba | |||
| 4b3d4a4639 | |||
| 5d6535b85b | |||
| 3d7730aaa9 | |||
| cf787b3c71 | |||
| 76c3fa1ecf | |||
| 99256c0bed | |||
| 9d3e781f0e | |||
| 4f1b6f7861 | |||
| 0ab48fdd99 | |||
| cda14a810b | |||
| 30e4cd863b | |||
| a231f9ac8c | |||
| 4ba86de5c0 | |||
| 768c435943 | |||
| dacbc8a6a6 | |||
| fe4c3e2f93 | |||
| 2a93efc1e3 | |||
| e4bfb2eaa3 | |||
| f59d9b49f5 | |||
| c3afb4140e | |||
| c731932339 | |||
| afb4d5d2cc | |||
| 82d167bfef | |||
| 6755380008 | |||
| 7e5ad0279f | |||
| 4741f98c66 | |||
| 6eb8e8c55d | |||
| ea2d912e05 | |||
| 6bbc8b6fa0 | |||
| 14fb396c00 | |||
| f9068995a8 | |||
| c64efc5aca | |||
| eee32daf4b | |||
| 1d1112cc46 | |||
| 11570f93f8 | |||
| 17f24c9209 | |||
| 3eb27c942a | |||
| e6dcfc2ca2 | |||
| 6c3ea45bea | |||
| 9c729c678f | |||
| 6e0f4b1fed | |||
| 26bf86bcab | |||
| d58e41ba06 | |||
| 227e17aa35 | |||
| 65c7ec3863 | |||
| a086b3cdcd | |||
| 1ca0a4737c | |||
| 46854b969f | |||
| 341029019f | |||
| 82eea1eb0b | |||
| ce5fc70204 | |||
| ead61e3e16 | |||
| bd80c01404 | |||
| fd0356bae4 | |||
| 2655dfcb41 | |||
| 0690754a58 | |||
| 32ab150dda | |||
| 4e3d8f79ef | |||
| 4976afeb8e | |||
| 5e954f6cf6 | |||
| f7b8f394a5 | |||
| 4c1577fa8e | |||
| 3c88852245 | |||
| 7de72d3bf8 | |||
| 21139721b8 | |||
| b76c7de6f9 | |||
| 45f17da3d7 | |||
| 430ac3373c | |||
| b6bb9a93d6 | |||
| 0c014e5bcf | |||
| 5d24a718ca | |||
| dc4b4e016e | |||
| b8edda48d3 | |||
| d1f0264e7d | |||
| 246ba5c3f4 | |||
| 62856f93cc | |||
| bf35260327 | |||
| 9bad2a2f27 | |||
| f19ff17228 | |||
| 84d933e17c | |||
| d66d328468 | |||
| 8c5f032194 | |||
| d204b0d211 | |||
| 3f01132a72 | |||
| 88f05d72e7 | |||
| ec0fc6c697 | |||
| d672979655 | |||
| 1a4387f2ad | |||
| b7495e4f13 | |||
| 1f9dcbd773 | |||
| ba0a82b7ee | |||
| c2c088e33b | |||
| 34a144e688 | |||
| d6668f467e | |||
| 5bf2c194ca | |||
| bcaca9e7cf | |||
| 40662a80a2 | |||
| 1b3c581357 | |||
| 36c33aa5c9 | |||
| f1965d4253 | |||
| 45f7f1d4e4 | |||
| 0728b898eb | |||
| 5bdd97b722 | |||
| 66ea0e4f82 | |||
| c6cb60b1d1 | |||
| 541a1a22e3 | |||
| 7579dcc7ec | |||
| 6ad8c5b4bd | |||
| dd96869f7c | |||
| f91d2086a4 | |||
| ce577e3427 | |||
| 3dd1128c5f | |||
| 774215368c | |||
| cfdd308c84 | |||
| 1eac43bf65 | |||
| 4fae5108d8 | |||
| a1e0552cfd | |||
| f1b1b2de74 | |||
| 599ff6aaba | |||
| 7b833a6383 | |||
| b457ed905f | |||
| ace3f1062f | |||
| 073ebcaf41 | |||
| 29ead2e26c | |||
| d88f2a5d12 | |||
| 9243321336 | |||
| 45a2d1aa81 | |||
| cd108c1327 | |||
| c445941aa2 | |||
| d5858dc440 | |||
| 61a2c5547d | |||
| db290137a1 | |||
| 49a38e1d92 | |||
| 6eab14cd1d | |||
| a2a0ea66c9 | |||
| 9b8e6be1fa | |||
| a8b04afc04 | |||
| b68464a23e | |||
| 88465c26b9 | |||
| 75782c27c0 | |||
| cc2b7cc093 | |||
| d775c44c10 | |||
| 3be9d4ab38 | |||
| 153a5343c2 | |||
| 9d69e407ea | |||
| bcd0e8f0d5 | |||
| 05f945196e | |||
| 5f4bb45293 | |||
| 880f3ecb95 | |||
| d86464e89d | |||
| d95fca4d47 | |||
| 8a5e79597e | |||
| da77586543 | |||
| 8c0b3cea80 | |||
| 812a88f781 | |||
| f1508ecb97 | |||
| 8d51af5b01 | |||
| 4b28b5924e | |||
| 6d55ecef79 | |||
| 68beb7f6b7 | |||
| 74208e7a4b | |||
| 8e5a366315 | |||
| c9d2e4528f | |||
| bb9b89b3e0 | |||
| c2087179d0 | |||
| da4db76f15 | |||
| e0da86f71b | |||
| 637da2dbd7 | |||
| de40678633 | |||
| 03befe8559 | |||
| 97c96c6a0c | |||
| 718d99d35f | |||
| e812d2b076 | |||
| 925376388b | |||
| a320902dbc | |||
| 1de09ad0d6 | |||
| cec1de29e0 | |||
| 82e90f7f63 | |||
| 91a65a0b62 | |||
| f63d7ba3ba | |||
| 74e438aa99 | |||
| 1b9321cef7 | |||
| 90c446696f | |||
| 0a66fb6895 | |||
| ecae528287 | |||
| e2276798ed | |||
| fce3d154fc | |||
| a0cd17dd07 | |||
| e6d5a4bfe1 | |||
| c3d0c9d2d8 | |||
| cab87ecf63 | |||
| bc1cab41da | |||
| 9849f28f3f | |||
| 33777d7d3e | |||
| d76ab0e115 | |||
| 18ab7e08ea | |||
| ac0c14817c | |||
| 8b7908b14a | |||
| fd1453507f | |||
| d2ddab281f | |||
| a22d3c1e9d | |||
| 9d8600ee7b | |||
| c36e7db974 | |||
| 9df0aa79d1 | |||
| 6dc3212bc5 | |||
| 117dd188d3 | |||
| 66992a4d7a | |||
| 0cae56932f | |||
| 75325e7479 | |||
| 538ac1e7fd | |||
| 24d395001d | |||
| 391d55b7f9 | |||
| 6df93c020d | |||
| bcbc9ea92c | |||
| 50e29dc0b9 | |||
| 0416e5eb1e | |||
| ac8ff44e16 | |||
| 7105323fde | |||
| d613ac56cf | |||
| 400d26a989 | |||
| 2b17e0b79f | |||
| a8b1552fe1 | |||
| b354ff3c59 | |||
| 61dd35311d | |||
| 8c15c33533 | |||
| 1c27e4b550 | |||
| eb1e301d5f | |||
| c0c26c8d7a | |||
| 3c94b7453a | |||
| 36f495a1dc | |||
| 5fdf7e4253 | |||
| 0fa063d803 | |||
| fab87251b7 | |||
| e6e68951e9 | |||
| 35ffe90e75 | |||
| a69ee64671 | |||
| 720a171600 | |||
| e136c48dd2 | |||
| 67b6a5e6c2 | |||
| 15d393584e | |||
| ab8ff5dea1 | |||
| 469de5dde1 | |||
| 811af16935 | |||
| 758c2382e4 | |||
| 96ce5f8b60 | |||
| fa8203bd44 | |||
| b190113d13 | |||
| 810c0790bd | |||
| c17eec87d1 | |||
| f507574bb0 | |||
| a06d87ee90 | |||
| 55162f3788 | |||
| 97e25c7b74 | |||
| e22b35eae8 | |||
| 04123158d4 | |||
| cde398efdb | |||
| f3980a9aa8 | |||
| a63ab90026 | |||
| 2eb97a8300 | |||
| 5c73f921b5 | |||
| dc1232f6ba | |||
| 8fc515b94e | |||
| 97b4f9b12e | |||
| 6f743950c2 | |||
| 218e7eab5e | |||
| 47fe7dbe3d | |||
| c8f817a2dc | |||
| 74a3551b5e | |||
| 2eeb00a751 | |||
| 1b29546a89 | |||
| 40deea8938 | |||
| 42c3d9b4e4 | |||
| 34a19d89c2 | |||
| 46b611b930 | |||
| f2e0d4084f | |||
| 75aec43ec0 | |||
| 8819993161 | |||
| 2de0c7e215 | |||
| ef3260224f | |||
| 13e447d3d9 | |||
| 477e67f6f3 | |||
| 6a7cb4aaa8 | |||
| 2ac3f3a0a6 | |||
| 07062f6c60 | |||
| e18c30e50c | |||
| af443c3796 | |||
| f9fc315451 | |||
| 5e195207ff | |||
| 7564fda672 | |||
| a52ee34f4f | |||
| f1e44513ba | |||
| ba42ebdf49 | |||
| eff6394308 | |||
| c3da657b26 | |||
| 26bf1c3017 | |||
| 9a659b15f5 | |||
| 1fef63cad5 | |||
| bf1650a9a4 | |||
| f16e08852b | |||
| 32d87212da | |||
| fc61a411e7 | |||
| bba7f2f149 | |||
| 627317bb8e | |||
| 7b353b1817 | |||
| c8619473c2 | |||
| 36c29fd79f | |||
| 250ca6c169 | |||
| 9e393cdff1 | |||
| 8a255be19f | |||
| 93c1624430 | |||
| 79390e544e | |||
| d0f2e21061 | |||
| 51a037cd74 | |||
| 05fff8d7ca | |||
| 9e54f037f5 | |||
| 4647663cc0 | |||
| fee0faf8da | |||
| 6ce1c6a227 | |||
| 881972d469 | |||
| c857126fa3 | |||
| 78c8e78caa | |||
| 7f4a678b94 | |||
| da1aa7c008 | |||
| 3b3756603c | |||
| 63e60a82a7 | |||
| ea056ea089 | |||
| 7bef5e6154 | |||
| 02f072dc6c | |||
| dcfd321b37 | |||
| 6fb3ed9664 | |||
| f4472a9ead | |||
| a25c38ed19 | |||
| ae583786dc | |||
| 7cc76b5fa6 | |||
| 541cbb8dd2 | |||
| 42b2ca1159 | |||
| c72864563c | |||
| c6735a7dfc | |||
| 069f231bc8 | |||
| eefaf16541 | |||
| 70be2891f0 | |||
| 8f05d9dd23 | |||
| 2d3f0c9894 | |||
| de9260eb98 | |||
| 42d83239ef | |||
| 7b08668f74 | |||
| f7dcfc6838 | |||
| be92e549a2 | |||
| aa342df617 | |||
| 2344b2a12d | |||
| 7353d22571 | |||
| a320c3b957 | |||
| bae8f72946 | |||
| 38e0a5cfe5 | |||
| 108bba2fba | |||
| 98ea55c07d | |||
| 411442dc14 | |||
| f9b9bdfbb8 | |||
| 755423cf78 | |||
| 36f6dc50bc | |||
| a43383557b | |||
| daff2dce2b | |||
| 4ccef56363 | |||
| 6b48308ffa | |||
| 2c22f46061 | |||
| 36b800f1d6 | |||
| 7b74df99e6 | |||
| 32e0a73d48 | |||
| ddf5d8ab40 | |||
| c300547118 | |||
| bebfbcf75a | |||
| 1ba07bff35 | |||
| 92ad0517c2 | |||
| 580c488e4c | |||
| f6fb441dec | |||
| b5635c4cf7 | |||
| 516623d5a0 | |||
| bb5a44ff7c | |||
| 8e3cd6a2c8 | |||
| a185f9754a | |||
| e77ec8d5ff | |||
| d026fb7353 | |||
| 4d24590902 | |||
| c1f1705856 | |||
| 3769bd8e0f | |||
| bbd3fc4998 | |||
| e1f0b7e0f5 | |||
| 9e5e9bc66c | |||
| 48286d15bc | |||
| e4a0c17731 | |||
| fac885cd89 | |||
| 77754d6779 | |||
| e56aa02c38 | |||
| cc71653a7a | |||
| 2b4ee79730 | |||
| cf74810a34 | |||
| 96c5ba5a54 | |||
| 5a09496266 | |||
| 7ca8af530e | |||
| d2be5171bf | |||
| f293c754f9 | |||
| dec2787cd6 | |||
| f5792d10aa | |||
| 4ca8d4c236 | |||
| 27ed5e0d8e | |||
| 8c0cf93305 | |||
| 049ec8bbdb | |||
| 7500e1abfb | |||
| bfb5bc15a1 | |||
| 3c61ef3976 | |||
| a53c557bec | |||
| 1d4cc9d174 | |||
| 19a15ea9f2 | |||
| dd91fe353c | |||
| 08df606bf2 | |||
| 132718ee79 | |||
| 3f35dfe505 | |||
| 44a3e2d093 | |||
| 2d32617d3c | |||
| 0f8593a4a3 | |||
| 3cad5ac58b | |||
| a6a1afa826 | |||
| 052c56b903 | |||
| 1df85b32ee | |||
| e1cc60a5c9 | |||
| 7f7370f6fe | |||
| 861911eb64 | |||
| ed33783f49 | |||
| e3433962fa | |||
| 442d419460 | |||
| c82cd1ed8b | |||
| 23f7e9c726 | |||
| c71a592ab3 | |||
| c848168552 | |||
| d95a19af32 | |||
| c5e4f95b94 | |||
| 35e00bdb71 | |||
| 8948984b44 | |||
| 58f8d2aee3 | |||
| 951a704b52 | |||
| d518861228 | |||
| 32a0fa1287 | |||
| 33212941c8 | |||
| 59975a335d | |||
| 390046a0c7 | |||
| 149f6251f7 | |||
| 46a0efe748 | |||
| ace620b09d | |||
| 3d87f28004 | |||
| b7071dcbe1 | |||
| fdf937131c | |||
| 1b8a19b036 | |||
| 86bd0f375c | |||
| 9e1d437563 | |||
| 6bd54468dd | |||
| 52a71d236d | |||
| c2fd4870c7 | |||
| b67fae281b | |||
| 22f4455356 | |||
| 8107ba51b9 | |||
| b3062b04fc | |||
| 3739225a28 | |||
| 2db1fbc8d6 | |||
| 85944da9ed | |||
| a598c6793a | |||
| bf30e006c3 | |||
| e799fdf10a | |||
| 34ce093ca9 | |||
| c1d39b73e9 | |||
| 567b966157 | |||
| e076bc3f6b | |||
| fd027e424f | |||
| 3bd8ee233b | |||
| bb9e9ce7d5 | |||
| a5f5a55e34 | |||
| 2ecc7338e6 | |||
| 66c069fb35 | |||
| 361d4338a6 | |||
| 9a964330e3 | |||
| 0e65410340 | |||
| b0e5d54061 | |||
| 9c979582d4 | |||
| 11cae94995 | |||
| 05ca047b5c | |||
| cd533c190b | |||
| efd84437b5 | |||
| 1c36305304 | |||
| f1f1e784da | |||
| 512d25f513 | |||
| f1628818f3 | |||
| b57d20420b | |||
| cbf97a2eb6 | |||
| 284f7ff241 | |||
| 888c7398f7 | |||
| 4926cb4715 | |||
| e2c7615826 | |||
| dc8ce10b51 | |||
| ffb4c9872d | |||
| a415d175d9 | |||
| 60b069cd28 | |||
| 7a63caa377 | |||
| df970e0a69 | |||
| c5c40f67cd | |||
| f8d2212ff3 | |||
| 38bcffe135 | |||
| 02e7224736 | |||
| 820ae5ce11 | |||
| 1f645b3aa2 | |||
| 9ff00ce0b6 | |||
| 586d281736 | |||
| 9441ee0e66 | |||
| be61e174c0 | |||
| 46f70964f0 | |||
| c337bbb7da | |||
| c007abe4a5 | |||
| 74ffe5983b | |||
| a6642512c3 | |||
| f5389907f0 | |||
| 37ca1d9a70 | |||
| a52199d4e3 | |||
| a6ab150e8d | |||
| b2afa672fc | |||
| 41e70fab62 | |||
| 8bbb114c04 | |||
| 435d12cb5b | |||
| d40cb20693 | |||
| 0fd554464e | |||
| ea04ae6245 | |||
| 4d717e9237 | |||
| e6589a5438 | |||
| 787283d239 | |||
| 3f97f11c41 | |||
| cc62039aa4 | |||
| 839ef56668 | |||
| a86eb452de | |||
| 318be3f7e0 | |||
| 4c1ed660b2 | |||
| 1778dd9290 | |||
| fef078b3bb | |||
| d3ebef281b | |||
| f9999e6900 | |||
| 74ba4373f3 | |||
| 79436685d7 | |||
| e9173e9735 | |||
| d59ba7525f | |||
| 38d7f0e8a0 | |||
| b25aeaa312 | |||
| 227e7ded81 | |||
| 65c17437f8 | |||
| c14f031fc5 | |||
| f6ecbb5761 | |||
| 9150df1286 | |||
| d0ab2df2ba | |||
| d364a16a58 | |||
| 75ab78ace4 | |||
| 0d34e61940 | |||
| 104e4acd93 | |||
| bf7acb2b08 | |||
| 5e6453f53e | |||
| d0e29fa6b4 | |||
| 32162c66ec | |||
| b01703f12f | |||
| 0db3604ade | |||
| 379723889e | |||
| 17f3aa7c6e | |||
| ab0c242e6d | |||
| cdba46bc45 | |||
| 40353cfc03 | |||
| be46d09654 | |||
| ef54e6f0cc | |||
| 29b084ae0e | |||
| 6564077260 | |||
| 9f495197d0 | |||
| a9286062c1 | |||
| 1ea8e13a14 | |||
| de0e9b990c | |||
| c63116f871 | |||
| f956f010c3 | |||
| 51edaa918a | |||
| 655048645b | |||
| 42e3e44cd2 | |||
| 6717945249 | |||
| 82caec9287 | |||
| 36c79829b5 | |||
| bc0ff628fe | |||
| 527d29eac3 | |||
| 51686f4ed7 | |||
| ae30f49d13 | |||
| 156ef822d3 | |||
| bb83c88275 | |||
| b1275a5b98 | |||
| 7b2e722b9f | |||
| 65a9e544e8 | |||
| 1c93191a3c | |||
| adfda41ecb | |||
| 5e07882384 | |||
| 1598e4d3df | |||
| 732b09c5db | |||
| 97c372f0d7 | |||
| 6d61b675a5 | |||
| 786766c402 | |||
| 76d8c027ea | |||
| 8cc5def978 | |||
| 8bf61b66e0 | |||
| 2f716385a5 | |||
| 16973a3203 | |||
| 5157366942 | |||
| 4f49625022 | |||
| e4272e2571 | |||
| a344c71a41 | |||
| 16084755d4 | |||
| 677842f5e2 | |||
| e52c9f56fa | |||
| 871bec2cf3 | |||
| 0a5ea3ad64 | |||
| 11557de866 | |||
| 0a1fb88174 | |||
| 1b28ddd007 | |||
| 447c1d1d90 | |||
| 050637948a | |||
| 0497d6aaa5 | |||
| be56ae95c5 | |||
| c8603a2a34 | |||
| 3b2e8eefa4 | |||
| 06f2f7c9ea | |||
| 3908ee690d | |||
| a15279766f | |||
| 45e2ff00f0 | |||
| 2f27d2bd0b | |||
| 2ed39e6df0 | |||
| 49687fda7e | |||
| 3bb30bcbdd | |||
| 6c7a1a5cfa | |||
| 52595458c5 | |||
| 2428daedb4 | |||
| 7cd86f0036 | |||
| 259cba1dc8 | |||
| 08d0134f8c | |||
| 24e76181e6 | |||
| 70ce9ee91c | |||
| f9a66b1371 | |||
| 570e6bda06 | |||
| 9150004850 | |||
| 493407434e |
-90
@@ -4,96 +4,6 @@
|
||||
*.pdb
|
||||
.vs/*
|
||||
|
||||
#--------------------------------
|
||||
# Area VersGen
|
||||
#--------------------------------
|
||||
/VersGen/bin/*
|
||||
/VersGen/obj/*
|
||||
|
||||
#--------------------------------
|
||||
# area MapoDb
|
||||
#--------------------------------
|
||||
/MapoDb/bin/*
|
||||
/MapoDb/obj/*
|
||||
|
||||
|
||||
#--------------------------------
|
||||
# area MP
|
||||
#--------------------------------
|
||||
/MP/bin/*
|
||||
/MP/obj/*
|
||||
MP/logs/*.txt
|
||||
MP/logs/*.zip
|
||||
MP-LAND/logs/
|
||||
|
||||
#--------------------------------
|
||||
# Area MP-MON (MoonPro-MONitor)
|
||||
#--------------------------------
|
||||
/MP-MON/logs/*.zip
|
||||
/MP-MON/logs/*.txt
|
||||
/MP-MON/bin/*
|
||||
/MP-MON/obj/*
|
||||
/MP-MON/WebCharts/*.png
|
||||
|
||||
#--------------------------------
|
||||
# Area MP-IO (MoonPro-IO)
|
||||
#--------------------------------
|
||||
/MP-IO/logs/*.zip
|
||||
/MP-IO/logs/*.txt
|
||||
/MP-IO/bin/*
|
||||
/MP-IO/obj/*
|
||||
/MP-IO/fileUpload/
|
||||
!/MP-IO/fileUpload/.PlaceHolder.file
|
||||
|
||||
#--------------------------------
|
||||
# Area MP-Admin
|
||||
#--------------------------------
|
||||
/MP-Admin/logs/*.zip
|
||||
/MP-Admin/logs/*.txt
|
||||
/MP-Admin/bin/*
|
||||
/MP-Admin/obj/*
|
||||
/MP-ADM/logs/*.zip
|
||||
/MP-ADM/logs/*.txt
|
||||
/MP-ADM/bin/*
|
||||
/MP-ADM/obj/*
|
||||
|
||||
|
||||
#--------------------------------
|
||||
# Area ES3
|
||||
#--------------------------------
|
||||
/ES3/logs/*.zip
|
||||
/ES3/logs/*.txt
|
||||
/ES3/bin/*
|
||||
/ES3/obj/*
|
||||
|
||||
#--------------------------------
|
||||
# Area MoonProTablet
|
||||
#--------------------------------
|
||||
/MP-TAB/logs/*.zip
|
||||
/MP-TAB/logs/*.txt
|
||||
/MP-TAB/bin/*
|
||||
/MP-TAB/obj/*
|
||||
/MP-TAB/WebCharts/*.png
|
||||
/MP-TAB/images/macchine/*.*
|
||||
!/MP-TAB/images/macchine/Steamware.png
|
||||
/MP-TAB/Files/Disegni/*.pdf
|
||||
!/MP-TAB/Files/Disegni/ND.pdf
|
||||
MP-TAB/logs/
|
||||
|
||||
|
||||
#--------------------------------
|
||||
# Area MoonPro
|
||||
#--------------------------------
|
||||
/MP-Site/logs/*.zip
|
||||
/MP-Site/logs/*.txt
|
||||
/MP-Site/bin/*
|
||||
/MP-Site/obj/*
|
||||
/MP-Site/WebCharts/*.png
|
||||
/MP-Site/images/macchine/*.*
|
||||
!/MP-Site/images/macchine/Steamware.png
|
||||
|
||||
|
||||
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
+33
-55
@@ -1,10 +1,4 @@
|
||||
variables:
|
||||
# NUGET_PATH: 'C:\Tools\nuget.exe'
|
||||
# MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
|
||||
# ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
|
||||
# EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
|
||||
# DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
|
||||
# NEW_REL: ''
|
||||
VERS_MAIN: '0.9'
|
||||
NEXUS_PATH: 'GWMS'
|
||||
APP_NAME: 'GWMS.UI'
|
||||
@@ -12,13 +6,22 @@ variables:
|
||||
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
||||
.nuget-fix: &nuget-fix
|
||||
- |
|
||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
||||
if ($hasSource -eq 0) {
|
||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
||||
} else {
|
||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
||||
echo "esecuzione Nuget FIX steps"
|
||||
dotnet nuget list source
|
||||
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
|
||||
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||
dotnet nuget remove source "`"Steamware Nexus Proxy`""
|
||||
}
|
||||
echo $hasSource
|
||||
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
|
||||
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||
dotnet nuget remove source "`"Steamware Nexus`""
|
||||
}
|
||||
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
|
||||
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||
dotnet nuget remove source nexus-proxy-v3
|
||||
}
|
||||
dotnet nuget add source https://nexus.steamware.net/repository/nuget-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
|
||||
echo "Steamware Nexus Source added"
|
||||
|
||||
# helper creazione hash files
|
||||
.hashBuild: &hashBuild
|
||||
@@ -52,79 +55,54 @@ variables:
|
||||
$File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*")
|
||||
ForEach ($File in $File2Send) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/$FileName
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$VersNumb/$FileName
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
|
||||
|
||||
}
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/manifest.xml
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/ChangeLog.html
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
||||
|
||||
|
||||
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
# - deploy
|
||||
- installer
|
||||
- release
|
||||
|
||||
build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore
|
||||
- dotnet restore GWMS.sln
|
||||
script:
|
||||
- dotnet build
|
||||
|
||||
test:
|
||||
stage: test
|
||||
only:
|
||||
- develop
|
||||
needs: ["build"]
|
||||
script:
|
||||
- dotnet test
|
||||
|
||||
# IIS01:deploy:
|
||||
# stage: deploy
|
||||
# only:
|
||||
# - develop
|
||||
# needs: ["test"]
|
||||
# # before_script:
|
||||
# # - *nuget-fix
|
||||
# # - dotnet restore
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
|
||||
|
||||
|
||||
# IIS02:deploy:
|
||||
# stage: deploy
|
||||
# only:
|
||||
# - master
|
||||
# needs: ["build"]
|
||||
# # before_script:
|
||||
# # - *nuget-fix
|
||||
# # - dotnet restore
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
|
||||
# - dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
|
||||
- dotnet build -p:Configuration=Release GWMS.UI/GWMS.UI.csproj
|
||||
|
||||
installer:
|
||||
stage: installer
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
needs: ["build"]
|
||||
before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore
|
||||
- *nuget-fix
|
||||
- dotnet restore GWMS.sln
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
|
||||
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
|
||||
# pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/
|
||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish -r linux-x64 --self-contained false
|
||||
# qui il deploy su nexus...
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
release:
|
||||
stage: release
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
#- feature/Deploy_CI_CD
|
||||
# - master
|
||||
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (web)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/GWMS.UI/bin/Debug/net6.0/GWMS.UI.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/GWMS.UI",
|
||||
"stopAtEntry": false,
|
||||
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
|
||||
},
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"sourceFileMap": {
|
||||
"/Views": "${workspaceFolder}/Views"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace GWMS.Data
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public AdminContext(DbContextOptions<GWMSContext> options) : base(options)
|
||||
public AdminContext(DbContextOptions<AdminContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,8 +56,6 @@ namespace GWMS.Data
|
||||
string connString = DbConfig.ADMIN_CONNECTION_STRING;
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
//connString = _configuration.GetConnectionString("GWMS.Data");
|
||||
//connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;";
|
||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
||||
optionsBuilder.UseMySql(connString, serverVersion);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
public class Constants
|
||||
public class Const
|
||||
{
|
||||
|
||||
// classi utilità x cache REDIS dati DB
|
||||
public const string rKeyConfig = "GWMS";
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace GWMS.Data.DTO
|
||||
{
|
||||
public class PlantLevSumDTO
|
||||
{
|
||||
#region Public Properties
|
||||
public int PlantId { get; set; }
|
||||
public string PlantCode { get; set; } = "";
|
||||
public string PlantDesc { get; set; } = "";
|
||||
|
||||
public DateTime DataRif { get; set; } = DateTime.Today;
|
||||
|
||||
public double LevelStart { get; set; } = 0;
|
||||
public double LevelMin { get; set; } = 0;
|
||||
public double LevelMax { get; set; } = 99999;
|
||||
public double LevelEnd { get; set; } = 0;
|
||||
|
||||
public DateTime FillStart { get; set; } = DateTime.Today;
|
||||
public DateTime FillEnd { get; set; } = DateTime.Today;
|
||||
|
||||
/// <summary>
|
||||
/// Valore minimo x determinare un carico (399kg)
|
||||
/// </summary>
|
||||
public double DeltaMin { get; set; } = 399;
|
||||
|
||||
public bool HasRefill
|
||||
{
|
||||
get
|
||||
{
|
||||
return (LevelMax > LevelStart + DeltaMin) && ((LevelStart + LevelEnd) > 0);
|
||||
}
|
||||
}
|
||||
public bool HasExecution
|
||||
{
|
||||
get
|
||||
{
|
||||
return ExecutionTS.Count > 0;
|
||||
}
|
||||
}
|
||||
public bool HasOrder
|
||||
{
|
||||
get
|
||||
{
|
||||
return OrderTS.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public double QtaOrdinata
|
||||
{
|
||||
get
|
||||
{
|
||||
double answ = 0;
|
||||
if (OrderTS.Count > 0)
|
||||
{
|
||||
answ = OrderTS.Sum(x => x.ValDouble);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public double QtaVersata
|
||||
{
|
||||
get
|
||||
{
|
||||
double answ = 0;
|
||||
if (ExecutionTS.Count > 0)
|
||||
{
|
||||
answ = ExecutionTS.Sum(x => x.ValDouble);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public double QtaVenduta
|
||||
{
|
||||
get
|
||||
{
|
||||
double answ = LevelStart-LevelEnd + QtaVersata;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
public List<TSData> LevelTS { get; set; } = new List<TSData>();
|
||||
public List<TSData> ExecutionTS { get; set; } = new List<TSData>();
|
||||
public List<TSData> OrderTS { get; set; } = new List<TSData>();
|
||||
public List<int> OrdersIds { get; set; } = new List<int>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,17 @@ namespace GWMS.Data.DTO
|
||||
{
|
||||
#region Public Properties
|
||||
public int PlantId { get; set; }
|
||||
|
||||
public string PlantCode { get; set; } = "";
|
||||
public string PlantDesc { get; set; } = "";
|
||||
|
||||
public DateTime LastUpdate { get; set; } = DateTime.Today.AddYears(-10);
|
||||
|
||||
public double LevelMax { get; set; } = 99999;
|
||||
|
||||
public double LevelAct { get; set; } = 0;
|
||||
public double LevelReorder { get; set; } = 0;
|
||||
public double OrderQtyStd { get; set; } = 0;
|
||||
public double MidnightQty { get; set; } = 0;
|
||||
|
||||
public int LevelRatio
|
||||
{
|
||||
@@ -33,9 +37,35 @@ namespace GWMS.Data.DTO
|
||||
}
|
||||
}
|
||||
|
||||
public double ReorderRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
double answ = 0;
|
||||
double denom = LevelMax == 0 ? 1 : LevelMax;
|
||||
answ = Math.Round((double)(LevelReorder * 100 / denom), 2);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
LevelReorder = value * LevelMax / 100;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Storico Livelli
|
||||
/// </summary>
|
||||
public List<TSData> LevelTS { get; set; } = new List<TSData>();
|
||||
|
||||
/// <summary>
|
||||
/// Storico Ordini
|
||||
/// </summary>
|
||||
public List<TSData> OrderTS { get; set; } = new List<TSData>();
|
||||
|
||||
/// <summary>
|
||||
/// Storico Vendite
|
||||
/// </summary>
|
||||
public List<TSData> SoldTS { get; set; } = new List<TSData>();
|
||||
|
||||
public double TempMax { get; set; } = 40;
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace GWMS.Data.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella dati Plant (log storico)
|
||||
/// </summary>
|
||||
[Table("AlarmLog")]
|
||||
public class AlarmLogModel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int AlarmLogId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data registazione
|
||||
/// </summary>
|
||||
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Impianto di riferimento
|
||||
/// </summary>
|
||||
public int PlantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo area memoria allarme
|
||||
/// </summary>
|
||||
[MaxLength(50)]
|
||||
public string MemAddress { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indice nel banco allarmi
|
||||
/// </summary>
|
||||
public int Index { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Valore banco allarmi
|
||||
/// </summary>
|
||||
public uint Status { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Valore decodificato (opzionale)
|
||||
/// </summary>
|
||||
public string ValDecoded { get; set; } = "";
|
||||
|
||||
[ForeignKey("PlantId")]
|
||||
public virtual PlantDetailModel Plant { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,10 @@ namespace GWMS.Data.DatabaseModels
|
||||
|
||||
public double ExecutionQty { get; set; } = 0;
|
||||
|
||||
public double LevelStart { get; set; } = 0;
|
||||
|
||||
public double LevelEnd { get; set; } = 1;
|
||||
|
||||
[ForeignKey("PlantId")]
|
||||
public virtual PlantDetailModel Plant { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace GWMS.Data.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella Setup aprametri
|
||||
/// </summary>
|
||||
[Table("ParamSend")]
|
||||
public class ParamSendModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Plant di riferimento
|
||||
/// </summary>
|
||||
public int PlantId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Uid parametro
|
||||
/// </summary>
|
||||
public string ParamUid { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo invio registrato
|
||||
/// </summary>
|
||||
public DateTime LastSend { get; set; } = DateTime.Today.AddDays(-7);
|
||||
|
||||
/// <summary>
|
||||
/// Veto invio programmato
|
||||
/// </summary>
|
||||
public DateTime VetoSend { get; set; } = DateTime.Today.AddDays(-7);
|
||||
|
||||
/// <summary>
|
||||
/// Invio automatico abilitato
|
||||
/// </summary>
|
||||
public bool enabled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Inizio finestra oraria in cui inviare parametri
|
||||
/// </summary>
|
||||
public int windStart { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Fine finestra oraria in cui inviare parametri
|
||||
/// </summary>
|
||||
public int windEnd { get; set; } = 2;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace GWMS.Data.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella Setup aprametri
|
||||
/// </summary>
|
||||
[Table("ParamSet")]
|
||||
public class ParamSetModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ParamSetId { get; set; }
|
||||
|
||||
public int PlantId { get; set; } = 0;
|
||||
|
||||
public string ParamUid { get; set; } = "";
|
||||
|
||||
|
||||
public DateTime Scadenza { get; set; } = DateTime.Today;
|
||||
|
||||
public decimal TargetVal { get; set; } = 0;
|
||||
|
||||
[MaxLength(250)]
|
||||
public string Note { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -26,21 +26,11 @@ namespace GWMS.Data.DatabaseModels
|
||||
[MaxLength(250)]
|
||||
public string PlantDesc { get; set; } = "";
|
||||
|
||||
public double LevelMax { get; set; } = 9999;
|
||||
public double LevelMax { get; set; } = 29999;
|
||||
|
||||
public double LevelReorder { get; set; } = 0;
|
||||
|
||||
//public double PressMax { get; set; } = 9999;
|
||||
|
||||
//public double PressAct { get; set; } = 0;
|
||||
|
||||
//public double PressBHMax { get; set; } = 9999;
|
||||
|
||||
//public double PressBHAct { get; set; } = 0;
|
||||
|
||||
//public double PressBLMax { get; set; } = 9999;
|
||||
|
||||
//public double PressBLAct { get; set; } = 0;
|
||||
public double OrderQtyStd { get; set; } = 1000;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace GWMS.Data.DatabaseModels
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int PlantDataId { get; set; }
|
||||
|
||||
|
||||
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data.DatabaseModels
|
||||
{
|
||||
[Keyless]
|
||||
/// <summary>
|
||||
/// Classe fake x il conteggio tabelle e check preliminari
|
||||
/// </summary>
|
||||
[Table("DbSetCounts")]
|
||||
public class TableCount
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public int Count { get; set; }
|
||||
public string TableName { get; set; }
|
||||
[Key]
|
||||
public string TableName { get; set; } = "ND";
|
||||
public int Count { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace GWMS.Data.DatabaseModels
|
||||
|
||||
public double PositionLongitude { get; set; }
|
||||
|
||||
public DateTime PositionUpdated { get; set; } = DateTime.Now;
|
||||
public DateTime PositionUpdated { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace GWMS.Data.DatabaseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella Users
|
||||
/// </summary>
|
||||
[Table("Users")]
|
||||
public class UserModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int UserId { get; set; }
|
||||
|
||||
[Column(Order = 1), MaxLength(50)]
|
||||
public string UserName { get; set; } = "";
|
||||
|
||||
[Column(Order = 1), MaxLength(250)]
|
||||
public string SaltPasswd { get; set; } = "";
|
||||
|
||||
[Column(Order = 3), MaxLength(50)]
|
||||
public string Lastname { get; set; } = "";
|
||||
|
||||
[Column(Order = 4), MaxLength(50)]
|
||||
public string Firstname { get; set; } = "";
|
||||
|
||||
[Column(Order = 5), MaxLength(250)]
|
||||
public string Email { get; set; } = "";
|
||||
|
||||
[Column(Order = 6), MaxLength(10)]
|
||||
public string Lang { get; set; } = "IT";
|
||||
|
||||
[Column(Order = 7), MaxLength(100)]
|
||||
public string AuthKey { get; set; } = "";
|
||||
|
||||
[Column(Order = 8)]
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
[Column(Order = 9)]
|
||||
public UserLevel Livello { get; set; } = UserLevel.ND;
|
||||
|
||||
[Column(Order = 10)]
|
||||
public int MaskPlantId { get; set; } = 9999;
|
||||
|
||||
[Column(Order = 11)]
|
||||
public int MaskSupplierId { get; set; } = 9999;
|
||||
|
||||
[Column(Order = 12)]
|
||||
public int MaskTranspId { get; set; } = 9999;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using GWMS.Data.DatabaseModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NLog;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
@@ -48,17 +44,21 @@ namespace GWMS.Data
|
||||
|
||||
public static bool ExecMigrationIdentity()
|
||||
{
|
||||
Log.Info($"ExecMigrationIdentity: Start");
|
||||
// esecuzione migrazione
|
||||
var migrateTask = Task.Run(async () => await DbAdmin.migrateDbIdentity());
|
||||
migrateTask.Wait();
|
||||
Log.Info($"ExecMigrationIdentity: Completed");
|
||||
return migrateTask.Result;
|
||||
}
|
||||
|
||||
public static bool ExecMigrationMain()
|
||||
{
|
||||
Log.Info($"ExecMigrationMain: Start");
|
||||
// esecuzione migrazione
|
||||
var migrateTask = Task.Run(async () => await DbAdmin.migrateDbMain());
|
||||
migrateTask.Wait();
|
||||
Log.Info($"ExecMigrationMain: Completed");
|
||||
return migrateTask.Result;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ namespace GWMS.Data
|
||||
return serverVersion;
|
||||
}
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
+77
-1
@@ -43,6 +43,77 @@ namespace GWMS.Data
|
||||
String
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco task ammessi (x IOB-WIN da eseguire...)
|
||||
/// </summary>
|
||||
public enum taskType
|
||||
{
|
||||
/// <summary>
|
||||
/// Task nullo / fake
|
||||
/// </summary>
|
||||
nihil,
|
||||
|
||||
/// <summary>
|
||||
/// Rimanda a PLC eventuale segnale NON in setup (MA NON RESETTA)
|
||||
/// </summary>
|
||||
fixStopSetup,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC di forzare il reset del contapezzi
|
||||
/// </summary>
|
||||
forceResetPzCount,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC di forzare il NUOVO valore di contapezzi (impostato come value)
|
||||
/// </summary>
|
||||
forceSetPzCount,
|
||||
|
||||
/// <summary>
|
||||
/// Imposta Articolo su PLC
|
||||
/// </summary>
|
||||
setArt,
|
||||
|
||||
/// <summary>
|
||||
/// Imposta Commessa su PLC
|
||||
/// </summary>
|
||||
setComm,
|
||||
|
||||
/// <summary>
|
||||
/// Set di un PARAMETRO su PLC (in value avremo un JSON object)
|
||||
/// </summary>
|
||||
setParameter,
|
||||
|
||||
/// <summary>
|
||||
/// Set Programma CNC su PLC
|
||||
/// </summary>
|
||||
setProg,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato come value)
|
||||
/// </summary>
|
||||
setPzComm,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC iniziato setup (e secondo casi ferma contapezzi /resetta)
|
||||
/// </summary>
|
||||
startSetup,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC finito setup (e secondo casi ferma contapezzi /resetta)
|
||||
/// </summary>
|
||||
stopSetup,
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta invio watchdog a PLC
|
||||
/// </summary>
|
||||
sendWatchDogMes2Plc,
|
||||
|
||||
/// <summary>
|
||||
/// Indica che è FINITA la produzione (e quindi cancello dati backup)
|
||||
/// </summary>
|
||||
endProd,
|
||||
}
|
||||
|
||||
public enum UserLevel
|
||||
{
|
||||
ND = 0,
|
||||
@@ -75,6 +146,11 @@ namespace GWMS.Data
|
||||
/// <summary>
|
||||
/// Valore minimo del periodo
|
||||
/// </summary>
|
||||
MIN
|
||||
MIN,
|
||||
|
||||
/// <summary>
|
||||
/// Calcolo MEDIANA
|
||||
/// </summary>
|
||||
MEDIAN
|
||||
}
|
||||
}
|
||||
+13
-11
@@ -1,29 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Controllers\GWMS.Data.DbController.cs" />
|
||||
<Compile Remove="DatabaseModels\UserModel.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
|
||||
<PackageReference Include="MailKit" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.7">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.10" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+46
-29
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using GWMS.Data.DatabaseModels;
|
||||
using NLog;
|
||||
using System.Linq;
|
||||
using GWMS.Data.Controllers;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
@@ -28,13 +26,6 @@ namespace GWMS.Data
|
||||
public GWMSContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
try
|
||||
{
|
||||
// se non ci fosse... crea o migra!
|
||||
Database.Migrate();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{ }
|
||||
}
|
||||
|
||||
public GWMSContext(DbContextOptions<GWMSContext> options) : base(options)
|
||||
@@ -45,7 +36,9 @@ namespace GWMS.Data
|
||||
Database.Migrate();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{ }
|
||||
{
|
||||
Log.Error(exc, "Exception during context initialization 02");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -53,20 +46,34 @@ namespace GWMS.Data
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<RebootLogModel> DbRebootLog { get; set; }
|
||||
|
||||
public virtual DbSet<AlarmLogModel> DbSetAlarmLog { get; set; }
|
||||
|
||||
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
|
||||
|
||||
public virtual DbSet<ItemModel> DbSetItems { get; set; }
|
||||
|
||||
public virtual DbSet<AnKeyValModel> DbSetKeyVal { get; set; }
|
||||
|
||||
public virtual DbSet<ListValModel> DbSetListVal { get; set; }
|
||||
|
||||
public virtual DbSet<OrderModel> DbSetOrders { get; set; }
|
||||
|
||||
public virtual DbSet<ParamSendModel> DbSetParamSend { get; set; }
|
||||
|
||||
public virtual DbSet<ParamSetModel> DbSetParamSet { get; set; }
|
||||
|
||||
public virtual DbSet<PlantDetailModel> DbSetPlant { get; set; }
|
||||
|
||||
public virtual DbSet<PlantLogModel> DbSetPlantLog { get; set; }
|
||||
|
||||
public virtual DbSet<PlantStatusModel> DbSetPlantStatus { get; set; }
|
||||
|
||||
public virtual DbSet<WeekPlanModel> DbSetPlantSupplWeekPlan { get; set; }
|
||||
|
||||
public virtual DbSet<SupplierModel> DbSetSupplier { get; set; }
|
||||
|
||||
public virtual DbSet<TransporterModel> DbSetTransporter { get; set; }
|
||||
public virtual DbSet<UserModel> DbSetUser { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -81,26 +88,13 @@ namespace GWMS.Data
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
// default
|
||||
string connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;";
|
||||
|
||||
// tento setup da config
|
||||
try
|
||||
{
|
||||
//string server = _configuration["DbConfig:Server"];
|
||||
//string nKey = _configuration["DbConfig:nKey"];
|
||||
//string sKey = _configuration["DbConfig:sKey"];
|
||||
|
||||
//DbConfig.InitDb(server, nKey, sKey);
|
||||
//DbConfig.CheckUser(nKey, sKey);
|
||||
|
||||
// uso conn string calcolata
|
||||
connString = DbConfig.CONNECTION_STRING;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string connString = DbConfig.CONNECTION_STRING;
|
||||
//if (string.IsNullOrEmpty(connString))
|
||||
//{
|
||||
// connString = "Server=localhost;port=3306;database=GWMS_PZZFRR;user=user_PZZFRR;pwd=pwd_M3T@n0;sslmode=None;";
|
||||
//}
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
//connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;";
|
||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
||||
optionsBuilder.UseMySql(connString, serverVersion);
|
||||
}
|
||||
@@ -123,11 +117,34 @@ namespace GWMS.Data
|
||||
|
||||
modelBuilder.Entity<PlantStatusModel>().HasKey(c => new { c.PlantId, c.FluxType });
|
||||
|
||||
modelBuilder.Entity<ParamSendModel>().HasKey(c => new { c.PlantId, c.ParamUid });
|
||||
|
||||
modelBuilder.Entity<PlantLogModel>().HasIndex(c => new { c.PlantId }, "IX_PlantLog_PlantId");
|
||||
modelBuilder.Entity<PlantLogModel>().HasIndex(c => new { c.PlantId, c.DtEvent }, "IX_PlantLog_PlantDtEv");
|
||||
|
||||
modelBuilder.Seed();
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void DbForceMigrate()
|
||||
{
|
||||
try
|
||||
{
|
||||
// se non ci fosse... crea o migra!
|
||||
Database.Migrate();
|
||||
Log.Info("DbForceMigrate: done!");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error(exc, "DbForceMigrate: Exception during context initialization 01");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
+65
-4
@@ -2,9 +2,6 @@
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
@@ -27,7 +24,7 @@ namespace GWMS.Data
|
||||
/// <summary>
|
||||
/// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
|
||||
/// </summary>
|
||||
public int factor { get; set; } = 1;
|
||||
public decimal factor { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Indice nell'area di memoria (da valore iniziale = 0)
|
||||
@@ -65,6 +62,11 @@ namespace GWMS.Data
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public plcDataType tipoMem { get; set; } = plcDataType.Int;
|
||||
|
||||
/// <summary>
|
||||
/// Unità di misura del parametro
|
||||
/// </summary>
|
||||
public string unit { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto)
|
||||
/// </summary>
|
||||
@@ -191,6 +193,40 @@ namespace GWMS.Data
|
||||
/// </summary>
|
||||
public string name { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper valore richiesto come decimal
|
||||
/// </summary>
|
||||
public decimal reqValDec
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal answ = 0;
|
||||
decimal.TryParse(reqValue, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
reqValue = $"{value}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper valore richiesto come INT
|
||||
/// </summary>
|
||||
public int reqValInt
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(reqValue, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
reqValue = $"{value}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indica il NUOVO valore richiesto x l'item
|
||||
/// </summary>
|
||||
@@ -201,11 +237,36 @@ namespace GWMS.Data
|
||||
/// </summary>
|
||||
public string uid { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Unità Misura parametro
|
||||
/// </summary>
|
||||
public string UM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Valore MASSIMO (SE impostato)
|
||||
/// </summary>
|
||||
public double valMax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Valore minimo (SE impostato)
|
||||
/// </summary>
|
||||
public double valMin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ordinamento
|
||||
/// </summary>
|
||||
public int displOrdinal { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
|
||||
/// </summary>
|
||||
public string value { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione valore
|
||||
/// </summary>
|
||||
public string description { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indica se sia abilitato in scrittura (WRITE)
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using MailKit.Net.Smtp;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MimeKit;
|
||||
using MimeKit.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementazione interfaccia email con pacchetto MailKIT
|
||||
///
|
||||
/// https://www.ryadel.com/en/asp-net-core-send-email-messages-smtp-mailkit/
|
||||
/// </summary>
|
||||
public class MailKitEmailSender : IEmailSender
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public MailKitEmailSender(IOptions<MailKitEmailSenderOptions> options)
|
||||
{
|
||||
this.Options = options.Value;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public MailKitEmailSenderOptions Options { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public Task Execute(string to, string subject, string message)
|
||||
{
|
||||
// create message
|
||||
var email = new MimeMessage();
|
||||
email.Sender = MailboxAddress.Parse(Options.Sender_EMail);
|
||||
if (!string.IsNullOrEmpty(Options.Sender_Name))
|
||||
email.Sender.Name = Options.Sender_Name;
|
||||
email.From.Add(email.Sender);
|
||||
email.To.Add(MailboxAddress.Parse(to));
|
||||
email.Subject = subject;
|
||||
email.Body = new TextPart(TextFormat.Html) { Text = message };
|
||||
|
||||
// send email
|
||||
using (var smtp = new SmtpClient())
|
||||
{
|
||||
smtp.Connect(Options.Host_Address, Options.Host_Port, Options.Host_SecureSocketOptions);
|
||||
smtp.Authenticate(Options.Host_Username, Options.Host_Password);
|
||||
smtp.Send(email);
|
||||
smtp.Disconnect(true);
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public Task SendEmailAsync(string email, string subject, string message)
|
||||
{
|
||||
return Execute(email, subject, message);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using MailKit.Security;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
public class MailKitEmailSenderOptions
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public MailKitEmailSenderOptions()
|
||||
{
|
||||
Host_SecureSocketOptions = SecureSocketOptions.Auto;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string Host_Address { get; set; }
|
||||
|
||||
public string Host_Password { get; set; }
|
||||
public int Host_Port { get; set; }
|
||||
|
||||
public SecureSocketOptions Host_SecureSocketOptions { get; set; }
|
||||
public string Host_Username { get; set; }
|
||||
public string Sender_EMail { get; set; }
|
||||
|
||||
public string Sender_Name { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,875 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20210806162035_AddOrderDefQty")]
|
||||
partial class AddOrderDefQty
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.7");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(1664),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(2482),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AuthKey")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Firstname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("Lang")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("varchar(10)");
|
||||
|
||||
b.Property<string>("Lastname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("Livello")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskPlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskSupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskTranspId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SaltPasswd")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.ToTable("Users");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = 1,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt98",
|
||||
Email = "samuele@steamware.net",
|
||||
Firstname = "Samuele",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Locatelli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "samuele.locatelli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 2,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt91",
|
||||
Email = "giancarlo@steamware.net",
|
||||
Firstname = "Giancarlo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Rottoli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "giancarlo.rottoli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 3,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt93",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Steamware",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Admin",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "steamw.admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 4,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt97",
|
||||
Email = "a.pizzaferri@pizzaferripetroli.it",
|
||||
Firstname = "Angelo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pizzaferri",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "angelo.pizzaferri"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 5,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt99",
|
||||
Email = "andrei.valeanu@winnlab.it",
|
||||
Firstname = "Andrei",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Valeanu",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "andrei.valeanu"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 6,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt92",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LIQUIGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 1,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "liquigas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 7,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt94",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "VULKANGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 2,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "vulkangas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 8,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt95",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LEVORATO",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 1,
|
||||
SaltPasswd = "",
|
||||
UserName = "levorato.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 9,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "TRAFFIK",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 2,
|
||||
SaltPasswd = "",
|
||||
UserName = "traffik.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 10,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Collecchio",
|
||||
Livello = 3,
|
||||
MaskPlantId = 1,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz03.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 11,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Noceto",
|
||||
Livello = 3,
|
||||
MaskPlantId = 2,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz04.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 12,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Baganzola",
|
||||
Livello = 3,
|
||||
MaskPlantId = 3,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz05.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 13,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pilastrello",
|
||||
Livello = 3,
|
||||
MaskPlantId = 4,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz08.user01"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class AddOrderDefQty : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "OrderQtyStd",
|
||||
table: "PlantDetail",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PlantDetail",
|
||||
keyColumn: "PlantId",
|
||||
keyValue: 1,
|
||||
column: "OrderQtyStd",
|
||||
value: 18000.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PlantDetail",
|
||||
keyColumn: "PlantId",
|
||||
keyValue: 2,
|
||||
column: "OrderQtyStd",
|
||||
value: 18000.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PlantDetail",
|
||||
keyColumn: "PlantId",
|
||||
keyValue: 3,
|
||||
column: "OrderQtyStd",
|
||||
value: 18000.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PlantDetail",
|
||||
keyColumn: "PlantId",
|
||||
keyValue: 4,
|
||||
column: "OrderQtyStd",
|
||||
value: 18000.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(1664));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(2482));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OrderQtyStd",
|
||||
table: "PlantDetail");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9521));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9901));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,881 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20210809143652_OrderFillData")]
|
||||
partial class OrderFillData
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.7");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AuthKey")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Firstname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("Lang")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("varchar(10)");
|
||||
|
||||
b.Property<string>("Lastname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("Livello")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskPlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskSupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskTranspId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SaltPasswd")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.ToTable("Users");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = 1,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt98",
|
||||
Email = "samuele@steamware.net",
|
||||
Firstname = "Samuele",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Locatelli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "samuele.locatelli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 2,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt91",
|
||||
Email = "giancarlo@steamware.net",
|
||||
Firstname = "Giancarlo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Rottoli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "giancarlo.rottoli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 3,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt93",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Steamware",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Admin",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "steamw.admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 4,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt97",
|
||||
Email = "a.pizzaferri@pizzaferripetroli.it",
|
||||
Firstname = "Angelo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pizzaferri",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "angelo.pizzaferri"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 5,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt99",
|
||||
Email = "andrei.valeanu@winnlab.it",
|
||||
Firstname = "Andrei",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Valeanu",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "andrei.valeanu"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 6,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt92",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LIQUIGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 1,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "liquigas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 7,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt94",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "VULKANGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 2,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "vulkangas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 8,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt95",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LEVORATO",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 1,
|
||||
SaltPasswd = "",
|
||||
UserName = "levorato.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 9,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "TRAFFIK",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 2,
|
||||
SaltPasswd = "",
|
||||
UserName = "traffik.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 10,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Collecchio",
|
||||
Livello = 3,
|
||||
MaskPlantId = 1,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz03.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 11,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Noceto",
|
||||
Livello = 3,
|
||||
MaskPlantId = 2,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz04.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 12,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Baganzola",
|
||||
Livello = 3,
|
||||
MaskPlantId = 3,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz05.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 13,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pilastrello",
|
||||
Livello = 3,
|
||||
MaskPlantId = 4,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz08.user01"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class OrderFillData : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "LevelEnd",
|
||||
table: "Order",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "LevelStart",
|
||||
table: "Order",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LevelEnd",
|
||||
table: "Order");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LevelStart",
|
||||
table: "Order");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(1664));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 6, 18, 20, 35, 347, DateTimeKind.Local).AddTicks(2482));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20210824132434_RolesAdded")]
|
||||
partial class RolesAdded
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.8");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "24a790ae-8eac-4c9f-9043-aa688b626169",
|
||||
ConcurrencyStamp = "c9adff6c-ffac-48e3-899b-8549ca443071",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "7a024dca-5e5d-47be-b754-75c8921d88bf",
|
||||
ConcurrencyStamp = "3b9aab89-73b6-4051-9825-d5381d2896da",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "0a5335f9-64b2-4196-9d5b-db873cb48d94",
|
||||
ConcurrencyStamp = "25097cab-df45-4bdd-8616-041962c72050",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d",
|
||||
ConcurrencyStamp = "3c222fe9-d5e5-4ba0-9767-4c1777677105",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class RolesAdded : Migration
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "0a5335f9-64b2-4196-9d5b-db873cb48d94");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "24a790ae-8eac-4c9f-9043-aa688b626169");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7a024dca-5e5d-47be-b754-75c8921d88bf");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d");
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "24a790ae-8eac-4c9f-9043-aa688b626169", "c9adff6c-ffac-48e3-899b-8549ca443071", "ExtUser", "EXTUSER" },
|
||||
{ "7a024dca-5e5d-47be-b754-75c8921d88bf", "3b9aab89-73b6-4051-9825-d5381d2896da", "User", "USER" },
|
||||
{ "0a5335f9-64b2-4196-9d5b-db873cb48d94", "25097cab-df45-4bdd-8616-041962c72050", "Admin", "ADMIN" },
|
||||
{ "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d", "3c222fe9-d5e5-4ba0-9767-4c1777677105", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20210824143900_UndefRoleAdd")]
|
||||
partial class UndefRoleAdd
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.8");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "bf698c1c-ead1-4d88-83ef-536098876807",
|
||||
ConcurrencyStamp = "28d97b49-8df4-4d20-8680-1d3abbf4ed94",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "a1280bf2-7e5a-447b-b070-3bea27ba2239",
|
||||
ConcurrencyStamp = "d361332c-1ae0-486c-b1d8-1f2c9c36ad88",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "533995b8-8561-471a-b613-a03685141065",
|
||||
ConcurrencyStamp = "773db769-a518-406f-9144-31e1fd9f7a76",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "d4790e4e-600b-4bae-876d-04c619adc9b0",
|
||||
ConcurrencyStamp = "70529623-7648-4640-b69e-a1e0ddff10ed",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "3e7ddc7b-94eb-4364-b4d5-311c76dad5b1",
|
||||
ConcurrencyStamp = "1d59afd3-30f6-492c-87eb-cddf0b251f85",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class UndefRoleAdd : Migration
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "bf698c1c-ead1-4d88-83ef-536098876807");
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "bf698c1c-ead1-4d88-83ef-536098876807", "28d97b49-8df4-4d20-8680-1d3abbf4ed94", "Undef", "UNDEF" }
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20210824155840_FixRolesName")]
|
||||
partial class FixRolesName
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.8");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "5287113c-6493-4419-bbc9-2cb2f6455006",
|
||||
ConcurrencyStamp = "00059b0a-3e8c-406e-a578-2ae40c52435a",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "f27a0416-02cc-4e4c-8983-29cb51eb4f9a",
|
||||
ConcurrencyStamp = "b58874fc-02b5-4efa-b4d5-61bfda8b7c67",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145",
|
||||
ConcurrencyStamp = "cd1f0ba9-9f42-42f3-8271-1627ef55d36f",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "5b928219-a530-49c6-be33-f65253865a98",
|
||||
ConcurrencyStamp = "6de09bee-9a83-416a-90c4-27bb643519f6",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "e9befc87-9732-4c21-b91e-7aea6a289d35",
|
||||
ConcurrencyStamp = "f2bf6c1c-4043-4344-8b68-c8b2122ab88f",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class FixRolesName : Migration
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "5287113c-6493-4419-bbc9-2cb2f6455006");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "5b928219-a530-49c6-be33-f65253865a98");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "e9befc87-9732-4c21-b91e-7aea6a289d35");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f27a0416-02cc-4e4c-8983-29cb51eb4f9a");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "bf698c1c-ead1-4d88-83ef-536098876807", "28d97b49-8df4-4d20-8680-1d3abbf4ed94", "Undef", "UNDEF" },
|
||||
{ "24a790ae-8eac-4c9f-9043-aa688b626169", "c9adff6c-ffac-48e3-899b-8549ca443071", "ExtUser", "EXTUSER" },
|
||||
{ "7a024dca-5e5d-47be-b754-75c8921d88bf", "3b9aab89-73b6-4051-9825-d5381d2896da", "User", "USER" },
|
||||
{ "0a5335f9-64b2-4196-9d5b-db873cb48d94", "25097cab-df45-4bdd-8616-041962c72050", "Admin", "ADMIN" },
|
||||
{ "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d", "3c222fe9-d5e5-4ba0-9767-4c1777677105", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "0a5335f9-64b2-4196-9d5b-db873cb48d94");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "24a790ae-8eac-4c9f-9043-aa688b626169");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7a024dca-5e5d-47be-b754-75c8921d88bf");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "bf698c1c-ead1-4d88-83ef-536098876807");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "5287113c-6493-4419-bbc9-2cb2f6455006", "00059b0a-3e8c-406e-a578-2ae40c52435a", "Undef", "UNDEF" },
|
||||
{ "f27a0416-02cc-4e4c-8983-29cb51eb4f9a", "b58874fc-02b5-4efa-b4d5-61bfda8b7c67", "ExtUser", "EXTUSER" },
|
||||
{ "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145", "cd1f0ba9-9f42-42f3-8271-1627ef55d36f", "User", "USER" },
|
||||
{ "5b928219-a530-49c6-be33-f65253865a98", "6de09bee-9a83-416a-90c4-27bb643519f6", "Admin", "ADMIN" },
|
||||
{ "e9befc87-9732-4c21-b91e-7aea6a289d35", "f2bf6c1c-4043-4344-8b68-c8b2122ab88f", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20210826102940_AddTransporterRule")]
|
||||
partial class AddTransporterRule
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.7");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
|
||||
{
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TableName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.ToTable("DbSetCounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d",
|
||||
ConcurrencyStamp = "3caf0732-df97-4b81-ba2c-9fb51e34532a",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "47c8d4fb-6925-4ef0-a830-5df33e705d7a",
|
||||
ConcurrencyStamp = "9671ece6-f70a-4ca6-88db-64562e007c72",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "2d87821f-5c6d-4d9e-98d7-7ae801030100",
|
||||
ConcurrencyStamp = "9ee56f2f-558f-4579-9ad7-4a6150e3d822",
|
||||
Name = "ExtTransp",
|
||||
NormalizedName = "EXTTRANSP"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c",
|
||||
ConcurrencyStamp = "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb",
|
||||
ConcurrencyStamp = "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b",
|
||||
ConcurrencyStamp = "549b8a8d-ba83-4b79-be88-fde0bd4cc60f",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class AddTransporterRule : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "5287113c-6493-4419-bbc9-2cb2f6455006");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "5b928219-a530-49c6-be33-f65253865a98");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "e9befc87-9732-4c21-b91e-7aea6a289d35");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f27a0416-02cc-4e4c-8983-29cb51eb4f9a");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DbSetCounts",
|
||||
columns: table => new
|
||||
{
|
||||
Count = table.Column<int>(type: "int", nullable: false),
|
||||
TableName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d", "3caf0732-df97-4b81-ba2c-9fb51e34532a", "Undef", "UNDEF" },
|
||||
{ "47c8d4fb-6925-4ef0-a830-5df33e705d7a", "9671ece6-f70a-4ca6-88db-64562e007c72", "ExtUser", "EXTUSER" },
|
||||
{ "2d87821f-5c6d-4d9e-98d7-7ae801030100", "9ee56f2f-558f-4579-9ad7-4a6150e3d822", "ExtTransp", "EXTTRANSP" },
|
||||
{ "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c", "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64", "User", "USER" },
|
||||
{ "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb", "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12", "Admin", "ADMIN" },
|
||||
{ "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b", "549b8a8d-ba83-4b79-be88-fde0bd4cc60f", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DbSetCounts");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "2d87821f-5c6d-4d9e-98d7-7ae801030100");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "47c8d4fb-6925-4ef0-a830-5df33e705d7a");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "5287113c-6493-4419-bbc9-2cb2f6455006", "00059b0a-3e8c-406e-a578-2ae40c52435a", "Undef", "UNDEF" },
|
||||
{ "f27a0416-02cc-4e4c-8983-29cb51eb4f9a", "b58874fc-02b5-4efa-b4d5-61bfda8b7c67", "ExtUser", "EXTUSER" },
|
||||
{ "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145", "cd1f0ba9-9f42-42f3-8271-1627ef55d36f", "User", "USER" },
|
||||
{ "5b928219-a530-49c6-be33-f65253865a98", "6de09bee-9a83-416a-90c4-27bb643519f6", "Admin", "ADMIN" },
|
||||
{ "e9befc87-9732-4c21-b91e-7aea6a289d35", "f2bf6c1c-4043-4344-8b68-c8b2122ab88f", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,617 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20211022064058_RemoveLocalUser")]
|
||||
partial class RemoveLocalUser
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.10");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class RemoveLocalUser : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
AuthKey = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Email = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Firstname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
Lang = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Lastname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Livello = table.Column<int>(type: "int", nullable: false),
|
||||
MaskPlantId = table.Column<int>(type: "int", nullable: false),
|
||||
MaskSupplierId = table.Column<int>(type: "int", nullable: false),
|
||||
MaskTranspId = table.Column<int>(type: "int", nullable: false),
|
||||
SaltPasswd = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
UserName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.UserId);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 1,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Transporter",
|
||||
keyColumn: "TransporterId",
|
||||
keyValue: 2,
|
||||
column: "PositionUpdated",
|
||||
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470));
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Users",
|
||||
columns: new[] { "UserId", "AuthKey", "Email", "Firstname", "IsActive", "Lang", "Lastname", "Livello", "MaskPlantId", "MaskSupplierId", "MaskTranspId", "SaltPasswd", "UserName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "th1sIsTh3R1vrOfThNgt98", "samuele@steamware.net", "Samuele", true, "IT", "Locatelli", 1, 0, 0, 0, "", "samuele.locatelli" },
|
||||
{ 2, "th1sIsTh3R1vrOfThNgt91", "giancarlo@steamware.net", "Giancarlo", true, "IT", "Rottoli", 1, 0, 0, 0, "", "giancarlo.rottoli" },
|
||||
{ 3, "th1sIsTh3R1vrOfThNgt93", "info@steamware.net", "Steamware", true, "IT", "Admin", 1, 0, 0, 0, "", "steamw.admin" },
|
||||
{ 4, "th1sIsTh3R1vrOfThNgt97", "a.pizzaferri@pizzaferripetroli.it", "Angelo", true, "IT", "Pizzaferri", 2, 0, 0, 0, "", "angelo.pizzaferri" },
|
||||
{ 5, "th1sIsTh3R1vrOfThNgt99", "andrei.valeanu@winnlab.it", "Andrei", true, "IT", "Valeanu", 2, 0, 0, 0, "", "andrei.valeanu" },
|
||||
{ 6, "th1sIsTh3R1vrOfThNgt92", "info@steamware.net", "User", true, "IT", "LIQUIGAS", 4, 0, 1, 0, "", "liquigas.user01" },
|
||||
{ 7, "th1sIsTh3R1vrOfThNgt94", "info@steamware.net", "User", true, "IT", "VULKANGAS", 4, 0, 2, 0, "", "vulkangas.user01" },
|
||||
{ 8, "th1sIsTh3R1vrOfThNgt95", "info@steamware.net", "User", true, "IT", "LEVORATO", 4, 0, 0, 1, "", "levorato.user01" },
|
||||
{ 9, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "User", true, "IT", "TRAFFIK", 4, 0, 0, 2, "", "traffik.user01" },
|
||||
{ 10, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Collecchio", 3, 1, 0, 0, "", "piz03.user01" },
|
||||
{ 11, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Noceto", 3, 2, 0, 0, "", "piz04.user01" },
|
||||
{ 12, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Baganzola", 3, 3, 0, 0, "", "piz05.user01" },
|
||||
{ 13, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Pilastrello", 3, 4, 0, 0, "", "piz08.user01" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,644 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20211027091446_ParamSetAdded")]
|
||||
partial class ParamSetAdded
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.10");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class ParamSetAdded : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ParamSet",
|
||||
columns: table => new
|
||||
{
|
||||
ParamSetId = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
PlantId = table.Column<int>(type: "int", nullable: false),
|
||||
ParamUid = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Scadenza = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
TargetVal = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
|
||||
Note = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ParamSet", x => x.ParamSetId);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ParamSet");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,672 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20211027172923_ParamSendTable")]
|
||||
partial class ParamSendTable
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.10");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<DateTime>("LastSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("VetoSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("enabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("windEnd")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("windStart")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PlantId", "ParamUid");
|
||||
|
||||
b.ToTable("ParamSend");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class ParamSendTable : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ParamSend",
|
||||
columns: table => new
|
||||
{
|
||||
PlantId = table.Column<int>(type: "int", nullable: false),
|
||||
ParamUid = table.Column<string>(type: "varchar(255)", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
VetoSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
windStart = table.Column<int>(type: "int", nullable: false),
|
||||
windEnd = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ParamSend", x => new { x.PlantId, x.ParamUid });
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ParamSend");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,715 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20211028102841_AlarmLog")]
|
||||
partial class AlarmLog
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.10");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.Property<int>("AlarmLogIdId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("Index")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MemAddress")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<uint>("Status")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("ValDecoded")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("AlarmLogIdId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("AlarmLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<DateTime>("LastSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("VetoSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("enabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("windEnd")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("windStart")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PlantId", "ParamUid");
|
||||
|
||||
b.ToTable("ParamSend");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class AlarmLog : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AlarmLog",
|
||||
columns: table => new
|
||||
{
|
||||
AlarmLogIdId = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
DtEvent = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
PlantId = table.Column<int>(type: "int", nullable: false),
|
||||
MemAddress = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Index = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<uint>(type: "int unsigned", nullable: false),
|
||||
ValDecoded = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AlarmLog", x => x.AlarmLogIdId);
|
||||
table.ForeignKey(
|
||||
name: "FK_AlarmLog_PlantDetail_PlantId",
|
||||
column: x => x.PlantId,
|
||||
principalTable: "PlantDetail",
|
||||
principalColumn: "PlantId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AlarmLog_PlantId",
|
||||
table: "AlarmLog",
|
||||
column: "PlantId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AlarmLog");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,715 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20211028133250_AlarmLogFix")]
|
||||
partial class AlarmLogFix
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.10");
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.Property<int>("AlarmLogId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("Index")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MemAddress")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<uint>("Status")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("ValDecoded")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("AlarmLogId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("AlarmLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<DateTime>("LastSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("VetoSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("enabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("windEnd")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("windStart")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PlantId", "ParamUid");
|
||||
|
||||
b.ToTable("ParamSend");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class AlarmLogFix : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AlarmLogIdId",
|
||||
table: "AlarmLog",
|
||||
newName: "AlarmLogId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AlarmLogId",
|
||||
table: "AlarmLog",
|
||||
newName: "AlarmLogIdId");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20240411155438_RemoveTableCount")]
|
||||
partial class RemoveTableCount
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "315208c3-0fb0-421d-b373-8f4730106dd5",
|
||||
ConcurrencyStamp = "9bd570a3-2012-42a8-bb38-0030e0d45de2",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "757673aa-ea00-4b6a-8c98-f75b3dcd65b7",
|
||||
ConcurrencyStamp = "55cbb043-dbd6-4018-a834-050c2a15c30f",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "b5083225-0c73-40cb-a7be-db0747b20dca",
|
||||
ConcurrencyStamp = "496441df-9b5b-4df2-bdc2-54a073a4a912",
|
||||
Name = "ExtTransp",
|
||||
NormalizedName = "EXTTRANSP"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "b5136e2c-f9e9-43ae-8cfd-d4b2883b963a",
|
||||
ConcurrencyStamp = "2009b165-9681-4891-934e-020a35e6fc80",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "0bbf8f56-fcc8-4afd-9865-805881ca4067",
|
||||
ConcurrencyStamp = "759f05b6-3995-4763-b76a-aef212eb17f1",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "55fd587f-bfea-40b2-8e44-3ad95a9a9ee1",
|
||||
ConcurrencyStamp = "8b2b2fbf-ba91-420a-b490-13e02916d8a1",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class RemoveTableCount : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DbSetCounts");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Name",
|
||||
table: "AspNetUserTokens",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(128)",
|
||||
oldMaxLength: 128)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "LoginProvider",
|
||||
table: "AspNetUserTokens",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(128)",
|
||||
oldMaxLength: 128)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ProviderKey",
|
||||
table: "AspNetUserLogins",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(128)",
|
||||
oldMaxLength: 128)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "LoginProvider",
|
||||
table: "AspNetUserLogins",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(128)",
|
||||
oldMaxLength: 128)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Name",
|
||||
table: "AspNetUserTokens",
|
||||
type: "varchar(128)",
|
||||
maxLength: 128,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "LoginProvider",
|
||||
table: "AspNetUserTokens",
|
||||
type: "varchar(128)",
|
||||
maxLength: 128,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ProviderKey",
|
||||
table: "AspNetUserLogins",
|
||||
type: "varchar(128)",
|
||||
maxLength: 128,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "LoginProvider",
|
||||
table: "AspNetUserLogins",
|
||||
type: "varchar(128)",
|
||||
maxLength: 128,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DbSetCounts",
|
||||
columns: table => new
|
||||
{
|
||||
Count = table.Column<int>(type: "int", nullable: false),
|
||||
TableName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
[Migration("20240418104749_ReAddTableCounter4Identity")]
|
||||
partial class ReAddTableCounter4Identity
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
|
||||
{
|
||||
b.Property<string>("TableName")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("TableName");
|
||||
|
||||
b.ToTable("DbSetCounts");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
public partial class ReAddTableCounter4Identity : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DbSetCounts",
|
||||
columns: table => new
|
||||
{
|
||||
TableName = table.Column<string>(type: "varchar(255)", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Count = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DbSetCounts", x => x.TableName);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DbSetCounts");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,748 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
[Migration("20240604150033_AddPlantLogDtEvIdx")]
|
||||
partial class AddPlantLogDtEvIdx
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.Property<int>("AlarmLogId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("Index")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MemAddress")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<uint>("Status")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("ValDecoded")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("AlarmLogId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("AlarmLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(4)
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("AnKeyVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
b.ToTable("Config");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.ToTable("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||
{
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
b.ToTable("ListVal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.Property<int>("OrderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtETA")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecEnd")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtExecStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("DtOrder")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("OrderDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<double>("OrderQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("OrderId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<DateTime>("LastSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("VetoSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("enabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("windEnd")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("windStart")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PlantId", "ParamUid");
|
||||
|
||||
b.ToTable("ParamSend");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("LevelMax")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("PlantDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId");
|
||||
|
||||
b.ToTable("PlantDetail");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 5,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ09",
|
||||
PlantDesc = "Guardamiglio"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantDataId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex(new[] { "PlantId", "DtEvent" }, "IX_PlantLog_PlantDtEv");
|
||||
|
||||
b.HasIndex(new[] { "PlantId" }, "IX_PlantLog_PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FluxType")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<double>("ValNumber")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("PlantId", "FluxType");
|
||||
|
||||
b.ToTable("PlantStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||
{
|
||||
b.Property<int>("RecordId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Item")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("RecordId");
|
||||
|
||||
b.ToTable("RebootLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||
{
|
||||
b.Property<int>("SupplierId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplierCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("SupplierDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("SupplierId");
|
||||
|
||||
b.ToTable("Supplier");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
SupplierId = 1,
|
||||
SupplierCode = "LIQUIGAS",
|
||||
SupplierDesc = "Liquigas"
|
||||
},
|
||||
new
|
||||
{
|
||||
SupplierId = 2,
|
||||
SupplierCode = "VULKANGAS",
|
||||
SupplierDesc = "Vulkangas"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||
{
|
||||
b.Property<int>("TransporterId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("PositionLatitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("PositionLongitude")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<DateTime>("PositionUpdated")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("TransporterCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("TransporterDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.HasKey("TransporterId");
|
||||
|
||||
b.ToTable("Transporter");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
new
|
||||
{
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DeliveryHour")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TransporterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("WeekPlanId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.HasIndex("SupplierId");
|
||||
|
||||
b.HasIndex("TransporterId");
|
||||
|
||||
b.ToTable("WeekPlan");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
WeekPlanId = 1,
|
||||
DayNum = 1,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 2,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 3,
|
||||
DayNum = 3,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 4,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 15,
|
||||
Note = "9K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 5,
|
||||
DayNum = 4,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 6,
|
||||
DayNum = 6,
|
||||
DeliveryHour = 20,
|
||||
Note = "18K",
|
||||
PlantId = 2,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 7,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 14,
|
||||
Note = "3K",
|
||||
PlantId = 3,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 8,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 15,
|
||||
Note = "15K",
|
||||
PlantId = 4,
|
||||
SupplierId = 1,
|
||||
TransporterId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
WeekPlanId = 9,
|
||||
DayNum = 2,
|
||||
DeliveryHour = 17,
|
||||
Note = "18K",
|
||||
PlantId = 1,
|
||||
SupplierId = 2,
|
||||
TransporterId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupplierId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||
.WithMany()
|
||||
.HasForeignKey("TransporterId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
|
||||
b.Navigation("Supplier");
|
||||
|
||||
b.Navigation("Transporter");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
public partial class AddPlantLogDtEvIdx : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "WeekPlanId",
|
||||
table: "WeekPlan",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.Annotation("Relational:ColumnOrder", 0)
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Ordinal",
|
||||
table: "ListVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Descript",
|
||||
table: "ListVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 3)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Val",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 2)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "FieldName",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 1)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TabName",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 0)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UM",
|
||||
table: "Items",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 4)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemType",
|
||||
table: "Items",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 3)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemDesc",
|
||||
table: "Items",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 2)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemCode",
|
||||
table: "Items",
|
||||
type: "varchar(100)",
|
||||
maxLength: 100,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(100)",
|
||||
oldMaxLength: 100,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 1)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ItemId",
|
||||
table: "Items",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.Annotation("Relational:ColumnOrder", 0)
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ValStd",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
comment: "Valore di default/riferimento per la variabile",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true,
|
||||
oldComment: "Valore di default/riferimento per la variabile")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 2)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Val",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 1)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Note",
|
||||
table: "Config",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 3)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "KeyName",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 0)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ValString",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 3)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ValInt",
|
||||
table: "AnKeyVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("Relational:ColumnOrder", 1);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ValFloat",
|
||||
table: "AnKeyVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("Relational:ColumnOrder", 2);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Descript",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
comment: "Descrizione dell'item",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true,
|
||||
oldComment: "Descrizione dell'item")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 4)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "KeyName",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:ColumnOrder", 0)
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlantLog_PlantDtEv",
|
||||
table: "PlantLog",
|
||||
columns: new[] { "PlantId", "DtEvent" });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PlantLog_PlantDtEv",
|
||||
table: "PlantLog");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "WeekPlanId",
|
||||
table: "WeekPlan",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.OldAnnotation("Relational:ColumnOrder", 0);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Ordinal",
|
||||
table: "ListVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.OldAnnotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Descript",
|
||||
table: "ListVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 3);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Val",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 2);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "FieldName",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 1);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TabName",
|
||||
table: "ListVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 0);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UM",
|
||||
table: "Items",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemType",
|
||||
table: "Items",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 3);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemDesc",
|
||||
table: "Items",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 2);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ItemCode",
|
||||
table: "Items",
|
||||
type: "varchar(100)",
|
||||
maxLength: 100,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(100)",
|
||||
oldMaxLength: 100,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 1);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ItemId",
|
||||
table: "Items",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.OldAnnotation("Relational:ColumnOrder", 0);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ValStd",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
comment: "Valore di default/riferimento per la variabile",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true,
|
||||
oldComment: "Valore di default/riferimento per la variabile")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 2);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Val",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 1);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Note",
|
||||
table: "Config",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 3);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "KeyName",
|
||||
table: "Config",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 0);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ValString",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 3);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ValInt",
|
||||
table: "AnKeyVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.OldAnnotation("Relational:ColumnOrder", 1);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ValFloat",
|
||||
table: "AnKeyVal",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.OldAnnotation("Relational:ColumnOrder", 2);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Descript",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: true,
|
||||
comment: "Descrizione dell'item",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(250)",
|
||||
oldMaxLength: 250,
|
||||
oldNullable: true,
|
||||
oldComment: "Descrizione dell'item")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "KeyName",
|
||||
table: "AnKeyVal",
|
||||
type: "varchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(50)",
|
||||
oldMaxLength: 50)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("Relational:ColumnOrder", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(GWMSContext))]
|
||||
@@ -14,29 +16,66 @@ namespace GWMS.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.7");
|
||||
.HasAnnotation("ProductVersion", "6.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.Property<int>("AlarmLogId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("Index")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MemAddress")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<uint>("Status")
|
||||
.HasColumnType("int unsigned");
|
||||
|
||||
b.Property<string>("ValDecoded")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("AlarmLogId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
|
||||
b.ToTable("AlarmLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(4)
|
||||
.HasComment("Descrizione dell'item");
|
||||
|
||||
b.Property<int>("ValFloat")
|
||||
.HasColumnType("int");
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int>("ValInt")
|
||||
.HasColumnType("int");
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ValString")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.HasKey("KeyName");
|
||||
|
||||
@@ -47,19 +86,23 @@ namespace GWMS.Data.Migrations
|
||||
{
|
||||
b.Property<string>("KeyName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ValStd")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
|
||||
b.HasKey("KeyName");
|
||||
@@ -71,23 +114,28 @@ namespace GWMS.Data.Migrations
|
||||
{
|
||||
b.Property<int>("ItemId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("ItemCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("ItemDesc")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("UM")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
@@ -99,26 +147,31 @@ namespace GWMS.Data.Migrations
|
||||
b.Property<string>("TabName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("TabName");
|
||||
.HasColumnName("TabName")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("FieldName");
|
||||
.HasColumnName("FieldName")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("Val")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnName("Val");
|
||||
.HasColumnName("Val")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<string>("Descript")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)")
|
||||
.HasColumnName("Descript");
|
||||
.HasColumnName("Descript")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<int>("Ordinal")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("Ordinal");
|
||||
.HasColumnName("Ordinal")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("TabName", "FieldName", "Val");
|
||||
|
||||
@@ -146,6 +199,12 @@ namespace GWMS.Data.Migrations
|
||||
b.Property<double>("ExecutionQty")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelEnd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("LevelStart")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("OrderCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
@@ -177,6 +236,61 @@ namespace GWMS.Data.Migrations
|
||||
b.ToTable("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<DateTime>("LastSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("VetoSend")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("enabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("windEnd")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("windStart")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("PlantId", "ParamUid");
|
||||
|
||||
b.ToTable("ParamSend");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
|
||||
{
|
||||
b.Property<int>("ParamSetId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("ParamUid")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("PlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TargetVal")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("ParamSetId");
|
||||
|
||||
b.ToTable("ParamSet");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||
{
|
||||
b.Property<int>("PlantId")
|
||||
@@ -189,6 +303,9 @@ namespace GWMS.Data.Migrations
|
||||
b.Property<double>("LevelReorder")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("OrderQtyStd")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("PlantCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
@@ -207,6 +324,7 @@ namespace GWMS.Data.Migrations
|
||||
PlantId = 1,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ03",
|
||||
PlantDesc = "Collecchio"
|
||||
},
|
||||
@@ -215,6 +333,7 @@ namespace GWMS.Data.Migrations
|
||||
PlantId = 2,
|
||||
LevelMax = 28000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ04",
|
||||
PlantDesc = "Noceto"
|
||||
},
|
||||
@@ -223,6 +342,7 @@ namespace GWMS.Data.Migrations
|
||||
PlantId = 3,
|
||||
LevelMax = 24000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ05",
|
||||
PlantDesc = "Baganzola"
|
||||
},
|
||||
@@ -231,8 +351,18 @@ namespace GWMS.Data.Migrations
|
||||
PlantId = 4,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ08",
|
||||
PlantDesc = "Pilastrello"
|
||||
},
|
||||
new
|
||||
{
|
||||
PlantId = 5,
|
||||
LevelMax = 26000.0,
|
||||
LevelReorder = 15000.0,
|
||||
OrderQtyStd = 18000.0,
|
||||
PlantCode = "PIZ09",
|
||||
PlantDesc = "Guardamiglio"
|
||||
});
|
||||
});
|
||||
|
||||
@@ -261,7 +391,9 @@ namespace GWMS.Data.Migrations
|
||||
|
||||
b.HasKey("PlantDataId");
|
||||
|
||||
b.HasIndex("PlantId");
|
||||
b.HasIndex(new[] { "PlantId", "DtEvent" }, "IX_PlantLog_PlantDtEv");
|
||||
|
||||
b.HasIndex(new[] { "PlantId" }, "IX_PlantLog_PlantId");
|
||||
|
||||
b.ToTable("PlantLog");
|
||||
});
|
||||
@@ -378,7 +510,7 @@ namespace GWMS.Data.Migrations
|
||||
TransporterId = 1,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9521),
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "LEVO",
|
||||
TransporterDesc = "Levorato"
|
||||
},
|
||||
@@ -387,281 +519,18 @@ namespace GWMS.Data.Migrations
|
||||
TransporterId = 2,
|
||||
PositionLatitude = 0.0,
|
||||
PositionLongitude = 0.0,
|
||||
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9901),
|
||||
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
TransporterCode = "TRAF",
|
||||
TransporterDesc = "Traffik"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AuthKey")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("Firstname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("Lang")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("varchar(10)");
|
||||
|
||||
b.Property<string>("Lastname")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<int>("Livello")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskPlantId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskSupplierId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaskTranspId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SaltPasswd")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("varchar(250)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.ToTable("Users");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = 1,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt98",
|
||||
Email = "samuele@steamware.net",
|
||||
Firstname = "Samuele",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Locatelli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "samuele.locatelli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 2,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt91",
|
||||
Email = "giancarlo@steamware.net",
|
||||
Firstname = "Giancarlo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Rottoli",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "giancarlo.rottoli"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 3,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt93",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Steamware",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Admin",
|
||||
Livello = 1,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "steamw.admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 4,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt97",
|
||||
Email = "a.pizzaferri@pizzaferripetroli.it",
|
||||
Firstname = "Angelo",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pizzaferri",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "angelo.pizzaferri"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 5,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt99",
|
||||
Email = "andrei.valeanu@winnlab.it",
|
||||
Firstname = "Andrei",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Valeanu",
|
||||
Livello = 2,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "andrei.valeanu"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 6,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt92",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LIQUIGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 1,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "liquigas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 7,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt94",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "VULKANGAS",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 2,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "vulkangas.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 8,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt95",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "LEVORATO",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 1,
|
||||
SaltPasswd = "",
|
||||
UserName = "levorato.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 9,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "User",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "TRAFFIK",
|
||||
Livello = 4,
|
||||
MaskPlantId = 0,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 2,
|
||||
SaltPasswd = "",
|
||||
UserName = "traffik.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 10,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Collecchio",
|
||||
Livello = 3,
|
||||
MaskPlantId = 1,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz03.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 11,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Noceto",
|
||||
Livello = 3,
|
||||
MaskPlantId = 2,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz04.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 12,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Baganzola",
|
||||
Livello = 3,
|
||||
MaskPlantId = 3,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz05.user01"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = 13,
|
||||
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||
Email = "info@steamware.net",
|
||||
Firstname = "Stazione",
|
||||
IsActive = true,
|
||||
Lang = "IT",
|
||||
Lastname = "Pilastrello",
|
||||
Livello = 3,
|
||||
MaskPlantId = 4,
|
||||
MaskSupplierId = 0,
|
||||
MaskTranspId = 0,
|
||||
SaltPasswd = "",
|
||||
UserName = "piz08.user01"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||
{
|
||||
b.Property<int>("WeekPlanId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(0);
|
||||
|
||||
b.Property<int>("DayNum")
|
||||
.HasColumnType("int");
|
||||
@@ -785,6 +654,17 @@ namespace GWMS.Data.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlantId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Plant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||
{
|
||||
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||
|
||||
@@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GWMS.User.Migrations
|
||||
{
|
||||
[DbContext(typeof(UserIdentityDbContext))]
|
||||
@@ -14,8 +16,21 @@ namespace GWMS.User.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.7");
|
||||
.HasAnnotation("ProductVersion", "6.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
|
||||
{
|
||||
b.Property<string>("TableName")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("TableName");
|
||||
|
||||
b.ToTable("DbSetCounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
@@ -40,7 +55,51 @@ namespace GWMS.User.Migrations
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "315208c3-0fb0-421d-b373-8f4730106dd5",
|
||||
ConcurrencyStamp = "9bd570a3-2012-42a8-bb38-0030e0d45de2",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "757673aa-ea00-4b6a-8c98-f75b3dcd65b7",
|
||||
ConcurrencyStamp = "55cbb043-dbd6-4018-a834-050c2a15c30f",
|
||||
Name = "ExtUser",
|
||||
NormalizedName = "EXTUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "b5083225-0c73-40cb-a7be-db0747b20dca",
|
||||
ConcurrencyStamp = "496441df-9b5b-4df2-bdc2-54a073a4a912",
|
||||
Name = "ExtTransp",
|
||||
NormalizedName = "EXTTRANSP"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "b5136e2c-f9e9-43ae-8cfd-d4b2883b963a",
|
||||
ConcurrencyStamp = "2009b165-9681-4891-934e-020a35e6fc80",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "0bbf8f56-fcc8-4afd-9865-805881ca4067",
|
||||
ConcurrencyStamp = "759f05b6-3995-4763-b76a-aef212eb17f1",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "55fd587f-bfea-40b2-8e44-3ad95a9a9ee1",
|
||||
ConcurrencyStamp = "8b2b2fbf-ba91-420a-b490-13e02916d8a1",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
@@ -63,7 +122,7 @@ namespace GWMS.User.Migrations
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
@@ -127,7 +186,7 @@ namespace GWMS.User.Migrations
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
@@ -150,18 +209,16 @@ namespace GWMS.User.Migrations
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("longtext");
|
||||
@@ -174,7 +231,7 @@ namespace GWMS.User.Migrations
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
@@ -189,7 +246,7 @@ namespace GWMS.User.Migrations
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
@@ -198,19 +255,17 @@ namespace GWMS.User.Migrations
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using GWMS.Data.DatabaseModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
@@ -18,6 +14,7 @@ namespace GWMS.Data
|
||||
/// <param name="modelBuilder"></param>
|
||||
public static void Seed(this ModelBuilder modelBuilder)
|
||||
{
|
||||
#if false
|
||||
// inizializzazione dei valori di default x USER
|
||||
modelBuilder.Entity<UserModel>().HasData(
|
||||
new UserModel { UserId = 1, AuthKey = "th1sIsTh3R1vrOfThNgt98", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "samuele.locatelli", Email = "samuele@steamware.net", Firstname = "Samuele", Lastname = "Locatelli" },
|
||||
@@ -34,13 +31,15 @@ namespace GWMS.Data
|
||||
new UserModel { UserId = 12, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 3, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz05.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Baganzola" },
|
||||
new UserModel { UserId = 13, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 4, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz08.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Pilastrello" }
|
||||
);
|
||||
#endif
|
||||
|
||||
// inizializzazione dei valori di default x Plant
|
||||
modelBuilder.Entity<PlantDetailModel>().HasData(
|
||||
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000 },
|
||||
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000 },
|
||||
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000 },
|
||||
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000 }
|
||||
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
|
||||
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000, OrderQtyStd = 18000 },
|
||||
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 18000 },
|
||||
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
|
||||
new PlantDetailModel { PlantId = 5, PlantCode = "PIZ09", PlantDesc = "Guardamiglio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 }
|
||||
// new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||
//new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||
//new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||
|
||||
@@ -6,10 +6,10 @@ DROP PROCEDURE IF EXISTS DeletePlantLogrecords;
|
||||
DELIMITER $$
|
||||
|
||||
CREATE PROCEDURE DeletePlantLogrecords(
|
||||
IN pStartDate DATETIME,
|
||||
IN pPlantId INT,
|
||||
IN pMinInt INT,
|
||||
IN pFluxType VARCHAR(250)
|
||||
IN pStartDate DATETIME,
|
||||
IN pPlantId INT,
|
||||
IN pMinInt INT,
|
||||
IN pFluxType VARCHAR(250)
|
||||
)
|
||||
BEGIN
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
USE GWMS_PZZFRR;
|
||||
DROP PROCEDURE IF EXISTS stp_deleteDuplicatedAlarms;
|
||||
|
||||
DELIMITER $$
|
||||
|
||||
CREATE PROCEDURE `stp_deleteDuplicatedAlarms`(
|
||||
IN `PlantIdReq` INT
|
||||
)
|
||||
BEGIN
|
||||
|
||||
-- Eliminazione allarmi duplicati + indicazione AllOk al secondo (ultimo) della serie per chiusura'
|
||||
|
||||
-- Step 1: Eliminazione record 'interni' duplicati (in una sequenza lascia solo primo ed ultimo)
|
||||
DELETE
|
||||
FROM AlarmLog
|
||||
WHERE AlarmLogId IN (
|
||||
SELECT AlarmLogId
|
||||
FROM (
|
||||
SELECT
|
||||
AlarmLogId,
|
||||
PlantId,
|
||||
`Status` AS CurState,
|
||||
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
|
||||
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
|
||||
FROM AlarmLog
|
||||
WHERE PlantId = PlantIdReq
|
||||
) AS cte
|
||||
WHERE
|
||||
(CurState = prev_State) AND (CurState = next_State)
|
||||
);
|
||||
|
||||
-- Step 2: Cambio secondo record in "ALL OK"
|
||||
UPDATE AlarmLog
|
||||
SET `Status` = 0,
|
||||
ValDecoded = 'ALL OK'
|
||||
WHERE AlarmLogId IN (
|
||||
SELECT AlarmLogId
|
||||
FROM (
|
||||
SELECT
|
||||
AlarmLogId,
|
||||
PlantId,
|
||||
`Status` AS CurState,
|
||||
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
|
||||
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
|
||||
FROM AlarmLog
|
||||
WHERE PlantId = PlantIdReq
|
||||
) AS cte
|
||||
WHERE
|
||||
(CurState = prev_State) AND (CurState != next_State)
|
||||
);
|
||||
|
||||
-- Step 3: Eliminazione eventuali record duplicati 'ALL OK'
|
||||
DELETE
|
||||
FROM AlarmLog
|
||||
WHERE AlarmLogId IN (
|
||||
SELECT AlarmLogId
|
||||
FROM (
|
||||
SELECT
|
||||
AlarmLogId,
|
||||
PlantId,
|
||||
`Status` AS CurState,
|
||||
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
|
||||
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
|
||||
FROM AlarmLog
|
||||
WHERE PlantId = PlantIdReq
|
||||
) AS cte
|
||||
WHERE
|
||||
(CurState = prev_State) AND (CurState = 0)
|
||||
);
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
public class RoleConfiguration : IEntityTypeConfiguration<IdentityRole>
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void Configure(EntityTypeBuilder<IdentityRole> builder)
|
||||
{
|
||||
builder.HasData(
|
||||
new IdentityRole { Name = "Undef", NormalizedName = "UNDEF" },
|
||||
new IdentityRole { Name = "ExtUser", NormalizedName = "EXTUSER" },
|
||||
new IdentityRole { Name = "ExtTransp", NormalizedName = "EXTTRANSP" },
|
||||
new IdentityRole { Name = "User", NormalizedName = "USER" },
|
||||
new IdentityRole { Name = "Admin", NormalizedName = "ADMIN" },
|
||||
new IdentityRole { Name = "SuperAdmin", NormalizedName = "SUPERADMIN" }
|
||||
);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
+36
-1
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,10 +10,43 @@ namespace GWMS.Data
|
||||
{
|
||||
public class TSData
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
///// <summary>
|
||||
///// Init generico per retrocompatibilità e deserializzazione
|
||||
///// </summary>
|
||||
public TSData() { }
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore "Smart" per la creazione rapida e ottimizzata
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <param name="doRound"></param>
|
||||
public TSData(DateTime dt, double val, bool doRound = true)
|
||||
{
|
||||
if (doRound)
|
||||
{
|
||||
// Arrotonda al secondo: crea una nuova data ignorando i Tick (millisecondi)
|
||||
DtEvent = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
|
||||
// Arrotonda a 2 decimali
|
||||
ValDouble = Math.Round(val, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
DtEvent = dt;
|
||||
ValDouble = val;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[JsonProperty("d")]
|
||||
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||
|
||||
[JsonProperty("v")]
|
||||
public double ValDouble { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe generalizzaizone identity (user + roles + claims) x gestione semplificata in editing
|
||||
/// </summary>
|
||||
public class UserData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public List<System.Security.Claims.Claim> Claims { get; set; }
|
||||
|
||||
public IdentityUser Identity { get; set; }
|
||||
|
||||
public List<string> Roles { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
using GWMS.Data.DatabaseModels;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
@@ -14,13 +12,31 @@ namespace GWMS.Data
|
||||
|
||||
public UserIdentityDbContext()
|
||||
{
|
||||
try
|
||||
{
|
||||
// se non ci fosse... crea o migra!
|
||||
Database.Migrate();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{ }
|
||||
}
|
||||
|
||||
public UserIdentityDbContext(DbContextOptions<UserIdentityDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
#if false
|
||||
// se non ci fosse... crea!
|
||||
Database.EnsureCreated();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
// se non ci fosse... crea o migra!
|
||||
Database.Migrate();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in UserIdentityDbContext{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -43,6 +59,19 @@ namespace GWMS.Data
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.ApplyConfiguration(new RoleConfiguration());
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
public class chartJsData
|
||||
{
|
||||
#region Public Classes
|
||||
|
||||
public class chartJsTSerie
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public DateTime x { get; set; }
|
||||
public double y { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class chartJsXY
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public double x { get; set; }
|
||||
public double y { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"defaultProvider": "cdnjs",
|
||||
"libraries": []
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {}
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "6.0.2",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-10
@@ -1,10 +1,12 @@
|
||||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
<CascadingAuthenticationState>
|
||||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
</CascadingAuthenticationState>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using GWMS.Data;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.UI;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
[assembly: HostingStartup(typeof(GWMS.UI.Areas.Identity.IdentityHostingStartup))]
|
||||
|
||||
namespace GWMS.UI.Areas.Identity
|
||||
{
|
||||
public class IdentityHostingStartup : IHostingStartup
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void Configure(IWebHostBuilder builder)
|
||||
{
|
||||
builder.ConfigureServices((context, services) =>
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
@page
|
||||
@model AccessDeniedModel
|
||||
@{
|
||||
ViewData["Title"] = "Access denied";
|
||||
}
|
||||
|
||||
<header>
|
||||
<h1 class="text-danger">@ViewData["Title"]</h1>
|
||||
<p class="text-danger">You do not have access to this resource.</p>
|
||||
</header>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
public class AccessDeniedModel : PageModel
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
@page
|
||||
@model ConfirmEmailModel
|
||||
@{
|
||||
ViewData["Title"] = "Conferma Effettuata";
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-success">
|
||||
<p>L'email è stata confermata! ora puoi effettuare il login all'applicazione</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-sm btn-success btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ConfirmEmailModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ConfirmEmailModel(UserManager<IdentityUser> userManager)
|
||||
{
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(string userId, string code)
|
||||
{
|
||||
if (userId == null || code == null)
|
||||
{
|
||||
return RedirectToPage("/Index");
|
||||
}
|
||||
|
||||
var user = await _userManager.FindByIdAsync(userId);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{userId}'.");
|
||||
}
|
||||
|
||||
code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
|
||||
var result = await _userManager.ConfirmEmailAsync(user, code);
|
||||
StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
@page
|
||||
@model ConfirmEmailChangeModel
|
||||
@{
|
||||
ViewData["Title"] = "Confirm email change";
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
<partial name="_StatusMessage" model="Model.StatusMessage" />
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ConfirmEmailChangeModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ConfirmEmailChangeModel(UserManager<IdentityUser> userManager, SignInManager<IdentityUser> signInManager)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(string userId, string email, string code)
|
||||
{
|
||||
if (userId == null || email == null || code == null)
|
||||
{
|
||||
return RedirectToPage("/Index");
|
||||
}
|
||||
|
||||
var user = await _userManager.FindByIdAsync(userId);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{userId}'.");
|
||||
}
|
||||
|
||||
code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
|
||||
var result = await _userManager.ChangeEmailAsync(user, email, code);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
StatusMessage = "Error changing email.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
// In our UI email and user name are one and the same, so when we update the email
|
||||
// we need to update the user name.
|
||||
var setUserNameResult = await _userManager.SetUserNameAsync(user, email);
|
||||
if (!setUserNameResult.Succeeded)
|
||||
{
|
||||
StatusMessage = "Error changing user name.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
await _signInManager.RefreshSignInAsync(user);
|
||||
StatusMessage = "Thank you for confirming your email change.";
|
||||
return Page();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
@page
|
||||
@model ExternalLoginModel
|
||||
@{
|
||||
ViewData["Title"] = "Register";
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
<h4 id="external-login-title">Associate your @Model.ProviderDisplayName account.</h4>
|
||||
<hr />
|
||||
|
||||
<p id="external-login-description" class="text-info">
|
||||
You've successfully authenticated with <strong>@Model.ProviderDisplayName</strong>.
|
||||
Please enter an email address for this site below and click the Register button to finish
|
||||
logging in.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.Email"></label>
|
||||
<input asp-for="Input.Email" class="form-control" />
|
||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ExternalLoginModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly IEmailSender _emailSender;
|
||||
private readonly ILogger<ExternalLoginModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ExternalLoginModel(
|
||||
SignInManager<IdentityUser> signInManager,
|
||||
UserManager<IdentityUser> userManager,
|
||||
ILogger<ExternalLoginModel> logger,
|
||||
IEmailSender emailSender)
|
||||
{
|
||||
_signInManager = signInManager;
|
||||
_userManager = userManager;
|
||||
_logger = logger;
|
||||
_emailSender = emailSender;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[TempData]
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
public string ProviderDisplayName { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public IActionResult OnGetAsync()
|
||||
{
|
||||
return RedirectToPage("./Login");
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCallbackAsync(string returnUrl = null, string remoteError = null)
|
||||
{
|
||||
returnUrl = returnUrl ?? Url.Content("~/");
|
||||
if (remoteError != null)
|
||||
{
|
||||
ErrorMessage = $"Error from external provider: {remoteError}";
|
||||
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
|
||||
}
|
||||
var info = await _signInManager.GetExternalLoginInfoAsync();
|
||||
if (info == null)
|
||||
{
|
||||
ErrorMessage = "Error loading external login information.";
|
||||
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
|
||||
}
|
||||
|
||||
// Sign in the user with this external login provider if the user already has a login.
|
||||
var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor: true);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("{Name} logged in with {LoginProvider} provider.", info.Principal.Identity.Name, info.LoginProvider);
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
if (result.IsLockedOut)
|
||||
{
|
||||
return RedirectToPage("./Lockout");
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the user does not have an account, then ask the user to create an account.
|
||||
ReturnUrl = returnUrl;
|
||||
ProviderDisplayName = info.ProviderDisplayName;
|
||||
if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email))
|
||||
{
|
||||
Input = new InputModel
|
||||
{
|
||||
Email = info.Principal.FindFirstValue(ClaimTypes.Email)
|
||||
};
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnPost(string provider, string returnUrl = null)
|
||||
{
|
||||
// Request a redirect to the external login provider.
|
||||
var redirectUrl = Url.Page("./ExternalLogin", pageHandler: "Callback", values: new { returnUrl });
|
||||
var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
|
||||
return new ChallengeResult(provider, properties);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostConfirmationAsync(string returnUrl = null)
|
||||
{
|
||||
returnUrl = returnUrl ?? Url.Content("~/");
|
||||
// Get the information about the user from the external login provider
|
||||
var info = await _signInManager.GetExternalLoginInfoAsync();
|
||||
if (info == null)
|
||||
{
|
||||
ErrorMessage = "Error loading external login information during confirmation.";
|
||||
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = new IdentityUser { UserName = Input.Email, Email = Input.Email };
|
||||
|
||||
var result = await _userManager.CreateAsync(user);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
result = await _userManager.AddLoginAsync(user, info);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider);
|
||||
|
||||
var userId = await _userManager.GetUserIdAsync(user);
|
||||
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
||||
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
|
||||
var callbackUrl = Url.Page(
|
||||
"/Account/ConfirmEmail",
|
||||
pageHandler: null,
|
||||
values: new { area = "Identity", userId = userId, code = code },
|
||||
protocol: Request.Scheme);
|
||||
|
||||
await _emailSender.SendEmailAsync(Input.Email, "Confirm your email", $"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
|
||||
|
||||
// If account confirmation is required, we need to show the link if we don't have a real email sender
|
||||
if (_userManager.Options.SignIn.RequireConfirmedAccount)
|
||||
{
|
||||
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
|
||||
}
|
||||
|
||||
await _signInManager.SignInAsync(user, isPersistent: false, info.LoginProvider);
|
||||
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
}
|
||||
foreach (var error in result.Errors)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, error.Description);
|
||||
}
|
||||
}
|
||||
|
||||
ProviderDisplayName = info.ProviderDisplayName;
|
||||
ReturnUrl = returnUrl;
|
||||
return Page();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
@page
|
||||
@model ForgotPasswordModel
|
||||
@{
|
||||
ViewData["Title"] = "Password dimenticata?";
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
|
||||
<div class="card-body">
|
||||
<h4>Inserire l'account email registrato</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form method="post">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.Email"></label>
|
||||
<input asp-for="Input.Email" class="form-control" />
|
||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block"><i class="fas fa-envelope"></i> Inoltra richiesta reset password</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ForgotPasswordModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly IEmailSender _emailSender;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ForgotPasswordModel(UserManager<IdentityUser> userManager, IEmailSender emailSender)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_emailSender = emailSender;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = await _userManager.FindByEmailAsync(Input.Email);
|
||||
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
|
||||
{
|
||||
// Don't reveal that the user does not exist or is not confirmed
|
||||
return RedirectToPage("./ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
// For more information on how to enable account confirmation and password reset please
|
||||
// visit https://go.microsoft.com/fwlink/?LinkID=532713
|
||||
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
|
||||
var callbackUrl = Url.Page(
|
||||
"/Account/ResetPassword",
|
||||
pageHandler: null,
|
||||
values: new { area = "Identity", code },
|
||||
protocol: Request.Scheme);
|
||||
|
||||
await _emailSender.SendEmailAsync(
|
||||
Input.Email,
|
||||
"Reset Password",
|
||||
$"Please reset your password by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
|
||||
|
||||
return RedirectToPage("./ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
@page
|
||||
@model ForgotPasswordConfirmation
|
||||
@{
|
||||
ViewData["Title"] = "Password dimenticata";
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
Prego verificare l'account email per le istruzioni relative alla reimpostazione della password.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-primary btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ForgotPasswordConfirmation : PageModel
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
@page
|
||||
@model LockoutModel
|
||||
@{
|
||||
ViewData["Title"] = "Locked out";
|
||||
}
|
||||
|
||||
<header>
|
||||
<h1 class="text-danger">@ViewData["Title"]</h1>
|
||||
<p class="text-danger">This account has been locked out, please try again later.</p>
|
||||
</header>
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LockoutModel : PageModel
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,40 @@
|
||||
@page
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@attribute [IgnoreAntiforgeryToken]
|
||||
@inject SignInManager<IdentityUser> SignInManager
|
||||
@functions {
|
||||
public async Task<IActionResult> OnPost()
|
||||
{
|
||||
if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
await SignInManager.SignOutAsync();
|
||||
}
|
||||
|
||||
return Redirect("~/");
|
||||
}
|
||||
@model LogoutModel
|
||||
@{
|
||||
ViewData["Title"] = "Log out";
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
|
||||
<div class="card-body">
|
||||
@{
|
||||
if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" method="post">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p>Premendo sul pulsante effettuerai il logout dal sistema.</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button type="submit" class="nav-link btn btn-warning"><i class="fas fa-sign-out-alt"></i> Clicca per Logout</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p>Disconnesisone effettuata.</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a title="Home" href="~/" class="btn btn-sm btn-primary btn-block"><i class="fas fa-home"></i> Home Page</a>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-sm btn-success btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,96 @@
|
||||
@page
|
||||
@model LoginModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Log in";
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<section>
|
||||
<form id="account" method="post">
|
||||
<h4>Effettuare login con l'account registrato.</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.Email"></label>
|
||||
<input asp-for="Input.Email" class="form-control" />
|
||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.Password"></label>
|
||||
<input asp-for="Input.Password" class="form-control" />
|
||||
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label asp-for="Input.RememberMe">
|
||||
<input asp-for="Input.RememberMe" />
|
||||
@Html.DisplayNameFor(m => m.Input.RememberMe)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-block btn-primary"><i class="fas fa-sign-in-alt"></i> Log in</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a asp-page="./Register" class="btn btn-block btn-outline-primary" asp-route-returnUrl="@Model.ReturnUrl"><i class="fas fa-edit"></i> Registra account</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row mt-2">
|
||||
<div class="col">
|
||||
<a id="forgot-password" class="btn btn-block btn-outline-info" asp-page="./ForgotPassword"><i class="far fa-life-ring"></i> Password dimenticata?</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a id="resend-confirmation" class="btn btn-block btn-outline-dark" asp-page="./ResendEmailConfirmation"><i class="far fa-envelope"></i> (Re)Invia email conferma</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<div class="col-md-6">
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<h2>USER OK!</h2>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-md-6 col-md-offset-2">
|
||||
<section>
|
||||
<h4>Use another service to log in.</h4>
|
||||
<hr />
|
||||
@{
|
||||
if ((Model.ExternalLogins?.Count ?? 0) == 0)
|
||||
{
|
||||
<div>
|
||||
<p>
|
||||
There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
|
||||
for details on setting up this ASP.NET application to support logging in via external services.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
|
||||
<div>
|
||||
<p>
|
||||
@foreach (var provider in Model.ExternalLogins)
|
||||
{
|
||||
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
</section>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LoginModel : PageModel
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public LoginModel(SignInManager<IdentityUser> signInManager, ILogger<LoginModel> logger, UserManager<IdentityUser> userManager, IConfiguration configuration)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[TempData]
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
public IList<AuthenticationScheme> ExternalLogins { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(string returnUrl = null)
|
||||
{
|
||||
await CheckSuperAdmin();
|
||||
if (!string.IsNullOrEmpty(ErrorMessage))
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, ErrorMessage);
|
||||
}
|
||||
|
||||
returnUrl ??= Url.Content("~/");
|
||||
|
||||
// Clear the existing external cookie to ensure a clean login process
|
||||
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
|
||||
|
||||
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
|
||||
|
||||
ReturnUrl = returnUrl;
|
||||
|
||||
var nextPage = await checkJumpLogin();
|
||||
if (!string.IsNullOrEmpty(nextPage))
|
||||
{
|
||||
return LocalRedirect(nextPage);
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
|
||||
{
|
||||
returnUrl ??= Url.Content("~/");
|
||||
|
||||
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// This doesn't count login failures towards account lockout To enable password
|
||||
// failures to trigger account lockout, set lockoutOnFailure: true
|
||||
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User logged in.");
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
if (result.RequiresTwoFactor)
|
||||
{
|
||||
return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe });
|
||||
}
|
||||
if (result.IsLockedOut)
|
||||
{
|
||||
_logger.LogWarning("User account locked out.");
|
||||
return RedirectToPage("./Lockout");
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, "Invalid login attempt.");
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return Page();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[Display(Name = "Remember me?")]
|
||||
public bool RememberMe { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<LoginModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task<string> checkJumpLogin()
|
||||
{
|
||||
string nextPage = "";
|
||||
string uid = getReqPar("uid", "");
|
||||
string uem = getReqPar("uem", "");
|
||||
string pag = getReqPar("pag", "Transporters");
|
||||
string baseAppPath = $"{_configuration["RuntimeOpt:BaseAppPath"]}";
|
||||
|
||||
await Task.Delay(1);
|
||||
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(uem))
|
||||
{
|
||||
var user = await _userManager.FindByEmailAsync(uem);
|
||||
if (user != null)
|
||||
{
|
||||
if (user.Id == uid)
|
||||
{
|
||||
// se corrispondono --> signini!
|
||||
await _signInManager.SignInAsync(user, false);
|
||||
_logger.LogInformation($"Forced User log in via URL token for {uem}");
|
||||
// salto a pagina target da conf + req
|
||||
nextPage = string.IsNullOrEmpty(pag) ? baseAppPath : $"{baseAppPath}{pag}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nextPage;
|
||||
}
|
||||
|
||||
private async Task CheckSuperAdmin()
|
||||
{
|
||||
// se non ci fosse --> creo samuele come superadmin
|
||||
string superUser = "samuele@steamware.net";
|
||||
string superPwd = "viaDante16!";
|
||||
string ADMIN_ROLE = "SuperAdmin";
|
||||
var user = await _userManager.FindByEmailAsync(superUser);
|
||||
if (user == null)
|
||||
{
|
||||
// Insert new user
|
||||
var NewUser =
|
||||
new IdentityUser
|
||||
{
|
||||
UserName = superUser,
|
||||
Email = superUser,
|
||||
EmailConfirmed = true
|
||||
};
|
||||
var CreateResult = await _userManager.CreateAsync(NewUser, superPwd);
|
||||
if (CreateResult.Succeeded)
|
||||
{
|
||||
user = await _userManager.FindByEmailAsync(superUser);
|
||||
}
|
||||
}
|
||||
|
||||
// verifico ruoli...
|
||||
if (user != null)
|
||||
{
|
||||
bool needCreate = true;
|
||||
// Gestione salvataggio ruoli... SE VARIATO...
|
||||
var UserRoles = await _userManager.GetRolesAsync(user);
|
||||
if (UserRoles != null && UserRoles.Count > 0)
|
||||
{
|
||||
var oldRole = UserRoles.Where(x => x == ADMIN_ROLE).FirstOrDefault();
|
||||
needCreate = (oldRole == null);
|
||||
}
|
||||
if (needCreate)
|
||||
{
|
||||
// aggiungo a ruolo admin
|
||||
await _userManager.AddToRoleAsync(user, ADMIN_ROLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce valore da Request (se presente) oppure defaultVal
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="defaultVal"></param>
|
||||
/// <returns></returns>
|
||||
private string getReqPar(string key, string defaultVal = "")
|
||||
{
|
||||
string answ = defaultVal;
|
||||
var rawQuery = Request.Query;
|
||||
if (rawQuery != null)
|
||||
{
|
||||
if (rawQuery.ContainsKey(key))
|
||||
{
|
||||
answ = rawQuery[key];
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@page
|
||||
@model LoginWith2faModel
|
||||
@{
|
||||
ViewData["Title"] = "Two-factor authentication";
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
<hr />
|
||||
<p>Your login is protected with an authenticator app. Enter your authenticator code below.</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form method="post" asp-route-returnUrl="@Model.ReturnUrl">
|
||||
<input asp-for="RememberMe" type="hidden" />
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.TwoFactorCode"></label>
|
||||
<input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" />
|
||||
<span asp-validation-for="Input.TwoFactorCode" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label asp-for="Input.RememberMachine">
|
||||
<input asp-for="Input.RememberMachine" />
|
||||
@Html.DisplayNameFor(m => m.Input.RememberMachine)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
Don't have access to your authenticator device? You can
|
||||
<a id="recovery-code-login" asp-page="./LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl">log in with a recovery code</a>.
|
||||
</p>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LoginWith2faModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<LoginWith2faModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LoginWith2faModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWith2faModel> logger)
|
||||
{
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
public bool RememberMe { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(bool rememberMe, string returnUrl = null)
|
||||
{
|
||||
// Ensure the user has gone through the username & password screen first
|
||||
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
|
||||
}
|
||||
|
||||
ReturnUrl = returnUrl;
|
||||
RememberMe = rememberMe;
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(bool rememberMe, string returnUrl = null)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return Page();
|
||||
}
|
||||
|
||||
returnUrl = returnUrl ?? Url.Content("~/");
|
||||
|
||||
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
|
||||
}
|
||||
|
||||
var authenticatorCode = Input.TwoFactorCode.Replace(" ", string.Empty).Replace("-", string.Empty);
|
||||
|
||||
var result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticatorCode, rememberMe, Input.RememberMachine);
|
||||
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User with ID '{UserId}' logged in with 2fa.", user.Id);
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
else if (result.IsLockedOut)
|
||||
{
|
||||
_logger.LogWarning("User with ID '{UserId}' account locked out.", user.Id);
|
||||
return RedirectToPage("./Lockout");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("Invalid authenticator code entered for user with ID '{UserId}'.", user.Id);
|
||||
ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Display(Name = "Remember this machine")]
|
||||
public bool RememberMachine { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Text)]
|
||||
[Display(Name = "Authenticator code")]
|
||||
public string TwoFactorCode { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
@page
|
||||
@model LoginWithRecoveryCodeModel
|
||||
@{
|
||||
ViewData["Title"] = "Recovery code verification";
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
<hr />
|
||||
<p>
|
||||
You have requested to log in with a recovery code. This login will not be remembered until you provide
|
||||
an authenticator app code at log in or disable 2FA and log in again.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form method="post">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.RecoveryCode"></label>
|
||||
<input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" />
|
||||
<span asp-validation-for="Input.RecoveryCode" class="text-danger"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LoginWithRecoveryCodeModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<LoginWithRecoveryCodeModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LoginWithRecoveryCodeModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWithRecoveryCodeModel> logger)
|
||||
{
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(string returnUrl = null)
|
||||
{
|
||||
// Ensure the user has gone through the username & password screen first
|
||||
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
|
||||
}
|
||||
|
||||
ReturnUrl = returnUrl;
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return Page();
|
||||
}
|
||||
|
||||
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
|
||||
}
|
||||
|
||||
var recoveryCode = Input.RecoveryCode.Replace(" ", string.Empty);
|
||||
|
||||
var result = await _signInManager.TwoFactorRecoveryCodeSignInAsync(recoveryCode);
|
||||
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_logger.LogInformation("User with ID '{UserId}' logged in with a recovery code.", user.Id);
|
||||
return LocalRedirect(returnUrl ?? Url.Content("~/"));
|
||||
}
|
||||
if (result.IsLockedOut)
|
||||
{
|
||||
_logger.LogWarning("User with ID '{UserId}' account locked out.", user.Id);
|
||||
return RedirectToPage("./Lockout");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("Invalid recovery code entered for user with ID '{UserId}' ", user.Id);
|
||||
ModelState.AddModelError(string.Empty, "Invalid recovery code entered.");
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
[Required]
|
||||
[DataType(DataType.Text)]
|
||||
[Display(Name = "Recovery Code")]
|
||||
public string RecoveryCode { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LogoutModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<LogoutModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LogoutModel(SignInManager<IdentityUser> signInManager, ILogger<LogoutModel> logger, IConfiguration configuration)
|
||||
{
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPost(string returnUrl = null)
|
||||
{
|
||||
await _signInManager.SignOutAsync();
|
||||
_logger.LogInformation("User logged out.");
|
||||
if (returnUrl != null)
|
||||
{
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
string appDir = $"{_configuration["RuntimeOpt:BaseUrl"]}{_configuration["RuntimeOpt:BaseAppPath"]}";
|
||||
return Redirect(appDir);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
@page
|
||||
@model ChangePasswordModel
|
||||
@{
|
||||
ViewData["Title"] = "Change password";
|
||||
ViewData["ActivePage"] = ManageNavPages.ChangePassword;
|
||||
}
|
||||
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
<partial name="_StatusMessage" for="StatusMessage" />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<form id="change-password-form" method="post">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.OldPassword"></label>
|
||||
<input asp-for="Input.OldPassword" class="form-control" />
|
||||
<span asp-validation-for="Input.OldPassword" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.NewPassword"></label>
|
||||
<input asp-for="Input.NewPassword" class="form-control" />
|
||||
<span asp-validation-for="Input.NewPassword" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.ConfirmPassword"></label>
|
||||
<input asp-for="Input.ConfirmPassword" class="form-control" />
|
||||
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update password</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
|
||||
{
|
||||
public class ChangePasswordModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<ChangePasswordModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ChangePasswordModel(
|
||||
UserManager<IdentityUser> userManager,
|
||||
SignInManager<IdentityUser> signInManager,
|
||||
ILogger<ChangePasswordModel> logger)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGetAsync()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
var hasPassword = await _userManager.HasPasswordAsync(user);
|
||||
if (!hasPassword)
|
||||
{
|
||||
return RedirectToPage("./SetPassword");
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return Page();
|
||||
}
|
||||
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
var changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
|
||||
if (!changePasswordResult.Succeeded)
|
||||
{
|
||||
foreach (var error in changePasswordResult.Errors)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, error.Description);
|
||||
}
|
||||
return Page();
|
||||
}
|
||||
|
||||
await _signInManager.RefreshSignInAsync(user);
|
||||
_logger.LogInformation("User changed their password successfully.");
|
||||
StatusMessage = "Your password has been changed.";
|
||||
|
||||
return RedirectToPage();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirm new password")]
|
||||
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Current password")]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
@page
|
||||
@model DeletePersonalDataModel
|
||||
@{
|
||||
ViewData["Title"] = "Delete Personal Data";
|
||||
ViewData["ActivePage"] = ManageNavPages.PersonalData;
|
||||
}
|
||||
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<p>
|
||||
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form id="delete-user" method="post" class="form-group">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
@if (Model.RequirePassword)
|
||||
{
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.Password"></label>
|
||||
<input asp-for="Input.Password" class="form-control" />
|
||||
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
||||
</div>
|
||||
}
|
||||
<button class="btn btn-danger" type="submit">Delete data and close my account</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
|
||||
{
|
||||
public class DeletePersonalDataModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<DeletePersonalDataModel> _logger;
|
||||
private readonly SignInManager<IdentityUser> _signInManager;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DeletePersonalDataModel(
|
||||
UserManager<IdentityUser> userManager,
|
||||
SignInManager<IdentityUser> signInManager,
|
||||
ILogger<DeletePersonalDataModel> logger)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[BindProperty]
|
||||
public InputModel Input { get; set; }
|
||||
|
||||
public bool RequirePassword { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
RequirePassword = await _userManager.HasPasswordAsync(user);
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
RequirePassword = await _userManager.HasPasswordAsync(user);
|
||||
if (RequirePassword)
|
||||
{
|
||||
if (!await _userManager.CheckPasswordAsync(user, Input.Password))
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, "Incorrect password.");
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
|
||||
var result = await _userManager.DeleteAsync(user);
|
||||
var userId = await _userManager.GetUserIdAsync(user);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
throw new InvalidOperationException($"Unexpected error occurred deleting user with ID '{userId}'.");
|
||||
}
|
||||
|
||||
await _signInManager.SignOutAsync();
|
||||
|
||||
_logger.LogInformation("User with ID '{UserId}' deleted themselves.", userId);
|
||||
|
||||
return Redirect("~/");
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Public Classes
|
||||
|
||||
public class InputModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
@page
|
||||
@model Disable2faModel
|
||||
@{
|
||||
ViewData["Title"] = "Disable two-factor authentication (2FA)";
|
||||
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
|
||||
}
|
||||
|
||||
<partial name="_StatusMessage" for="StatusMessage" />
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<p>
|
||||
<strong>This action only disables 2FA.</strong>
|
||||
</p>
|
||||
<p>
|
||||
Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key
|
||||
used in an authenticator app you should <a asp-page="./ResetAuthenticator">reset your authenticator keys.</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form method="post" class="form-group">
|
||||
<button class="btn btn-danger" type="submit">Disable 2FA</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
|
||||
{
|
||||
public class Disable2faModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<Disable2faModel> _logger;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public Disable2faModel(
|
||||
UserManager<IdentityUser> userManager,
|
||||
ILogger<Disable2faModel> logger)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
if (!await _userManager.GetTwoFactorEnabledAsync(user))
|
||||
{
|
||||
throw new InvalidOperationException($"Cannot disable 2FA for user with ID '{_userManager.GetUserId(User)}' as it's not currently enabled.");
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
var disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false);
|
||||
if (!disable2faResult.Succeeded)
|
||||
{
|
||||
throw new InvalidOperationException($"Unexpected error occurred disabling 2FA for user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
_logger.LogInformation("User with ID '{UserId}' has disabled 2fa.", _userManager.GetUserId(User));
|
||||
StatusMessage = "2fa has been disabled. You can reenable 2fa when you setup an authenticator app";
|
||||
return RedirectToPage("./TwoFactorAuthentication");
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
@page
|
||||
@model DownloadPersonalDataModel
|
||||
@{
|
||||
ViewData["Title"] = "Download Your Data";
|
||||
ViewData["ActivePage"] = ManageNavPages.PersonalData;
|
||||
}
|
||||
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
|
||||
{
|
||||
public class DownloadPersonalDataModel : PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<DownloadPersonalDataModel> _logger;
|
||||
private readonly UserManager<IdentityUser> _userManager;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DownloadPersonalDataModel(
|
||||
UserManager<IdentityUser> userManager,
|
||||
ILogger<DownloadPersonalDataModel> logger)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
}
|
||||
|
||||
_logger.LogInformation("User with ID '{UserId}' asked for their personal data.", _userManager.GetUserId(User));
|
||||
|
||||
// Only include personal data for download
|
||||
var personalData = new Dictionary<string, string>();
|
||||
var personalDataProps = typeof(IdentityUser).GetProperties().Where(
|
||||
prop => Attribute.IsDefined(prop, typeof(PersonalDataAttribute)));
|
||||
foreach (var p in personalDataProps)
|
||||
{
|
||||
personalData.Add(p.Name, p.GetValue(user)?.ToString() ?? "null");
|
||||
}
|
||||
|
||||
var logins = await _userManager.GetLoginsAsync(user);
|
||||
foreach (var l in logins)
|
||||
{
|
||||
personalData.Add($"{l.LoginProvider} external login provider key", l.ProviderKey);
|
||||
}
|
||||
|
||||
Response.Headers.Add("Content-Disposition", "attachment; filename=PersonalData.json");
|
||||
return new FileContentResult(JsonSerializer.SerializeToUtf8Bytes(personalData), "application/json");
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
@page
|
||||
@model EmailModel
|
||||
@{
|
||||
ViewData["Title"] = "Manage Email";
|
||||
ViewData["ActivePage"] = ManageNavPages.Email;
|
||||
}
|
||||
|
||||
<h4>@ViewData["Title"]</h4>
|
||||
<partial name="_StatusMessage" model="Model.StatusMessage" />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<form id="email-form" method="post">
|
||||
<div asp-validation-summary="All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Email"></label>
|
||||
@if (Model.IsEmailConfirmed)
|
||||
{
|
||||
<div class="input-group">
|
||||
<input asp-for="Email" class="form-control" disabled />
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text text-success font-weight-bold">✓</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input asp-for="Email" class="form-control" disabled />
|
||||
<button id="email-verification" type="submit" asp-page-handler="SendVerificationEmail" class="btn btn-link">Send verification email</button>
|
||||
}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Input.NewEmail"></label>
|
||||
<input asp-for="Input.NewEmail" class="form-control" />
|
||||
<span asp-validation-for="Input.NewEmail" class="text-danger"></span>
|
||||
</div>
|
||||
<button id="change-email-button" type="submit" asp-page-handler="ChangeEmail" class="btn btn-primary">Change email</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user