Compare commits
737
Commits
RemoteDebug
...
SDK/Icoel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5442ca494a | ||
|
|
68b819e430 | ||
|
|
e8812faad2 | ||
|
|
4825b10e35 | ||
|
|
7e825d0e93 | ||
|
|
2b81645350 | ||
|
|
924519f157 | ||
|
|
a5a46a7a41 | ||
|
|
24ff59aeb8 | ||
|
|
eb4655edbd | ||
|
|
9be445273e | ||
|
|
87f7288c08 | ||
|
|
4f21fc3b94 | ||
|
|
3e9a96861f | ||
|
|
4d0353cd83 | ||
|
|
13c10dc0dc | ||
|
|
5f5b89e445 | ||
|
|
eddec0566a | ||
|
|
f78c1422be | ||
|
|
25fa766aeb | ||
|
|
9f6d5a80da | ||
|
|
bb14c275d5 | ||
|
|
9a70d3806f | ||
|
|
22fbc5c763 | ||
|
|
7e819f39ad | ||
|
|
845567ca33 | ||
|
|
d0c14f17fd | ||
|
|
6ae0a594e6 | ||
|
|
458d378c12 | ||
|
|
d5f041756b | ||
|
|
ed93c4d123 | ||
|
|
a2423c157d | ||
|
|
86a7bdc912 | ||
|
|
604ab558fc | ||
|
|
af461e1cbf | ||
|
|
b9c6bbcd82 | ||
|
|
73958c8573 | ||
|
|
fe9543681a | ||
|
|
56b5850b1a | ||
|
|
c5e4605de6 | ||
|
|
96be4bdf64 | ||
|
|
ff1586b36d | ||
|
|
7abe80f7b0 | ||
|
|
27d76311a0 | ||
|
|
88d65ae806 | ||
|
|
03e2d68477 | ||
|
|
d9de2b52d6 | ||
|
|
6b73efa871 | ||
|
|
597597ef5b | ||
|
|
c884e4886a | ||
|
|
d1eeb7f43e | ||
|
|
b644a9973f | ||
|
|
a57fc701aa | ||
|
|
092e2cea15 | ||
|
|
b3db69f682 | ||
|
|
de7d55ac7d | ||
|
|
cd49fe747c | ||
|
|
c987caf75e | ||
|
|
de908b710c | ||
|
|
5d83283178 | ||
|
|
23143ff639 | ||
|
|
34ee4d48ab | ||
|
|
9fdee19c7c | ||
|
|
2f2a1c5856 | ||
|
|
236b44a7d5 | ||
|
|
aac9d92780 | ||
|
|
6a214b937d | ||
|
|
5a46383da4 | ||
|
|
5828994ee3 | ||
|
|
305af5c74d | ||
|
|
dcf95e37ce | ||
|
|
b44092654c | ||
|
|
7d4b9e8fdf | ||
|
|
4b1d5d9ba5 | ||
|
|
d32968950a | ||
|
|
87a480132b | ||
|
|
b6f5df7cc0 | ||
|
|
ee9d6bccd9 | ||
|
|
020d48ef81 | ||
|
|
b5a10f0a4d | ||
|
|
4fbd022656 | ||
|
|
f7741afc30 | ||
|
|
5aa295e892 | ||
|
|
05464488c2 | ||
|
|
9c74816bab | ||
|
|
e0847cd908 | ||
|
|
916939ac04 | ||
|
|
ff43684c34 | ||
|
|
10f24fd8a9 | ||
|
|
7fe9041597 | ||
|
|
d0abff101f | ||
|
|
f0cd2524cf | ||
|
|
c593e804a7 | ||
|
|
c35950da01 | ||
|
|
4f56bfefba | ||
|
|
10cda086d2 | ||
|
|
b31ade6b6a | ||
|
|
5730bfa154 | ||
|
|
c8f2572f51 | ||
|
|
71c8a26ac8 | ||
|
|
9a348bef64 | ||
|
|
62cf634c95 | ||
|
|
789defb69d | ||
|
|
a10d23b131 | ||
|
|
a75726bdad | ||
|
|
06d05b8d95 | ||
|
|
c11a9a91b8 | ||
|
|
d2596d57df | ||
|
|
2a98a0270a | ||
|
|
5ed50840ac | ||
|
|
3a6689d752 | ||
|
|
3538277d0b | ||
|
|
51e0486c01 | ||
|
|
76052f9b23 | ||
|
|
e71de2c52f | ||
|
|
c19b635366 | ||
|
|
dff6e4a4e2 | ||
|
|
6acc206fb1 | ||
|
|
674e34f9b5 | ||
|
|
79f20fd611 | ||
|
|
0758afdd98 | ||
|
|
3160d2b60b | ||
|
|
6b5c4ddaa7 | ||
|
|
957d245a53 | ||
|
|
eca5cd628c | ||
|
|
1118725454 | ||
|
|
d28d3ddcfa | ||
|
|
f6b926d77e | ||
|
|
48ffbb6de1 | ||
|
|
7010548337 | ||
|
|
55e8aada24 | ||
|
|
7aed2bfb32 | ||
|
|
3c215cbaa5 | ||
|
|
c16ca8d422 | ||
|
|
77ba05537c | ||
|
|
79e9e6c348 | ||
|
|
97bc417be4 | ||
|
|
6b7a854bb1 | ||
|
|
1d08af6a1f | ||
|
|
1abbbf0f06 | ||
|
|
52632c24ba | ||
|
|
ee8a02c156 | ||
|
|
6b3e5b8715 | ||
|
|
c2d76264eb | ||
|
|
6c1f620775 | ||
|
|
81abde6743 | ||
|
|
b4afc67f55 | ||
|
|
bfd46d3c26 | ||
|
|
32a0be9f90 | ||
|
|
fbd955e218 | ||
|
|
86b17ddeba | ||
|
|
206020281d | ||
|
|
dbc4a03df2 | ||
|
|
9a9138998b | ||
|
|
57992108cd | ||
|
|
020516dcac | ||
|
|
6d1ba5f1ad | ||
|
|
a347d4e60d | ||
|
|
f7420ad6c5 | ||
|
|
2c5f3ad29c | ||
|
|
36b5e5c81e | ||
|
|
c20adac35c | ||
|
|
1b46b1b083 | ||
|
|
b6e0353f78 | ||
|
|
0dd39fc73f | ||
|
|
ca960ff094 | ||
|
|
6776fe848f | ||
|
|
0f0acaae49 | ||
|
|
b3315ebc7c | ||
|
|
4255a813d6 | ||
|
|
4abc80f676 | ||
|
|
1c17d2ed2d | ||
|
|
200ba3c7d5 | ||
|
|
8c38ac95ec | ||
|
|
b4e5297c5a | ||
|
|
f63a34a547 | ||
|
|
26e2f3a3a0 | ||
|
|
0829d4474a | ||
|
|
42185bf93e | ||
|
|
c5e5a5befe | ||
|
|
466e91de18 | ||
|
|
083362ccf7 | ||
|
|
90fb77a2c3 | ||
|
|
6e96070cd1 | ||
|
|
60972602b0 | ||
|
|
a4bdc7fd21 | ||
|
|
fa7d1fdee6 | ||
|
|
e7dc77a058 | ||
|
|
e12de0f60e | ||
|
|
9e76475908 | ||
|
|
cda3a89b78 | ||
|
|
add5495c29 | ||
|
|
8799c74874 | ||
|
|
c23586f2c9 | ||
|
|
dba9bc113e | ||
|
|
ff38224afd | ||
|
|
5af4531a2e | ||
|
|
aae07244ed | ||
|
|
6fe3bb8b07 | ||
|
|
9b41ae4944 | ||
|
|
07197d9e1d | ||
|
|
a1f5b58640 | ||
|
|
772cab4575 | ||
|
|
2df6c3ce72 | ||
|
|
4e4b89944f | ||
|
|
4dc7d6307f | ||
|
|
fab347ace0 | ||
|
|
be04238508 | ||
|
|
dbfea33e98 | ||
|
|
d4606fa6f6 | ||
|
|
6dffd29e65 | ||
|
|
5662be2850 | ||
|
|
57629f9806 | ||
|
|
4f460d3e40 | ||
|
|
af427dd25a | ||
|
|
93f982fcd1 | ||
|
|
6c59b60c9b | ||
|
|
53a8d9a371 | ||
|
|
6893925221 | ||
|
|
0e530a5349 | ||
|
|
6205f7a7c1 | ||
|
|
d0ab5f773c | ||
|
|
30f1a14292 | ||
|
|
bb74aaff1c | ||
|
|
35c61192ed | ||
|
|
7454de6c5d | ||
|
|
356a4fc127 | ||
|
|
b26f205476 | ||
|
|
3f951365cb | ||
|
|
8fd0f336b5 | ||
|
|
e06a140e11 | ||
|
|
b37d6d0d2b | ||
|
|
8c41b4aff5 | ||
|
|
1571877677 | ||
|
|
6ec9b69068 | ||
|
|
58c0e3b165 | ||
|
|
1029149af2 | ||
|
|
691a8bc694 | ||
|
|
a85208e492 | ||
|
|
c34e4c488e | ||
|
|
1a93357180 | ||
|
|
400d7442d8 | ||
|
|
c4313a0ff1 | ||
|
|
a262898d36 | ||
|
|
8956671b39 | ||
|
|
bbf9f0bd17 | ||
|
|
67f8d20560 | ||
|
|
c59b8fd6d7 | ||
|
|
22f872b503 | ||
|
|
b3c196081a | ||
|
|
649d7ffee0 | ||
|
|
b7e9f52367 | ||
|
|
c43681a965 | ||
|
|
f3747c2cdd | ||
|
|
c517f548c8 | ||
|
|
a5e666d623 | ||
|
|
3c365c7a57 | ||
|
|
638c98a642 | ||
|
|
ec29b4a3c6 | ||
|
|
d389fb3632 | ||
|
|
8529d19134 | ||
|
|
c74da3d4e0 | ||
|
|
8cee60292c | ||
|
|
94326ec852 | ||
|
|
e3492d49bf | ||
|
|
1ce1b0a903 | ||
|
|
57b7938e8a | ||
|
|
5c940681b3 | ||
|
|
a56380923c | ||
|
|
326395dcc6 | ||
|
|
4f325d4d1b | ||
|
|
52f67f53f9 | ||
|
|
9aa57eb5ba | ||
|
|
b5e237af8e | ||
|
|
13c75d38d8 | ||
|
|
53fffe9065 | ||
|
|
f88eef7f67 | ||
|
|
27d23fe29f | ||
|
|
ee6c32c1dc | ||
|
|
a091654897 | ||
|
|
5736c8e5b3 | ||
|
|
9ba3b9f36d | ||
|
|
3a8b51641e | ||
|
|
1674f9c980 | ||
|
|
808b7c81ea | ||
|
|
52219a8255 | ||
|
|
b908a7daa6 | ||
|
|
1abf7b16cf | ||
|
|
76315c4ecb | ||
|
|
6976ca959e | ||
|
|
ba6a9bc9ed | ||
|
|
98750aadbf | ||
|
|
bbe1a1c20e | ||
|
|
5770e7e15a | ||
|
|
3d942836f3 | ||
|
|
9fa9807bc5 | ||
|
|
ccef55e5e2 | ||
|
|
a1d757cd94 | ||
|
|
ab00dea4bd | ||
|
|
4cd7214cc6 | ||
|
|
c52963cb21 | ||
|
|
6383a31b15 | ||
|
|
0f7dd9901c | ||
|
|
2e3c6f2e12 | ||
|
|
1ea6e5531a | ||
|
|
91e70da050 | ||
|
|
b22bb8e0b8 | ||
|
|
cd9f9a3cf4 | ||
|
|
aa1d796293 | ||
|
|
691286e28b | ||
|
|
3e14ec5392 | ||
|
|
6d950d8593 | ||
|
|
987a758155 | ||
|
|
3019abd841 | ||
|
|
8dd12ead14 | ||
|
|
7c079c6e93 | ||
|
|
c93c171271 | ||
|
|
899ba0ec85 | ||
|
|
eaf212a120 | ||
|
|
13ff7ab59f | ||
|
|
7c80fb36c2 | ||
|
|
248b6561e9 | ||
|
|
23c8789e47 | ||
|
|
54a288fe6a | ||
|
|
04ebcea85c | ||
|
|
dc0a517579 | ||
|
|
958a8c7bef | ||
|
|
ae85d06069 | ||
|
|
0777cd6a52 | ||
|
|
b802e180df | ||
|
|
5121a825a2 | ||
|
|
5bf295fce2 | ||
|
|
db6cdc8500 | ||
|
|
8cb02d197f | ||
|
|
2ed1d9c7f4 | ||
|
|
447fa15443 | ||
|
|
edcfb09a3c | ||
|
|
d02d1ca6e4 | ||
|
|
d65667d390 | ||
|
|
a9bbca262e | ||
|
|
f6695c7754 | ||
|
|
2f57349347 | ||
|
|
c3df26caad | ||
|
|
90839b0a7e | ||
|
|
ee85cc4b94 | ||
|
|
64255e7405 | ||
|
|
f50f277381 | ||
|
|
efca6d9a67 | ||
|
|
a738cf1df4 | ||
|
|
d2b785593e | ||
|
|
e98c6d1cd1 | ||
|
|
1104998906 | ||
|
|
2cd3821f44 | ||
|
|
002d4558d3 | ||
|
|
cfc3fcc03d | ||
|
|
0a9749a3d6 | ||
|
|
f3b319afc6 | ||
|
|
3dae7c7e14 | ||
|
|
abe6aa24a4 | ||
|
|
f0cbb18246 | ||
|
|
84ac2c365d | ||
|
|
50aa9c27c3 | ||
|
|
28638544d1 | ||
|
|
ef8c11de93 | ||
|
|
5258088ad4 | ||
|
|
a7a60f2839 | ||
|
|
235eacaad9 | ||
|
|
7064047f9a | ||
|
|
48fcce3c9b | ||
|
|
3a0880e5a4 | ||
|
|
39e3a9f7fa | ||
|
|
8a07a80599 | ||
|
|
34ec183982 | ||
|
|
46362b8bfb | ||
|
|
35c36cfe6c | ||
|
|
91a0366b3f | ||
|
|
55e3bbbba9 | ||
|
|
1be69aff97 | ||
|
|
2c40dfc38d | ||
|
|
cf19510bae | ||
|
|
11166ea024 | ||
|
|
71f19a8223 | ||
|
|
15ae12f813 | ||
|
|
4bbd9ab770 | ||
|
|
bba61d7331 | ||
|
|
4a42855062 | ||
|
|
91666cc680 | ||
|
|
560c2a4dfb | ||
|
|
2279732ab7 | ||
|
|
656d0ed525 | ||
|
|
8231c0d3a0 | ||
|
|
05bf628d39 | ||
|
|
347c479fb0 | ||
|
|
28bfd705a7 | ||
|
|
4fd1e39981 | ||
|
|
980c4387a7 | ||
|
|
779db5e1d4 | ||
|
|
a33d43bd0c | ||
|
|
1eebf0f255 | ||
|
|
9e37f01cfd | ||
|
|
d78c6a5a3c | ||
|
|
8c604a7c27 | ||
|
|
640c8275ed | ||
|
|
f316e26c23 | ||
|
|
37399b6ba7 | ||
|
|
5e444aa9e6 | ||
|
|
b9e146ec9d | ||
|
|
097a0bc80a | ||
|
|
1ee69596d1 | ||
|
|
cff43b76c4 | ||
|
|
596b079055 | ||
|
|
7667e00333 | ||
|
|
0d8776e0b4 | ||
|
|
5ed337b2f5 | ||
|
|
50a577ae01 | ||
|
|
6affc054a4 | ||
|
|
08261f80f7 | ||
|
|
fa470f88e1 | ||
|
|
a7dca4dfe7 | ||
|
|
8df54c6212 | ||
|
|
33481fa554 | ||
|
|
ca5f222d56 | ||
|
|
9788302619 | ||
|
|
2ed77d7fc2 | ||
|
|
3525f81d3b | ||
|
|
d0539e494d | ||
|
|
ce45a9e99a | ||
|
|
7d43808b11 | ||
|
|
91f785fe43 | ||
|
|
9e4221a376 | ||
|
|
d92edb0d18 | ||
|
|
29e72e3be2 | ||
|
|
7284803f8b | ||
|
|
0ab2655947 | ||
|
|
dee5cbefc8 | ||
|
|
46415e0869 | ||
|
|
5e06f06a85 | ||
|
|
746873624a | ||
|
|
4a9fee6ce0 | ||
|
|
60c4c75723 | ||
|
|
b1120b574d | ||
|
|
eed4e4fff3 | ||
|
|
c74fbb9f57 | ||
|
|
fef9c95c0c | ||
|
|
379157c767 | ||
|
|
674605ecf4 | ||
|
|
f3d8f4f36f | ||
|
|
4cec875964 | ||
|
|
3f58a52741 | ||
|
|
db94dc3f31 | ||
|
|
dfde1cefd5 | ||
|
|
45656fec10 | ||
|
|
578620d1cd | ||
|
|
9d43293b35 | ||
|
|
5a6056d898 | ||
|
|
364ac36baa | ||
|
|
38abdae335 | ||
|
|
f36fff0568 | ||
|
|
4f37dae021 | ||
|
|
2ed8cfe371 | ||
|
|
5c6a4416a9 | ||
|
|
8a2fa432d9 | ||
|
|
36c3a9cb0d | ||
|
|
67db15a5b3 | ||
|
|
bb652ad220 | ||
|
|
f1786511ee | ||
|
|
dd04ad966a | ||
|
|
f1f8792d3a | ||
|
|
ed63f99045 | ||
|
|
45404f078e | ||
|
|
2bc5177a40 | ||
|
|
a552e77aa9 | ||
|
|
00b9e0d8b4 | ||
|
|
8f147516d3 | ||
|
|
6a04ddb7c4 | ||
|
|
e636ca721f | ||
|
|
d74e017829 | ||
|
|
5966493251 | ||
|
|
ce2d91615f | ||
|
|
f8a92debb4 | ||
|
|
452471eafe | ||
|
|
22a670b881 | ||
|
|
7c91ffdaf4 | ||
|
|
de84685b9b | ||
|
|
9fa0baf1a1 | ||
|
|
1f1a8b127d | ||
|
|
f760186916 | ||
|
|
57ffe97878 | ||
|
|
8881c6fc04 | ||
|
|
c65799b93d | ||
|
|
a69df23835 | ||
|
|
ddc66cc5a0 | ||
|
|
543126f467 | ||
|
|
103e5bc46f | ||
|
|
60c8b0384a | ||
|
|
66bc72f6ce | ||
|
|
6192a47ce6 | ||
|
|
7856f90405 | ||
|
|
864eee46ee | ||
|
|
737979b264 | ||
|
|
7845dedfef | ||
|
|
3af8933678 | ||
|
|
ca26ba39d7 | ||
|
|
e7fe61c394 | ||
|
|
ef25994615 | ||
|
|
7892366242 | ||
|
|
f4e78055d4 | ||
|
|
02a021cc0f | ||
|
|
3e322c2dc9 | ||
|
|
a2e866540e | ||
|
|
8cae143f82 | ||
|
|
2f70720f4f | ||
|
|
f5f973f410 | ||
|
|
015d0abd1c | ||
|
|
cd28df8a1d | ||
|
|
df60390f62 | ||
|
|
c094e97920 | ||
|
|
3bd8ec6d04 | ||
|
|
59764bbac3 | ||
|
|
cbfeb7ec38 | ||
|
|
a92527e02d | ||
|
|
0a60cac585 | ||
|
|
7fbfa144a9 | ||
|
|
95c4aca305 | ||
|
|
f685d99442 | ||
|
|
e1c8b84ff2 | ||
|
|
7066f25073 | ||
|
|
546b6715fb | ||
|
|
c333dab24f | ||
|
|
137456b70f | ||
|
|
0673e2aeb9 | ||
|
|
8fb9dce7d0 | ||
|
|
26745bc696 | ||
|
|
c7ee3c7142 | ||
|
|
0345d996d6 | ||
|
|
8af7eeccc6 | ||
|
|
451dcf5fff | ||
|
|
e3b3ac9221 | ||
|
|
11f5a0644a | ||
|
|
da53277a58 | ||
|
|
1287bdd5c7 | ||
|
|
ab196be84b | ||
|
|
1a02397b31 | ||
|
|
6d0b120860 | ||
|
|
2ee8526b2d | ||
|
|
1f61ae33ce | ||
|
|
1f8cfc6fe7 | ||
|
|
12b250089d | ||
|
|
421f382c65 | ||
|
|
66865195d5 | ||
|
|
2e29127d19 | ||
|
|
1f498b01d1 | ||
|
|
e93aec990a | ||
|
|
601f48ab8a | ||
|
|
519b608870 | ||
|
|
557499592f | ||
|
|
1248ba0cbf | ||
|
|
b64df4682f | ||
|
|
b47882d0fc | ||
|
|
e741eaa88a | ||
|
|
d042c077bb | ||
|
|
9656a803aa | ||
|
|
412de6b7ed | ||
|
|
02cbc242d9 | ||
|
|
98b9dd4397 | ||
|
|
cd4a8aef8f | ||
|
|
9c1d3dabcf | ||
|
|
29e082c265 | ||
|
|
a991542ff3 | ||
|
|
5487eff9a0 | ||
|
|
b42f855ffa | ||
|
|
d830f65aa6 | ||
|
|
29b640710a | ||
|
|
52eae095bb | ||
|
|
29e4de3afa | ||
|
|
5460cf1f20 | ||
|
|
915c2f4ff3 | ||
|
|
01311a846a | ||
|
|
aa77100740 | ||
|
|
248dc49254 | ||
|
|
64284dd8dd | ||
|
|
febdc131eb | ||
|
|
a8068f3841 | ||
|
|
5990bbc385 | ||
|
|
ef1dc655d4 | ||
|
|
568e65946a | ||
|
|
ad6b0478f3 | ||
|
|
de9b6fa3fb | ||
|
|
89c964c3cd | ||
|
|
a3acb09a03 | ||
|
|
e0cb419f82 | ||
|
|
414d5df6ee | ||
|
|
962027e436 | ||
|
|
af2cbd6beb | ||
|
|
ffc6e8be5e | ||
|
|
7566a5c369 | ||
|
|
cdad086744 | ||
|
|
5b45e7ddfc | ||
|
|
cb29265547 | ||
|
|
7aee0d92d9 | ||
|
|
eadc2c6eb5 | ||
|
|
93a8bc2315 | ||
|
|
ad76b97930 | ||
|
|
c8aa06098d | ||
|
|
c812e82bf4 | ||
|
|
57b068bf02 | ||
|
|
3a82500232 | ||
|
|
dd090d5adb | ||
|
|
8eadfce339 | ||
|
|
ee286d0049 | ||
|
|
b57104507f | ||
|
|
32656645f7 | ||
|
|
679388ef20 | ||
|
|
fc806af86e | ||
|
|
95dbe07693 | ||
|
|
79b37db58f | ||
|
|
c7f640af1e | ||
|
|
35637bb693 | ||
|
|
bf0ee03589 | ||
|
|
1a563e3865 | ||
|
|
bf2c780049 | ||
|
|
0778d44235 | ||
|
|
5861298b91 | ||
|
|
e47ffe7b4e | ||
|
|
fe39b23e74 | ||
|
|
20a11f61e7 | ||
|
|
a97546920e | ||
|
|
bdeb60507c | ||
|
|
d9711f5dd9 | ||
|
|
bfeda7ed6a | ||
|
|
7a3e03c053 | ||
|
|
b2e5f82de5 | ||
|
|
e4db9763c4 | ||
|
|
21770cfa66 | ||
|
|
d233c51364 | ||
|
|
be51449c62 | ||
|
|
e9f5244b81 | ||
|
|
be6e838a36 | ||
|
|
9c2fb93bad | ||
|
|
5d8ac192ac | ||
|
|
fa7eb5ad13 | ||
|
|
f780f99705 | ||
|
|
ab2323bf3f | ||
|
|
0829378d59 | ||
|
|
be6f944646 | ||
|
|
36e6038de4 | ||
|
|
e11b88ce62 | ||
|
|
5296b91f03 | ||
|
|
e01fdc7d94 | ||
|
|
c592f485ec | ||
|
|
36cdf993b8 | ||
|
|
d474a5f75c | ||
|
|
0ce2852e9a | ||
|
|
45cecaa3cb | ||
|
|
1cc9973a2f | ||
|
|
e201b3666d | ||
|
|
067bc6ef47 | ||
|
|
6b40ebfe9f | ||
|
|
3e8418c8ab | ||
|
|
f56d389946 | ||
|
|
da056d95a0 | ||
|
|
18510afaf6 | ||
|
|
924944a425 | ||
|
|
d31eb46ec8 | ||
|
|
0ac53b3219 | ||
|
|
36170f369a | ||
|
|
183c441430 | ||
|
|
6ad13b80b2 | ||
|
|
b9578f4dab | ||
|
|
57f13e31db | ||
|
|
6d31362a9c | ||
|
|
6a2c39e3cf | ||
|
|
5c385bd58e | ||
|
|
4c264dbfb5 | ||
|
|
3db4688e20 | ||
|
|
ef83c4ad66 | ||
|
|
b768a8d5aa | ||
|
|
9a4c0a935d | ||
|
|
b2128bc23b | ||
|
|
5b6d9d7801 | ||
|
|
579b59e9d5 | ||
|
|
8504b8aef7 | ||
|
|
7457fae6f8 | ||
|
|
ab106cc8c4 | ||
|
|
75f7a19418 | ||
|
|
b20f37140d | ||
|
|
663e8459d7 | ||
|
|
f5f04c68d1 | ||
|
|
30f0601a09 | ||
|
|
5ace8f2fac | ||
|
|
b1626b1381 | ||
|
|
47a796b945 | ||
|
|
acc0bf2734 | ||
|
|
c139c6e7ce | ||
|
|
de21437881 | ||
|
|
864c71a79f | ||
|
|
0c8ea6f344 | ||
|
|
52268e633c | ||
|
|
c95eacf22b | ||
|
|
fba5879902 | ||
|
|
d1db6dbefc | ||
|
|
d6e9371d24 | ||
|
|
cd99295817 | ||
|
|
d7690b8d1d | ||
|
|
d2b46deff1 | ||
|
|
93b2199f1c | ||
|
|
0a5b05467a | ||
|
|
b09576f91a | ||
|
|
6a2ca75de7 | ||
|
|
d37d71c51d | ||
|
|
3a7eff3554 | ||
|
|
1e9fe1be3d | ||
|
|
f270bac1db | ||
|
|
c609e7644e | ||
|
|
0901fabe62 | ||
|
|
61341e2ab8 | ||
|
|
d8262e82e9 | ||
|
|
0b0ec306b3 | ||
|
|
09dcff9303 | ||
|
|
a28c0acc48 | ||
|
|
2211fc284d | ||
|
|
88089c5a7c | ||
|
|
1dd6ca4511 | ||
|
|
41e276f069 | ||
|
|
90f735ceb0 | ||
|
|
f0a0e0cb2d | ||
|
|
1aa4f7da12 | ||
|
|
3c5004253d | ||
|
|
9f7bfebf97 | ||
|
|
1e7bf45e8b | ||
|
|
1cb0bc84b1 | ||
|
|
f82824fc41 | ||
|
|
dfe57d73de | ||
|
|
1502588443 | ||
|
|
afa2b2b069 | ||
|
|
04d42a0bc1 | ||
|
|
0ea4e7e122 |
+162
-5
@@ -35,9 +35,9 @@ variables:
|
||||
# helper x fix version number
|
||||
.version-fix: &version-fix
|
||||
- |
|
||||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format ddHH)
|
||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format dHH)
|
||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date –format yyMM)+"-beta."+(get-date –format dHH)
|
||||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH)
|
||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
|
||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
|
||||
$env:NEW_COPYRIGHT = "EgalWare @ 2006-" + (get-date -format yyyy)
|
||||
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
|
||||
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
|
||||
@@ -46,7 +46,7 @@ variables:
|
||||
# display versioni generate
|
||||
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
|
||||
Write-Output $resoconto;
|
||||
echo "replace completati"
|
||||
echo "Replace completati"
|
||||
|
||||
# helper x fix nuspec file
|
||||
.nuspec-fix: &nuspec-fix
|
||||
@@ -93,7 +93,7 @@ variables:
|
||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
cd "$env:APP_NAME\bin\"
|
||||
$Source = "*"
|
||||
7zip a -tzip $Target $Source -xr!DATA
|
||||
7zip a -tzip $Target $Source -xr!DATA\CONF
|
||||
echo "called ZIP $Source --> $Target"
|
||||
|
||||
# helper creazione hash files
|
||||
@@ -201,6 +201,23 @@ IOB-WIN-NEXT:build:
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.Ftp:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/Ftp
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.Icoel:build:
|
||||
stage: build
|
||||
tags:
|
||||
@@ -252,9 +269,50 @@ EgwProxy.OsaiCncLib:build:
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.SqlDb:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.SqlDb
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/SqlDb
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# STAGING: (nuget beta)
|
||||
# --------------------------------
|
||||
EgwProxy.Ftp:build:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Debug
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Icoel:build:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
@@ -326,6 +384,29 @@ EgwProxy.OsaiCncLib:build:staging:
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.SqlDb:build:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.SqlDb:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Debug
|
||||
APP_NAME: EgwProxy.SqlDb
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
# --------------------------------
|
||||
# RELEASE
|
||||
# --------------------------------
|
||||
@@ -398,6 +479,30 @@ IOB-WIN-NEXT:release:
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
EgwProxy.Ftp:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Release
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- SDK/Ftp
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"'
|
||||
# - '& "$env:NUGET_PATH" pack "$env:APP_NAME\$env:APP_NAME.csproj" -properties Configuration=$env:CONFIG -Version $env:NUM_REL'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Icoel:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
@@ -469,9 +574,47 @@ EgwProxy.OsaiCncLib:build:release:
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.SqlDb:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.SqlDb:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Release
|
||||
APP_NAME: EgwProxy.SqlDb
|
||||
only:
|
||||
refs:
|
||||
- SDK/SqlDb
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"'
|
||||
# - '& "$env:NUGET_PATH" pack "$env:APP_NAME\$env:APP_NAME.csproj" -properties Configuration=$env:CONFIG -Version $env:NUM_REL'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
# --------------------------------
|
||||
# DocFx
|
||||
# --------------------------------
|
||||
EgwProxy.Ftp:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
- SDK/Ftp
|
||||
script:
|
||||
- docfx $env:APP_NAME/docfx.json
|
||||
- mv $env:APP_NAME/_site "docfx"
|
||||
- *DocReplica
|
||||
|
||||
EgwProxy.Icoel:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
@@ -514,6 +657,20 @@ EgwProxy.OsaiCncLib:docfx:
|
||||
- mv $env:APP_NAME/_site "docfx"
|
||||
- *DocReplica
|
||||
|
||||
EgwProxy.SqlDb:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.Icoel
|
||||
only:
|
||||
- SDK/Icoel
|
||||
script:
|
||||
- docfx $env:APP_NAME/docfx.json
|
||||
- mv $env:APP_NAME/_site "docfx"
|
||||
- *DocReplica
|
||||
|
||||
IOB-WIN-NEXT:docfx:
|
||||
stage: docfx
|
||||
needs: ["IOB-WIN-NEXT:build"]
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# ToDo's aperti
|
||||
## ALL
|
||||
- verifica disattivazione WDST da IOB vari
|
||||
- riorganizzazione GLOBALE degli IOB x folder del tipo iob (OPC-UA, ModBus, Siemens...)
|
||||
|
||||
## IMI REMOSA
|
||||
|
||||
Da completare:
|
||||
- lantek: capire come rendono il link tra dati PODL e part program
|
||||
- check stato dati IMI altri impianto (sembrano "vuotini")
|
||||
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementazione di riferimento x un file di configurazione x esecuzione task tramite EgwCApp
|
||||
/// </summary>
|
||||
public class ConfigFile
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Path Archivio dove depositare file ORIGINALI processati (se !="" vanno archiviati)
|
||||
/// </summary>
|
||||
public string ArchiveDir { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Path dove depositare file tradotti processati (se !="" vanno spostati li)
|
||||
/// </summary>
|
||||
public string ConvertDir { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Path file da processare
|
||||
/// </summary>
|
||||
public string FileInPath { get; set; } = "demoIn.txt";
|
||||
|
||||
/// <summary>
|
||||
/// Path file dove salvare
|
||||
/// </summary>
|
||||
public string FileOutPath { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// IdxODL da registrare
|
||||
/// </summary>
|
||||
public int IdxODL { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Parametri per processing file string --> int
|
||||
/// </summary>
|
||||
public Dictionary<string, int> ProcessParamInt { get; set; } = new Dictionary<string, int>();
|
||||
|
||||
/// <summary>
|
||||
/// Parametri per processing file string --> string
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ProcessParamStr { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// DB Redis dove salvare
|
||||
/// </summary>
|
||||
public int RedisDB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Posizione Redis dove salvare (HashKey)
|
||||
/// </summary>
|
||||
public string RedisOut { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Modalità ritorno risutlati
|
||||
/// </summary>
|
||||
public ReturnMode Return { get; set; } = ReturnMode.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Path file da processare
|
||||
/// </summary>
|
||||
public string TargetName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di iport da condurre
|
||||
/// </summary>
|
||||
public ImportType Type { get; set; } = ImportType.ND;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Tipologia file da importare
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ImportType
|
||||
{
|
||||
ND = 0,
|
||||
CSV,
|
||||
Excel
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum rawTransfType
|
||||
{
|
||||
ND,
|
||||
IcoelBatch,
|
||||
IcoelVarInfo,
|
||||
RegGiacenze
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modalità ritorno risultati
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ReturnMode
|
||||
{
|
||||
ND = 0,
|
||||
Console,
|
||||
File,
|
||||
Redis
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using ExcelDataReader;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Gestione lettura excel:
|
||||
/// https://github.com/ExcelDataReader/ExcelDataReader
|
||||
/// </summary>
|
||||
public class ExcelMan
|
||||
{
|
||||
protected string _path { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Avvio componente x il file indicato
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
public ExcelMan(string filePath)
|
||||
{
|
||||
// verifico esistenza file...
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
_path = filePath;
|
||||
}
|
||||
}
|
||||
|
||||
public DataSet getDataSet()
|
||||
{
|
||||
DataSet result = new DataSet();
|
||||
using (var stream = File.Open(_path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
// Auto-detect format, supports:
|
||||
// - Binary Excel files (2.0-2003 format; *.xls)
|
||||
// - OpenXml Excel files (2007 format; *.xlsx, *.xlsb)
|
||||
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
// 2. Use the AsDataSet extension method
|
||||
//result = reader.AsDataSet();
|
||||
// The result of each spreadsheet is in result.Tables
|
||||
|
||||
// modalità lettura con intestazione
|
||||
result = reader.AsDataSet(new ExcelDataSetConfiguration()
|
||||
{
|
||||
ConfigureDataTable = (_) => new ExcelDataTableConfiguration()
|
||||
{
|
||||
UseHeaderRow = true
|
||||
}
|
||||
});
|
||||
|
||||
#if false
|
||||
result = reader.AsDataSet();
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public IExcelDataReader getExcelReader()
|
||||
{
|
||||
// ExcelDataReader works with the binary Excel file, so it needs a FileStream
|
||||
// to get started. This is how we avoid dependencies on ACE or Interop:
|
||||
FileStream stream = File.Open(_path, FileMode.Open, FileAccess.Read);
|
||||
|
||||
// We return the interface, so that
|
||||
IExcelDataReader reader = null;
|
||||
try
|
||||
{
|
||||
if (_path.EndsWith(".xls"))
|
||||
{
|
||||
reader = ExcelReaderFactory.CreateBinaryReader(stream);
|
||||
}
|
||||
if (_path.EndsWith(".xlsx"))
|
||||
{
|
||||
reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
|
||||
}
|
||||
return reader;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public IEnumerable<string> getWorksheetNames()
|
||||
{
|
||||
var reader = this.getExcelReader();
|
||||
var workbook = reader.AsDataSet();
|
||||
var sheets = from DataTable sheet in workbook.Tables select sheet.TableName;
|
||||
return sheets;
|
||||
}
|
||||
|
||||
public IEnumerable<DataRow> getData(string sheet, bool firstRowIsColumnNames = true)
|
||||
{
|
||||
var reader = this.getExcelReader();
|
||||
//reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
|
||||
var workSheet = reader.AsDataSet().Tables[sheet];
|
||||
var rows = from DataRow a in workSheet.Rows select a;
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
public class RedisMan
|
||||
{
|
||||
protected string connString = "";
|
||||
protected string servAddr = "";
|
||||
protected int servPort = 0;
|
||||
protected int redisDb = 0;
|
||||
public RedisMan(string server, int port, int db)
|
||||
{
|
||||
servAddr = server;
|
||||
servPort = port;
|
||||
redisDb = db;
|
||||
connString = $"{servAddr}:{servPort},db={redisDb},abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
public bool writeData(string redKey, string rawData)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public string getRSV(string redKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
public class WharehouseData
|
||||
{
|
||||
#region Public Classes
|
||||
|
||||
public class BatchRec
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public DateTime DateRif { get; set; } = DateTime.Today;
|
||||
public string ExtDoc { get; set; } = "Doc";
|
||||
public string IdentRG { get; set; } = "NA";
|
||||
public int IdxODL { get; set; } = 0;
|
||||
public string Notes { get; set; } = "Notes";
|
||||
public int NumPack { get; set; } = 0;
|
||||
public string Product { get; set; } = "Prod";
|
||||
|
||||
public double QtyTot { get; set; } = 0.0;
|
||||
public string Supplier { get; set; } = "Suppl";
|
||||
public string Variety { get; set; } = "Var";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32516.85
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.Testing", "EgwCApp.Testing\EgwCApp.Testing.csproj", "{E37013B7-E5C6-48ED-8051-0BA5F29CB234}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.ExcImport", "EgwCApp.ExcImport\EgwCApp.ExcImport.csproj", "{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwCApp.Core", "EgwCApp.Core\EgwCApp.Core.csproj", "{DF02D478-2309-48B8-BF0D-90B02327AF02}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2AF3181F-288A-47D5-8087-2AB660476D85}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>ExcImport</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="testConfExcel.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="testConfCsv.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="testConf.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,373 @@
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using static EgwCApp.Core.WharehouseData;
|
||||
|
||||
namespace EgwCApp.ExcImport
|
||||
{
|
||||
public class ImportProc
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init oggetto per import
|
||||
/// </summary>
|
||||
/// <param name="confFileName"></param>
|
||||
public ImportProc(string confFileName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(confFileName))
|
||||
{
|
||||
fileConfName = confFileName;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Decodifica configurazione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool decodeConfig()
|
||||
{
|
||||
bool answ = false;
|
||||
if (!string.IsNullOrEmpty(fileConfName))
|
||||
{
|
||||
// deserializzo config
|
||||
if (!File.Exists(fileConfName))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile not found | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawData = File.ReadAllText(fileConfName);
|
||||
// se ho contenuto procedo
|
||||
if (string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile empty! | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// deserializzo
|
||||
taskConfig = JsonConvert.DeserializeObject<ConfigFile>(rawData);
|
||||
answ = taskConfig != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue import (se possibile)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doProcess()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico esista il file...
|
||||
if (string.IsNullOrEmpty(taskConfig.FileInPath) && File.Exists(taskConfig.FileInPath))
|
||||
{
|
||||
// manca file ingresso!!! esco!
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico il tipo di process necessario...
|
||||
switch (taskConfig.Type)
|
||||
{
|
||||
case ImportType.CSV:
|
||||
fileReturnData = File.ReadAllText(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.Excel:
|
||||
fileReturnData = processExcelImport(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione ritorno informazioni secondo configurazione...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doReturn()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico il tipo di return necessario...
|
||||
switch (taskConfig.Return)
|
||||
{
|
||||
case ReturnMode.Console:
|
||||
Console.WriteLine(fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.Redis:
|
||||
break;
|
||||
|
||||
case ReturnMode.File:
|
||||
// verifico path ci sia... sennò creo
|
||||
string outPath = string.IsNullOrEmpty(taskConfig.FileOutPath) ? "FileOut.txt" : taskConfig.FileOutPath;
|
||||
// verifico se vadano salvati in una folder differente...
|
||||
if (!string.IsNullOrEmpty(taskConfig.ConvertDir))
|
||||
{
|
||||
if (!Directory.Exists(taskConfig.ConvertDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ConvertDir);
|
||||
}
|
||||
outPath = Path.Combine(taskConfig.ConvertDir, Path.GetFileName(outPath));
|
||||
}
|
||||
// salvo il file!
|
||||
File.WriteAllText(outPath, fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// se fatto eventualmente archivio
|
||||
if (answ)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(taskConfig.ArchiveDir))
|
||||
{
|
||||
// verifico cartella archivio
|
||||
if (!Directory.Exists(taskConfig.ArchiveDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ArchiveDir);
|
||||
}
|
||||
// sposto file
|
||||
string fName = Path.GetFileName(taskConfig.FileInPath);
|
||||
File.Move(taskConfig.FileInPath, Path.Combine(taskConfig.ArchiveDir, fName), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Nome del file config da processare
|
||||
/// </summary>
|
||||
protected string fileConfName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Contenuto del file da restituire come return data (serializzato)
|
||||
/// </summary>
|
||||
protected string fileReturnData { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione del task da eseguire
|
||||
/// </summary>
|
||||
protected ConfigFile? taskConfig { get; set; } = new ConfigFile();
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Estrae da una riga l'i-esimo elemento
|
||||
/// </summary>
|
||||
/// <param name="riga"></param>
|
||||
/// <param name="col"></param>
|
||||
/// <returns></returns>
|
||||
protected string getCellVal(System.Data.DataRow? riga, int col)
|
||||
{
|
||||
string answ = "";
|
||||
if (riga != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = $"{riga.ItemArray[col]}".Trim();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup stringa x impiego tipo ident da char dubbi
|
||||
/// </summary>
|
||||
/// <param name="origData"></param>
|
||||
/// <returns></returns>
|
||||
protected string strFixId(string origData)
|
||||
{
|
||||
return origData.Replace(".", "").Replace(" ", "_");
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Importa un file excel e restituisce una
|
||||
/// </summary>
|
||||
/// <param name="fileItem"></param>
|
||||
/// <returns></returns>
|
||||
private string processExcelImport(string fileItem)
|
||||
{
|
||||
string outVal = "";
|
||||
int numErr = 0;
|
||||
// test procedura di import files excel x Giacovelli...
|
||||
var currExcel = new ExcelMan(fileItem);
|
||||
// creo lista dati in formato RegGiacenze...
|
||||
Dictionary<string, BatchRec> listaGiac = new Dictionary<string, BatchRec>();
|
||||
var dtSet = currExcel.getDataSet();
|
||||
if (dtSet != null && dtSet.Tables != null && dtSet.Tables.Count > 0)
|
||||
{
|
||||
string nomeFile = Path.GetFileName(fileItem);
|
||||
nomeFile = nomeFile.Substring(0, nomeFile.LastIndexOf("."));
|
||||
var elSheet = dtSet.Tables;
|
||||
int idxTab = 0;
|
||||
// cerco lo sheet corretto se > 1
|
||||
if (dtSet.Tables.Count > 1)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < dtSet.Tables.Count; i++)
|
||||
{
|
||||
if (nomeFile.Contains(dtSet.Tables[i].TableName))
|
||||
{
|
||||
idxTab = i;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
// controllo parametro opzionale...
|
||||
if (!found && taskConfig != null && !string.IsNullOrEmpty(taskConfig.TargetName))
|
||||
{
|
||||
if (dtSet.Tables[i].TableName == taskConfig.TargetName)
|
||||
{
|
||||
idxTab = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var tabella = dtSet.Tables[idxTab];
|
||||
int numRighe = tabella.Rows.Count;
|
||||
int idxODL = taskConfig != null ? taskConfig.IdxODL : 0;
|
||||
for (int i = 0; i < numRighe; i++)
|
||||
{
|
||||
if (taskConfig != null && taskConfig.ProcessParamInt != null && taskConfig.ProcessParamInt.Count > 5)
|
||||
{
|
||||
if (numErr < numRighe / 5)
|
||||
{
|
||||
try
|
||||
{
|
||||
// variabili di appoggio...
|
||||
DateTime dtRif = DateTime.Today;
|
||||
double qtyTot = 0;
|
||||
int numPack = 0;
|
||||
var riga = tabella.Rows[i];
|
||||
if (riga != null)
|
||||
{
|
||||
string ddt = getCellVal(riga, taskConfig.ProcessParamInt["ExtDoc"]);
|
||||
string sDate = getCellVal(riga, taskConfig.ProcessParamInt["DateRif"]);
|
||||
string prod = getCellVal(riga, taskConfig.ProcessParamInt["Product"]);
|
||||
// verifiche x import: header, data e DDT (vuoti o "-") --> SKIP!
|
||||
bool checkHeaderKo = (ddt == "DDT" || prod == "PRODOTTO");
|
||||
bool checkEmptyDdt = (string.IsNullOrEmpty(ddt) || ddt == "-");
|
||||
bool checkEmptyDate = (string.IsNullOrEmpty(sDate) || sDate == "-");
|
||||
if (checkHeaderKo)
|
||||
{
|
||||
//lgTrace($"SKIP header");
|
||||
}
|
||||
else if (checkEmptyDdt || checkEmptyDate)
|
||||
{
|
||||
//lgTrace($"SKIP linea vuota | i: {i} | ddt: {ddt} | date: {sDate} | prod: {prod}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string variety = getCellVal(riga, taskConfig.ProcessParamInt["Variety"]);
|
||||
string suppl = getCellVal(riga, taskConfig.ProcessParamInt["Supplier"]);
|
||||
string sQty = getCellVal(riga, taskConfig.ProcessParamInt["QtyTot"]);
|
||||
string sNum = getCellVal(riga, taskConfig.ProcessParamInt["NumPack"]);
|
||||
string numPed = getCellVal(riga, taskConfig.ProcessParamInt["NumPed"]);
|
||||
string packPed = getCellVal(riga, taskConfig.ProcessParamInt["PackPed"]);
|
||||
string pesoPack = getCellVal(riga, taskConfig.ProcessParamInt["PesoPack"]);
|
||||
DateTime.TryParse(sDate, out dtRif);
|
||||
int.TryParse(sNum, out numPack);
|
||||
double.TryParse(sQty, out qtyTot);
|
||||
string identRG = ddt.Length > 2 ? $"{strFixId(ddt)}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}" : $"{dtRif:yyyyMMdd}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}";
|
||||
string notes = $"{numPed}x{packPed}x{pesoPack}";
|
||||
// verifico di avere dati per proseguire...
|
||||
bool checkIdent = !string.IsNullOrEmpty($"{prod}{variety}{suppl}");
|
||||
if (checkIdent)
|
||||
{
|
||||
BatchRec newRow = new BatchRec()
|
||||
{
|
||||
IdxODL = idxODL,
|
||||
IdentRG = identRG,
|
||||
DateRif = dtRif,
|
||||
ExtDoc = ddt,
|
||||
Product = prod,
|
||||
Variety = variety,
|
||||
Supplier = suppl,
|
||||
NumPack = numPack,
|
||||
QtyTot = qtyTot,
|
||||
Notes = notes
|
||||
};
|
||||
// verifico: se manca aggiungo
|
||||
if (!listaGiac.ContainsKey(identRG))
|
||||
{
|
||||
listaGiac.Add(identRG, newRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti aggiorno giacenza con valori numerici
|
||||
listaGiac[identRG].NumPack += newRow.NumPack;
|
||||
listaGiac[identRG].QtyTot += newRow.QtyTot;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//lgError($"Errore verifica identità riga | prod: {prod} | variety: {variety} | suppl: {suppl}");
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listaGiac.Count > 0)
|
||||
{
|
||||
// converto in una nuova lista...
|
||||
int rCounter = 1;
|
||||
Dictionary<int, BatchRec> list2Send = new Dictionary<int, BatchRec>();
|
||||
foreach (var item in listaGiac)
|
||||
{
|
||||
list2Send.Add(rCounter, item.Value);
|
||||
rCounter++;
|
||||
}
|
||||
// serializzo e restituisco file JSON...
|
||||
var serVal = JsonConvert.SerializeObject(list2Send);
|
||||
if (serVal != null && !string.IsNullOrEmpty(serVal))
|
||||
{
|
||||
outVal = serVal;
|
||||
}
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
// ExcImport: Excel Importer, per IobWin in logica lettura Giacenze
|
||||
// parametri:
|
||||
// $0: Path ConfigFile file per esecuzione
|
||||
|
||||
using EgwCApp.ExcImport;
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
string fileName = "";
|
||||
|
||||
// controllo args, se mancassero o incompleti mostro help
|
||||
if (args.Length < 1)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("- ExcelFileImporter - Core 6.0");
|
||||
Console.WriteLine("- v.0.0.0.0 | @Egalware 2022+");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Mancano parametri per esecuzione:");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("$0: ConfigFile da impiegare");
|
||||
|
||||
// provo a processare testConf...
|
||||
fileName = "testConf.json";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = args[0];
|
||||
}
|
||||
|
||||
// ora processo se ho filename valido...
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
// verifico se ho file...
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
ImportProc importObj = new ImportProc(fileName);
|
||||
bool stepOk = importObj.decodeConfig();
|
||||
if (stepOk)
|
||||
{
|
||||
stepOk = importObj.doProcess();
|
||||
if (!stepOk)
|
||||
{
|
||||
Console.WriteLine("Errore in processing file");
|
||||
}
|
||||
else
|
||||
{
|
||||
importObj.doReturn();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore in processing config file");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore file non trovato!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net6.0\win-x64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
|
||||
REM compilo in publish
|
||||
dotnet publish EgwCApp.ExcImport.csproj -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"FilePath": "C:\\Temp\\test.log",
|
||||
"ProcessParams": {},
|
||||
"Return": "Console",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
echo ------------ Parametri compilazione ------------
|
||||
echo OutDir: $(OutDir)
|
||||
echo Configuration: $(ConfigurationName)
|
||||
echo ProjectDir: $(ProjectDir)
|
||||
echo AssemblyName: $(AssemblyName)
|
||||
echo TargetDir: $(TargetDir)
|
||||
echo ------------ Parametri compilazione ------------
|
||||
|
||||
preBuild.bat $(SolutionDir)EgwCApp.ExcImport\EgwCApp.ExcImport.csproj $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\publish\win-x64\ $(ProjectDir)Utils
|
||||
@@ -0,0 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Tools\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
<ProjectReference Include="..\EgwCApp.ExcImport\EgwCApp.ExcImport.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Tools\ExcImport.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="preBuild.bat $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\win-x64\publish\ $(ProjectDir)Tools" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,114 @@
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace EgwCApp.Testing
|
||||
{
|
||||
public class FileProcMan
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public FileProcMan(string toolDir, string exeFileName)
|
||||
{
|
||||
this.confFileName = "conf.json";
|
||||
this.baseDir = toolDir;
|
||||
this.exeName = exeFileName;
|
||||
appPath = $"./{baseDir}/{exeName}";
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Processa il singolo file e riporta tempo esecuzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public TimeSpan doProcess(string fPath)
|
||||
{
|
||||
TimeSpan outVal = new TimeSpan();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
// preparo file conf
|
||||
createConfFile(fPath);
|
||||
// avvio processing
|
||||
Console.WriteLine("calling ext app with args:");
|
||||
Console.WriteLine($"{appPath} {confFileName}");
|
||||
Console.WriteLine();
|
||||
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = appPath,
|
||||
Arguments = $"{confFileName}",
|
||||
WindowStyle = ProcessWindowStyle.Minimized,
|
||||
//WindowStyle = ProcessWindowStyle.Hidden,
|
||||
UseShellExecute = false,
|
||||
//CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
};
|
||||
|
||||
sw.Start();
|
||||
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
string q = "";
|
||||
while (!p.HasExited)
|
||||
{
|
||||
q += p.StandardOutput.ReadToEnd();
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
outVal = sw.Elapsed;
|
||||
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string appPath = "";
|
||||
protected string baseDir = "";
|
||||
protected string confFileName = "";
|
||||
protected string exeName = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void createConfFile(string item)
|
||||
{
|
||||
Dictionary<string, int> importParams = new Dictionary<string, int>();
|
||||
importParams.Add("Product", 3);
|
||||
importParams.Add("Variety", 9);
|
||||
importParams.Add("Supplier", 8);
|
||||
importParams.Add("ExtDoc", 2);
|
||||
importParams.Add("DateRif", 14);
|
||||
importParams.Add("QtyTot", 22);
|
||||
importParams.Add("NumPack", 21);
|
||||
importParams.Add("NumPed", 17);
|
||||
importParams.Add("PackPed", 18);
|
||||
importParams.Add("PesoPack", 20);
|
||||
// calcolo nome file conf specifico
|
||||
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
|
||||
confFileName = $"conf_{outFileName}";
|
||||
// calcolo outFIleName
|
||||
var newConf = new ConfigFile()
|
||||
{
|
||||
ArchiveDir = @"C:\temp\import\archive\",
|
||||
ConvertDir = @"C:\temp\import\convert\",
|
||||
Type = ImportType.Excel,
|
||||
FileInPath = item,
|
||||
FileOutPath = outFileName,
|
||||
Return = ReturnMode.File,
|
||||
ProcessParamInt = importParams,
|
||||
TargetName = "DB Loco"
|
||||
};
|
||||
// serializzo e salvo!
|
||||
var rawData = JsonConvert.SerializeObject(newConf, Formatting.Indented);
|
||||
File.WriteAllText(confFileName, rawData);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using EgwCApp.Core;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json;
|
||||
using EgwCApp.Testing;
|
||||
|
||||
Dictionary<string, TimeSpan> statsColl = new Dictionary<string, TimeSpan>();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Console Test Application");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
|
||||
// creo il file di configurazione...
|
||||
string fileName = "conf.json";
|
||||
ConfigFile newConf = new ConfigFile();
|
||||
string rawData = "";
|
||||
|
||||
// test CSV
|
||||
//newConf = new ConfigFile()
|
||||
//{
|
||||
// Type = ImportType.CSV,
|
||||
// FileInPath = @"C:\Temp\test.log",
|
||||
// Return = ReturnMode.Console
|
||||
//};
|
||||
|
||||
|
||||
// svuoto eventuali conf vecchi
|
||||
var listaConf = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.json");
|
||||
if (listaConf != null && listaConf.Count() > 0)
|
||||
{
|
||||
foreach (var file2del in listaConf)
|
||||
{
|
||||
File.Delete(file2del);
|
||||
}
|
||||
}
|
||||
// cerco file xlsx e ciclo...
|
||||
var listaFiles = Directory.GetFiles(@"C:\temp\import\", "*.xlsx");
|
||||
if (listaFiles != null && listaFiles.Count() > 0)
|
||||
{
|
||||
FileProcMan fpm = new FileProcMan("Tools", "ExcImport.exe");
|
||||
foreach (var item in listaFiles)
|
||||
{
|
||||
TimeSpan timeElaps = fpm.doProcess(item);
|
||||
|
||||
statsColl.Add($"Ext prog executed for {item}", timeElaps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("press enter to proceed...");
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
foreach (var item in statsColl)
|
||||
{
|
||||
Console.WriteLine($"{item.Key} {item.Value.TotalMilliseconds} ms");
|
||||
}
|
||||
//Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
|
||||
|
||||
Console.ReadLine();
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
|
||||
REM recupero versione compilata
|
||||
ROBOCOPY %1 %2 *.exe /MIR
|
||||
|
||||
echo Eseguito restore CApp!
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32516.85
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.Core", "EgwCApp.Core\EgwCApp.Core.csproj", "{DF02D478-2309-48B8-BF0D-90B02327AF02}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.XmlProc", "EgwCApp.XmlProc\EgwCApp.XmlProc.csproj", "{64BC5889-BE30-489A-B78F-8B3EE08819CB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.XmlTesting", "EgwCApp.XmlTesting\EgwCApp.XmlTesting.csproj", "{52D72303-ACAB-4289-8856-0F56A50474FC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{64BC5889-BE30-489A-B78F-8B3EE08819CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64BC5889-BE30-489A-B78F-8B3EE08819CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64BC5889-BE30-489A-B78F-8B3EE08819CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64BC5889-BE30-489A-B78F-8B3EE08819CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{52D72303-ACAB-4289-8856-0F56A50474FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{52D72303-ACAB-4289-8856-0F56A50474FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{52D72303-ACAB-4289-8856-0F56A50474FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{52D72303-ACAB-4289-8856-0F56A50474FC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2AF3181F-288A-47D5-8087-2AB660476D85}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="testConf.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,378 @@
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static EgwCApp.Core.WharehouseData;
|
||||
|
||||
namespace EgwCApp.XmlProc
|
||||
{
|
||||
public class ImportProc
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init oggetto per import
|
||||
/// </summary>
|
||||
/// <param name="confFileName"></param>
|
||||
public ImportProc(string confFileName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(confFileName))
|
||||
{
|
||||
fileConfName = confFileName;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Decodifica configurazione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool decodeConfig()
|
||||
{
|
||||
bool answ = false;
|
||||
if (!string.IsNullOrEmpty(fileConfName))
|
||||
{
|
||||
// deserializzo config
|
||||
if (!File.Exists(fileConfName))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile not found | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawData = File.ReadAllText(fileConfName);
|
||||
// se ho contenuto procedo
|
||||
if (string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile empty! | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// deserializzo
|
||||
taskConfig = JsonConvert.DeserializeObject<ConfigFile>(rawData);
|
||||
answ = taskConfig != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue import (se possibile)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doProcess()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico esista il file...
|
||||
if (string.IsNullOrEmpty(taskConfig.FileInPath) && File.Exists(taskConfig.FileInPath))
|
||||
{
|
||||
// manca file ingresso!!! esco!
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico il tipo di process necessario...
|
||||
switch (taskConfig.Type)
|
||||
{
|
||||
case ImportType.CSV:
|
||||
fileReturnData = File.ReadAllText(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.Excel:
|
||||
fileReturnData = processExcelImport(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione ritorno informazioni secondo configurazione...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doReturn()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico il tipo di return necessario...
|
||||
switch (taskConfig.Return)
|
||||
{
|
||||
case ReturnMode.Console:
|
||||
Console.WriteLine(fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.Redis:
|
||||
break;
|
||||
|
||||
case ReturnMode.File:
|
||||
// verifico path ci sia... sennò creo
|
||||
string outPath = string.IsNullOrEmpty(taskConfig.FileOutPath) ? "FileOut.txt" : taskConfig.FileOutPath;
|
||||
// verifico se vadano salvati in una folder differente...
|
||||
if (!string.IsNullOrEmpty(taskConfig.ConvertDir))
|
||||
{
|
||||
if (!Directory.Exists(taskConfig.ConvertDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ConvertDir);
|
||||
}
|
||||
outPath = Path.Combine(taskConfig.ConvertDir, Path.GetFileName(outPath));
|
||||
}
|
||||
// salvo il file!
|
||||
File.WriteAllText(outPath, fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// se fatto eventualmente archivio
|
||||
if (answ)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(taskConfig.ArchiveDir))
|
||||
{
|
||||
// verifico cartella archivio
|
||||
if (!Directory.Exists(taskConfig.ArchiveDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ArchiveDir);
|
||||
}
|
||||
// sposto file
|
||||
string fName = Path.GetFileName(taskConfig.FileInPath);
|
||||
File.Move(taskConfig.FileInPath, Path.Combine(taskConfig.ArchiveDir, fName), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Nome del file config da processare
|
||||
/// </summary>
|
||||
protected string fileConfName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Contenuto del file da restituire come return data (serializzato)
|
||||
/// </summary>
|
||||
protected string fileReturnData { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione del task da eseguire
|
||||
/// </summary>
|
||||
protected ConfigFile? taskConfig { get; set; } = new ConfigFile();
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Estrae da una riga l'i-esimo elemento
|
||||
/// </summary>
|
||||
/// <param name="riga"></param>
|
||||
/// <param name="col"></param>
|
||||
/// <returns></returns>
|
||||
protected string getCellVal(System.Data.DataRow? riga, int col)
|
||||
{
|
||||
string answ = "";
|
||||
if (riga != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = $"{riga.ItemArray[col]}".Trim();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup stringa x impiego tipo ident da char dubbi
|
||||
/// </summary>
|
||||
/// <param name="origData"></param>
|
||||
/// <returns></returns>
|
||||
protected string strFixId(string origData)
|
||||
{
|
||||
return origData.Replace(".", "").Replace(" ", "_");
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Importa un file excel e restituisce una
|
||||
/// </summary>
|
||||
/// <param name="fileItem"></param>
|
||||
/// <returns></returns>
|
||||
private string processExcelImport(string fileItem)
|
||||
{
|
||||
string outVal = "";
|
||||
int numErr = 0;
|
||||
// test procedura di import files excel x Giacovelli...
|
||||
var currExcel = new ExcelMan(fileItem);
|
||||
// creo lista dati in formato RegGiacenze...
|
||||
Dictionary<string, BatchRec> listaGiac = new Dictionary<string, BatchRec>();
|
||||
var dtSet = currExcel.getDataSet();
|
||||
if (dtSet != null && dtSet.Tables != null && dtSet.Tables.Count > 0)
|
||||
{
|
||||
string nomeFile = Path.GetFileName(fileItem);
|
||||
nomeFile = nomeFile.Substring(0, nomeFile.LastIndexOf("."));
|
||||
var elSheet = dtSet.Tables;
|
||||
int idxTab = 0;
|
||||
// cerco lo sheet corretto se > 1
|
||||
if (dtSet.Tables.Count > 1)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < dtSet.Tables.Count; i++)
|
||||
{
|
||||
if (nomeFile.Contains(dtSet.Tables[i].TableName))
|
||||
{
|
||||
idxTab = i;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
// controllo parametro opzionale...
|
||||
if (!found && taskConfig != null && !string.IsNullOrEmpty(taskConfig.TargetName))
|
||||
{
|
||||
if (dtSet.Tables[i].TableName == taskConfig.TargetName)
|
||||
{
|
||||
idxTab = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var tabella = dtSet.Tables[idxTab];
|
||||
int numRighe = tabella.Rows.Count;
|
||||
int idxODL = taskConfig != null ? taskConfig.IdxODL : 0;
|
||||
for (int i = 0; i < numRighe; i++)
|
||||
{
|
||||
if (taskConfig != null && taskConfig.ProcessParamInt != null && taskConfig.ProcessParamInt.Count > 5)
|
||||
{
|
||||
if (numErr < numRighe / 5)
|
||||
{
|
||||
try
|
||||
{
|
||||
// variabili di appoggio...
|
||||
DateTime dtRif = DateTime.Today;
|
||||
double qtyTot = 0;
|
||||
int numPack = 0;
|
||||
var riga = tabella.Rows[i];
|
||||
if (riga != null)
|
||||
{
|
||||
string ddt = getCellVal(riga, taskConfig.ProcessParamInt["ExtDoc"]);
|
||||
string sDate = getCellVal(riga, taskConfig.ProcessParamInt["DateRif"]);
|
||||
string prod = getCellVal(riga, taskConfig.ProcessParamInt["Product"]);
|
||||
// verifiche x import: header, data e DDT (vuoti o "-") --> SKIP!
|
||||
bool checkHeaderKo = (ddt == "DDT" || prod == "PRODOTTO");
|
||||
bool checkEmptyDdt = (string.IsNullOrEmpty(ddt) || ddt == "-");
|
||||
bool checkEmptyDate = (string.IsNullOrEmpty(sDate) || sDate == "-");
|
||||
if (checkHeaderKo)
|
||||
{
|
||||
//lgTrace($"SKIP header");
|
||||
}
|
||||
else if (checkEmptyDdt || checkEmptyDate)
|
||||
{
|
||||
//lgTrace($"SKIP linea vuota | i: {i} | ddt: {ddt} | date: {sDate} | prod: {prod}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string variety = getCellVal(riga, taskConfig.ProcessParamInt["Variety"]);
|
||||
string suppl = getCellVal(riga, taskConfig.ProcessParamInt["Supplier"]);
|
||||
string sQty = getCellVal(riga, taskConfig.ProcessParamInt["QtyTot"]);
|
||||
string sNum = getCellVal(riga, taskConfig.ProcessParamInt["NumPack"]);
|
||||
string numPed = getCellVal(riga, taskConfig.ProcessParamInt["NumPed"]);
|
||||
string packPed = getCellVal(riga, taskConfig.ProcessParamInt["PackPed"]);
|
||||
string pesoPack = getCellVal(riga, taskConfig.ProcessParamInt["PesoPack"]);
|
||||
DateTime.TryParse(sDate, out dtRif);
|
||||
int.TryParse(sNum, out numPack);
|
||||
double.TryParse(sQty, out qtyTot);
|
||||
string identRG = ddt.Length > 2 ? $"{strFixId(ddt)}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}" : $"{dtRif:yyyyMMdd}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}";
|
||||
string notes = $"{numPed}x{packPed}x{pesoPack}";
|
||||
// verifico di avere dati per proseguire...
|
||||
bool checkIdent = !string.IsNullOrEmpty($"{prod}{variety}{suppl}");
|
||||
if (checkIdent)
|
||||
{
|
||||
BatchRec newRow = new BatchRec()
|
||||
{
|
||||
IdxODL = idxODL,
|
||||
IdentRG = identRG,
|
||||
DateRif = dtRif,
|
||||
ExtDoc = ddt,
|
||||
Product = prod,
|
||||
Variety = variety,
|
||||
Supplier = suppl,
|
||||
NumPack = numPack,
|
||||
QtyTot = qtyTot,
|
||||
Notes = notes
|
||||
};
|
||||
// verifico: se manca aggiungo
|
||||
if (!listaGiac.ContainsKey(identRG))
|
||||
{
|
||||
listaGiac.Add(identRG, newRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti aggiorno giacenza con valori numerici
|
||||
listaGiac[identRG].NumPack += newRow.NumPack;
|
||||
listaGiac[identRG].QtyTot += newRow.QtyTot;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//lgError($"Errore verifica identità riga | prod: {prod} | variety: {variety} | suppl: {suppl}");
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listaGiac.Count > 0)
|
||||
{
|
||||
// converto in una nuova lista...
|
||||
int rCounter = 1;
|
||||
Dictionary<int, BatchRec> list2Send = new Dictionary<int, BatchRec>();
|
||||
foreach (var item in listaGiac)
|
||||
{
|
||||
list2Send.Add(rCounter, item.Value);
|
||||
rCounter++;
|
||||
}
|
||||
// serializzo e restituisco file JSON...
|
||||
var serVal = JsonConvert.SerializeObject(list2Send);
|
||||
if (serVal != null && !string.IsNullOrEmpty(serVal))
|
||||
{
|
||||
outVal = serVal;
|
||||
}
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
// ExcImport: Excel Importer, per IobWin in logica lettura Giacenze
|
||||
// parametri:
|
||||
// $0: Path ConfigFile file per esecuzione
|
||||
|
||||
|
||||
using EgwCApp.XmlProc;
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
string fileName = "";
|
||||
|
||||
// controllo args, se mancassero o incompleti mostro help
|
||||
if (args.Length < 1)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("- ExcelFileImporter - Core 6.0");
|
||||
Console.WriteLine("- v.0.0.0.0 | @Egalware 2022+");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Mancano parametri per esecuzione:");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("$0: ConfigFile da impiegare");
|
||||
|
||||
// provo a processare testConf...
|
||||
fileName = "testConf.json";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = args[0];
|
||||
}
|
||||
|
||||
// ora processo se ho filename valido...
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
// verifico se ho file...
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
ImportProc importObj = new ImportProc(fileName);
|
||||
bool stepOk = importObj.decodeConfig();
|
||||
if (stepOk)
|
||||
{
|
||||
stepOk = importObj.doProcess();
|
||||
if (!stepOk)
|
||||
{
|
||||
Console.WriteLine("Errore in processing file");
|
||||
}
|
||||
else
|
||||
{
|
||||
importObj.doReturn();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore in processing config file");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore file non trovato!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net6.0\win-x64\publish\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
|
||||
REM compilo in publish
|
||||
dotnet publish EgwCApp.ExcImport.csproj -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"FilePath": "C:\\Temp\\test.log",
|
||||
"ProcessParams": {},
|
||||
"Return": "Console",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
echo ------------ Parametri compilazione ------------
|
||||
echo OutDir: $(OutDir)
|
||||
echo Configuration: $(ConfigurationName)
|
||||
echo ProjectDir: $(ProjectDir)
|
||||
echo AssemblyName: $(AssemblyName)
|
||||
echo TargetDir: $(TargetDir)
|
||||
echo ------------ Parametri compilazione ------------
|
||||
|
||||
preBuild.bat $(SolutionDir)EgwCApp.ExcImport\EgwCApp.ExcImport.csproj $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\publish\win-x64\ $(ProjectDir)Utils
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
<ProjectReference Include="..\EgwCApp.XmlProc\EgwCApp.XmlProc.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Tools\ExcImport.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwCApp.XmlTesting
|
||||
{
|
||||
public class FileProcMan
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public FileProcMan(string toolDir, string exeFileName)
|
||||
{
|
||||
this.confFileName = "conf.json";
|
||||
this.baseDir = toolDir;
|
||||
this.exeName = exeFileName;
|
||||
appPath = $"./{baseDir}/{exeName}";
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Processa il singolo file e riporta tempo esecuzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public TimeSpan doProcess(string fPath)
|
||||
{
|
||||
TimeSpan outVal = new TimeSpan();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
// preparo file conf
|
||||
createConfFile(fPath);
|
||||
// avvio processing
|
||||
Console.WriteLine("calling ext app with args:");
|
||||
Console.WriteLine($"{appPath} {confFileName}");
|
||||
Console.WriteLine();
|
||||
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = appPath,
|
||||
Arguments = $"{confFileName}",
|
||||
WindowStyle = ProcessWindowStyle.Minimized,
|
||||
//WindowStyle = ProcessWindowStyle.Hidden,
|
||||
UseShellExecute = false,
|
||||
//CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
};
|
||||
|
||||
sw.Start();
|
||||
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
string q = "";
|
||||
while (!p.HasExited)
|
||||
{
|
||||
q += p.StandardOutput.ReadToEnd();
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
outVal = sw.Elapsed;
|
||||
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string appPath = "";
|
||||
protected string baseDir = "";
|
||||
protected string confFileName = "";
|
||||
protected string exeName = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void createConfFile(string item)
|
||||
{
|
||||
Dictionary<string, int> importParams = new Dictionary<string, int>();
|
||||
importParams.Add("Product", 3);
|
||||
importParams.Add("Variety", 9);
|
||||
importParams.Add("Supplier", 8);
|
||||
importParams.Add("ExtDoc", 2);
|
||||
importParams.Add("DateRif", 14);
|
||||
importParams.Add("QtyTot", 22);
|
||||
importParams.Add("NumPack", 21);
|
||||
importParams.Add("NumPed", 17);
|
||||
importParams.Add("PackPed", 18);
|
||||
importParams.Add("PesoPack", 20);
|
||||
// calcolo nome file conf specifico
|
||||
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
|
||||
confFileName = $"conf_{outFileName}";
|
||||
// calcolo outFIleName
|
||||
var newConf = new ConfigFile()
|
||||
{
|
||||
ArchiveDir = @"C:\temp\import\archive\",
|
||||
ConvertDir = @"C:\temp\import\convert\",
|
||||
Type = ImportType.Excel,
|
||||
FileInPath = item,
|
||||
FileOutPath = outFileName,
|
||||
Return = ReturnMode.File,
|
||||
ProcessParamInt = importParams,
|
||||
TargetName = "DB Loco"
|
||||
};
|
||||
// serializzo e salvo!
|
||||
var rawData = JsonConvert.SerializeObject(newConf, Formatting.Indented);
|
||||
File.WriteAllText(confFileName, rawData);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using EgwCApp.Core;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json;
|
||||
using EgwCApp.XmlTesting;
|
||||
|
||||
Dictionary<string, TimeSpan> statsColl = new Dictionary<string, TimeSpan>();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Console Test Application");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
|
||||
// creo il file di configurazione...
|
||||
string fileName = "conf.json";
|
||||
ConfigFile newConf = new ConfigFile();
|
||||
string rawData = "";
|
||||
|
||||
// test CSV
|
||||
//newConf = new ConfigFile()
|
||||
//{
|
||||
// Type = ImportType.CSV,
|
||||
// FileInPath = @"C:\Temp\test.log",
|
||||
// Return = ReturnMode.Console
|
||||
//};
|
||||
|
||||
|
||||
// svuoto eventuali conf vecchi
|
||||
var listaConf = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.json");
|
||||
if (listaConf != null && listaConf.Count() > 0)
|
||||
{
|
||||
foreach (var file2del in listaConf)
|
||||
{
|
||||
File.Delete(file2del);
|
||||
}
|
||||
}
|
||||
// cerco file xlsx e ciclo...
|
||||
var listaFiles = Directory.GetFiles(@"C:\temp\import\", "*.xlsx");
|
||||
if (listaFiles != null && listaFiles.Count() > 0)
|
||||
{
|
||||
FileProcMan fpm = new FileProcMan("Tools", "ExcImport.exe");
|
||||
foreach (var item in listaFiles)
|
||||
{
|
||||
TimeSpan timeElaps = fpm.doProcess(item);
|
||||
|
||||
statsColl.Add($"Ext prog executed for {item}", timeElaps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("press enter to proceed...");
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
foreach (var item in statsColl)
|
||||
{
|
||||
Console.WriteLine($"{item.Key} {item.Value.TotalMilliseconds} ms");
|
||||
}
|
||||
//Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
|
||||
|
||||
Console.ReadLine();
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
|
||||
REM recupero versione compilata
|
||||
ROBOCOPY %1 %2 *.exe /MIR
|
||||
|
||||
echo Eseguito restore CApp!
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32901.82
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp.Test", "EgwProxy.Ftp.Test\EgwProxy.Ftp.Test.csproj", "{A655A6AC-5997-46F9-9752-8C621B80516C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp", "EgwProxy.Ftp\EgwProxy.Ftp.csproj", "{35D95ED8-E48A-434D-A305-A83E48C8FC6F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E2472E21-58D3-4EAD-BC4A-BC3915B18BEF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.Ftp</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.Ftp</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT) - beta/unstable</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
|
||||
<dependencies>
|
||||
<group>
|
||||
<dependency id="FluentFTP" version="41.0.0" />
|
||||
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.config" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.pdb" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.Ftp</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.Ftp</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT)</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
|
||||
<dependencies>
|
||||
<dependency id="FluentFTP" version="41.0.0" />
|
||||
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.config" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="testFile" value="conf/testSetup.json" />
|
||||
<add key="server" value="ftp.steamware.net" />
|
||||
<add key="userName" value="testftpuser" />
|
||||
<add key="passwd" value="we4reFromB3rghem!" />
|
||||
<add key="rawCert" value="" />
|
||||
<add key="skipCert" value="true" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A655A6AC-5997-46F9-9752-8C621B80516C}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>EgwProxy.Ftp.Test</RootNamespace>
|
||||
<AssemblyName>EgwProxy.Ftp.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestSetup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="conf\testSetup.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="conf\.placeholder" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="test\FileProva.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="temp\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.Ftp\EgwProxy.Ftp.csproj">
|
||||
<Project>{35d95ed8-e48a-434d-a305-a83e48c8fc6f}</Project>
|
||||
<Name>EgwProxy.Ftp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,374 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace EgwProxy.Ftp.Test
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// legge conf in formato stringa
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ReadSetting(string key)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $"{ConfigurationManager.AppSettings[key]}" ?? "";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.Write("Eccezione in ReadSettings");
|
||||
Console.Write(exc.Message);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Helper separatore dash
|
||||
/// </summary>
|
||||
private const string separator = "------------------------";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Programma principale
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Test FTP Client");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
string BaseDirectory = System.IO.Path.GetDirectoryName(exePath);
|
||||
string testFile = Path.Combine(BaseDirectory, ReadSetting("testFile"));
|
||||
Manager ftpClient = new Manager("", "", "", "", false);
|
||||
if (!string.IsNullOrEmpty(testFile))
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine($"Mode json ({testFile})");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
if (File.Exists(testFile))
|
||||
{
|
||||
var rawData = File.ReadAllText(testFile);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
TestSetup testConf = new TestSetup();
|
||||
try
|
||||
{
|
||||
testConf = JsonConvert.DeserializeObject<TestSetup>(rawData);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// setup server
|
||||
ftpClient = new Manager(testConf.server, testConf.user, testConf.password, testConf.rawCert, testConf.skipCert);
|
||||
serverTest(ftpClient);
|
||||
|
||||
// eseguo per ogni step
|
||||
foreach (var item in testConf.steps)
|
||||
{
|
||||
Console.WriteLine($"------ Step {item.id} | {item.description} ------");
|
||||
string esitoStep = "";
|
||||
switch (item.action)
|
||||
{
|
||||
case stepType.checkDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var dirCheckExists = ftpClient.dirExists(dir2check);
|
||||
esitoStep = dirCheckExists ? $"Directory {dir2check} found!" : $"Directory {dir2check} NOT found!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.checkFile:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string file2check = item.paramList[0];
|
||||
var dirCheckExists = ftpClient.fileExists(file2check);
|
||||
esitoStep = dirCheckExists ? $"File {file2check} found!" : $"File {file2check} NOT found!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.createDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
esitoStep = "Error: Folder already exists!";
|
||||
}
|
||||
else
|
||||
{
|
||||
var dirCreate = ftpClient.createDir(dir2check);
|
||||
esitoStep = dirCreate ? $"Directory {dir2check} created!" : $"Error: {dir2check} NOT created!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.delDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.deleteDir(dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} deleted!" : $"Error: {dir2check} NOT deleted!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, delete not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.delFile:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string file2check = item.paramList[0];
|
||||
var preTest = ftpClient.fileExists(file2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.deleteFile(file2check);
|
||||
esitoStep = dirDelete ? $"File {file2check} deleted!" : $"Error: {file2check} NOT deleted!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: File doesn't exists, delete not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.downloadDir:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.getDir(localDir, dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, download not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.downloadFile:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.getDir(localDir, dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, download not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.uploadDir:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string remoteDir = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var dirUploaded = ftpClient.sendDir(localDir, remoteDir);
|
||||
esitoStep = dirUploaded ? $"Directory {remoteDir} uploaded!" : $"Error: {remoteDir} NOT uploaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.uploadFile:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string remotePath = item.paramList[0];
|
||||
string localPath = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var fileUploaded = ftpClient.sendFile(localPath, remotePath);
|
||||
esitoStep = fileUploaded ? $"File {remotePath} uploaded!" : $"Error: {remotePath} NOT uploaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.listContent:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string remoteDir = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(remoteDir);
|
||||
if (preTest)
|
||||
{
|
||||
var listResult = ftpClient.listDir(remoteDir, false);
|
||||
Console.WriteLine($"Content of dir {remoteDir}:");
|
||||
foreach (var itemList in listResult)
|
||||
{
|
||||
Console.WriteLine(itemList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, list not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(esitoStep);
|
||||
Console.WriteLine($"------ Done Step {item.id} ------");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press a key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// test base su server steamware
|
||||
else
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Mode: base");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
|
||||
string sSkipCert = ReadSetting("skipCert");
|
||||
bool skipCert = false;
|
||||
bool.TryParse(sSkipCert, out skipCert);
|
||||
ftpClient = new Manager(ReadSetting("server"), ReadSetting("userName"), ReadSetting("passwd"), ReadSetting("rawCert"), skipCert);
|
||||
serverTest(ftpClient);
|
||||
|
||||
Console.WriteLine("--- Folder ---");
|
||||
var testExists = ftpClient.dirExists($"data/test_folder");
|
||||
if (testExists)
|
||||
{
|
||||
Console.WriteLine("Folder already exists!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("--- Create folder ---");
|
||||
var testCreate = ftpClient.createDir($"data/test_folder");
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
var folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
|
||||
Console.WriteLine("--- Upload file ---");
|
||||
ftpClient.sendFile("test/FileProva.txt", "data/test_folder/FileProva.txt");
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
|
||||
Console.WriteLine("--- Download File ---");
|
||||
|
||||
ftpClient.getFile("test/FileProva_02.txt", "data/test_folder/FileProva.txt");
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
|
||||
private static void serverTest(Manager ftpClient)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
var testServer = ftpClient.serverOk();
|
||||
Console.WriteLine($"Test connessione: esito {testServer}");
|
||||
var srvType = ftpClient.serverType();
|
||||
Console.WriteLine($"Server: {srvType}");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.Ftp.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.Ftp.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a655a6ac-5997-46f9-9752-8c621b80516c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.Ftp.Test
|
||||
{
|
||||
public class TestSetup
|
||||
{
|
||||
public string server { get; set; } = "";
|
||||
public string user { get; set; } = "";
|
||||
public string password { get; set; } = "";
|
||||
public string rawCert { get; set; } = "";
|
||||
public bool skipCert { get; set; } = false;
|
||||
public List<singleStep> steps { get; set; }
|
||||
}
|
||||
|
||||
public class singleStep
|
||||
{
|
||||
public string id { get; set; } = "00";
|
||||
public string description { get; set; } = "00";
|
||||
public stepType action { get; set; } = stepType.checkDir;
|
||||
|
||||
public List<string> paramList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public enum stepType
|
||||
{
|
||||
checkDir,
|
||||
checkFile,
|
||||
createDir,
|
||||
delDir,
|
||||
delFile,
|
||||
downloadDir,
|
||||
downloadFile,
|
||||
uploadDir,
|
||||
uploadFile,
|
||||
listContent
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"server": "ftp.steamware.net",
|
||||
"user": "testftpuser",
|
||||
"password": "we4reFromB3rghem!",
|
||||
"rawCert": "",
|
||||
"skipCert": true,
|
||||
"steps": [
|
||||
{
|
||||
"id": "01",
|
||||
"description": "Test base directory",
|
||||
"action": "checkDir",
|
||||
"paramList": [
|
||||
"data/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "02",
|
||||
"description": "Create directory",
|
||||
"action": "createDir",
|
||||
"paramList": [
|
||||
"data/test_directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "03",
|
||||
"description": "Upload File",
|
||||
"action": "uploadFile",
|
||||
"paramList": [
|
||||
"data/test_directory/FileProva.txt",
|
||||
"test/FileProva.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "04",
|
||||
"description": "Browse Directory",
|
||||
"action": "listContent",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "05",
|
||||
"description": "Upload File",
|
||||
"action": "uploadFile",
|
||||
"paramList": [
|
||||
"data/test_directory/FileProva_02.txt",
|
||||
"test/FileProva.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "06",
|
||||
"description": "Browse Directory",
|
||||
"action": "listContent",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "07",
|
||||
"description": "Download Directory",
|
||||
"action": "downloadDir",
|
||||
"paramList": [
|
||||
"data/test_directory/",
|
||||
"temp/mirror"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "08",
|
||||
"description": "Delete Remote Directory",
|
||||
"action": "delDir",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1 @@
|
||||
File di prova
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{35D95ED8-E48A-434D-A305-A83E48C8FC6F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgwProxy.Ftp</RootNamespace>
|
||||
<AssemblyName>EgwProxy.Ftp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Manager.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,325 @@
|
||||
using FluentFTP;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
|
||||
namespace EgwProxy.Ftp
|
||||
{
|
||||
/// <summary>
|
||||
/// Client per operazioni FTP, basato su FluentFTP: https://github.com/robinrodricks/FluentFTP/wiki/Quick-Start-Example
|
||||
/// </summary>
|
||||
public class Manager
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione di oggetto per comunicazione FTP
|
||||
/// </summary>
|
||||
/// <param name="server"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="passwd"></param>
|
||||
/// <param name="rawCert"></param>
|
||||
/// <param name="skipCert"></param>
|
||||
public Manager(string server, string userName, string passwd, string rawCert, bool skipCert)
|
||||
{
|
||||
_server = server;
|
||||
_userName = userName;
|
||||
_passwd = passwd;
|
||||
_skipCert = skipCert;
|
||||
_rawCert = rawCert;
|
||||
if (!string.IsNullOrEmpty(server))
|
||||
{
|
||||
// se ho user/pwd è autenticato...
|
||||
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(passwd))
|
||||
{
|
||||
client = new FtpClient(server, userName, passwd);
|
||||
}
|
||||
//.. altrimenti anonimo...
|
||||
else
|
||||
{
|
||||
client = new FtpClient(server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Creazione directory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da creare (ad es: @"/public_html/videos")</param>
|
||||
public bool createDir(string remoteDir)
|
||||
{
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
bool answ = client.CreateDirectory(remoteDir);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazionedirectory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da eliminare</param>
|
||||
public bool deleteDir(string remoteDir)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// Elimina folder
|
||||
client.DeleteDirectory(remoteDir);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazionedirectory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteFile">Nome file remoto da eliminare</param>
|
||||
public bool deleteFile(string remoteFile)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// Elimina folder
|
||||
client.DeleteFile(remoteFile);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica esistenza directory su server FTP remoto
|
||||
/// </summary>
|
||||
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/extras/")</param>
|
||||
/// <returns></returns>
|
||||
public bool dirExists(string remotePath)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.DirectoryExists(remotePath);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica esistenza file su server FTP remoto
|
||||
/// </summary>
|
||||
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/big2.txt")</param>
|
||||
/// <returns></returns>
|
||||
public bool fileExists(string remotePath)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.FileExists(remotePath);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scaricamento intera directory, modalità MIRROR
|
||||
/// </summary>
|
||||
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
|
||||
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
|
||||
public bool getDir(string dirPath, string remoteDir)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
try
|
||||
{
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
var result = client.DownloadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
|
||||
answ = (result != null && result.Count > 0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download singolo file
|
||||
/// </summary>
|
||||
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
|
||||
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
|
||||
public bool getFile(string fileName, string remoteName)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// effettuo caricamento puntuale
|
||||
var result = client.DownloadFile(fileName, remoteName);
|
||||
answ = result == FtpStatus.Success;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mostra contenuto directory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da leggere (ad es: @"/public_html/videos")</param>
|
||||
/// <param name="recurse">Indica se fare search ricorsivo</param>
|
||||
public List<string> listDir(string remoteDir, bool recurse)
|
||||
{
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
FtpListItem[] dirContent;
|
||||
if (recurse)
|
||||
{
|
||||
dirContent = client.GetListing(remoteDir, FtpListOption.Recursive);
|
||||
}
|
||||
else
|
||||
{
|
||||
dirContent = client.GetListing(remoteDir);
|
||||
}
|
||||
client.Disconnect();
|
||||
var answ = dirContent.Select(x => $"{x.Type} - {x.Name}").ToList();
|
||||
// chiudo!
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Caricamento intera directory, modalità MIRROR
|
||||
/// </summary>
|
||||
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
|
||||
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
|
||||
public bool sendDir(string dirPath, string remoteDir)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
var result = client.UploadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
|
||||
answ = (result != null && result.Count > 0);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Caricamento singolo file
|
||||
/// </summary>
|
||||
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
|
||||
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
|
||||
public bool sendFile(string fileName, string remoteName)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// effettuo caricamento puntuale
|
||||
var result = client.UploadFile(fileName, remoteName);
|
||||
answ = result == FtpStatus.Success;
|
||||
// se insuccesso --> controllo se ci sia file...
|
||||
if (!answ)
|
||||
{
|
||||
answ = fileExists(remoteName);
|
||||
}
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica connessione con server FTP remoto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool serverOk()
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.IsConnected;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce tipo server remoto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string serverType()
|
||||
{
|
||||
tryConnect();
|
||||
FtpServer srvType = client.ServerType;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return $"{srvType}";
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool _skipCert = false;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string _passwd { get; set; } = "";
|
||||
|
||||
protected string _rawCert { get; set; } = "";
|
||||
protected string _server { get; set; } = "";
|
||||
|
||||
protected string _userName { get; set; } = "";
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private FtpClient client { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void Client_ValidateCertificate(FluentFTP.Client.BaseClient.BaseFtpClient control, FtpSslValidationEventArgs e)
|
||||
{
|
||||
if (e.PolicyErrors == SslPolicyErrors.None || _skipCert || e.Certificate.GetRawCertDataString() == _rawCert)
|
||||
{
|
||||
e.Accept = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{e.PolicyErrors}");
|
||||
Console.WriteLine($"Cert:{Environment.NewLine}{e.Certificate}");
|
||||
Console.WriteLine($"RawString:{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
|
||||
throw new Exception($"{e.PolicyErrors}{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
|
||||
}
|
||||
}
|
||||
|
||||
private void tryConnect()
|
||||
{
|
||||
// connect to the server and automatically detect working FTP settings
|
||||
if (!client.IsConnected)
|
||||
{
|
||||
var profiles = client.AutoDetect();
|
||||
#if false
|
||||
// if any profiles are found, print the code to the console
|
||||
if (profiles.Count > 0)
|
||||
{
|
||||
var code = profiles[0].ToCode();
|
||||
Console.WriteLine(code);
|
||||
}
|
||||
#endif
|
||||
client.ValidateCertificate += Client_ValidateCertificate;
|
||||
client.AutoConnect();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.Ftp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.Ftp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("35d95ed8-e48a-434d-a305-a83e48c8fc6f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"metadata": [
|
||||
{
|
||||
"src": [
|
||||
{
|
||||
"files": [
|
||||
"*.csproj",
|
||||
"*.vbproj"
|
||||
],
|
||||
"cwd": ".",
|
||||
"exclude": [
|
||||
"**/obj/**",
|
||||
"**/bin/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dest": "obj/api"
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
"content": [
|
||||
{
|
||||
"files": [
|
||||
"api/**.yml"
|
||||
],
|
||||
"cwd": "obj"
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"api/*.md",
|
||||
"articles/**.md",
|
||||
"toc.yml",
|
||||
"*.md"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"resource": [
|
||||
{
|
||||
"files": [
|
||||
"images/**"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"overwrite": [
|
||||
{
|
||||
"files": [
|
||||
"apidoc/**.md"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dest": "_site",
|
||||
"template": [
|
||||
"default"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# EgwProxy.Ftp Library
|
||||
|
||||
Documentazione relativa alla libreria di interfaccia via FTP con server generici.
|
||||
|
||||
Disponibile in forma di pacchetto nuget sul repo aziendale nexus.steamware.net: i pacchetti sono disponibili all'indirizzo
|
||||
|
||||
https://nexus.steamware.net/#browse/browse:nuget-hosted
|
||||
|
||||
Vedere la sezione Articles per maggiori informazioni sulle definizioni, l'impiego ed esempi.
|
||||
|
||||
## Articles
|
||||
|
||||
Per maggiori dettagli, definizioni e demo funzionamento si rimanda alla sezione Articles
|
||||
|
||||
## Api
|
||||
|
||||
Per ogni dettaglio e riferimento alla libreria si rimanda alla sezione Api Documentation
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
- name: Articles
|
||||
href: articles/
|
||||
- name: API Documentation
|
||||
href: obj/api/
|
||||
homepage: api/index.md
|
||||
@@ -1,29 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
@@ -37,6 +37,10 @@
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -35,47 +35,14 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Azure.Core, Version=1.6.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Identity, Version=1.3.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Identity.1.3.0\lib\netstandard2.0\Azure.Identity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.SqlClient.4.1.0\lib\net461\Microsoft.Data.SqlClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.22.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client.Extensions.Msal, Version=2.16.5.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.Extensions.Msal.2.16.5\lib\net45\Microsoft.Identity.Client.Extensions.Msal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.6.8.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.9\lib\net45\NLog.dll</HintPath>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.2.3\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@@ -83,76 +50,48 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Configuration.ConfigurationManager.5.0.0\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.OracleClient" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IdentityModel" />
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.6.8.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
|
||||
<Reference Include="System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.ProtectedData, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.ProtectedData.4.5.0\lib\net461\System.Security.Cryptography.ProtectedData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Permissions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Permissions.5.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
@@ -186,14 +125,11 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||
</Project>
|
||||
@@ -1,36 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Azure.Core" version="1.6.0" targetFramework="net462" />
|
||||
<package id="Azure.Identity" version="1.3.0" targetFramework="net462" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.SqlClient" version="4.1.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.SqlClient.SNI" version="4.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Identity.Client" version="4.22.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Identity.Client.Extensions.Msal" version="2.16.5" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Protocols" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="6.8.0" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.9" targetFramework="net462" />
|
||||
<package id="NLog" version="5.2.3" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="6.8.0" targetFramework="net462" />
|
||||
<package id="System.IO" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.AccessControl" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.ProtectedData" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Security.Permissions" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net462" />
|
||||
<package id="System.Text.Json" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net462" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -11,6 +11,10 @@
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="5.1.2" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Icoel\bin\Debug\EgwProxy*.dll" target="lib" />
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="5.1.2" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Icoel\bin\Release\EgwProxy*.dll" target="lib" />
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<appSettings>
|
||||
<add key="IndirizzoIpSizer" value="192.168.137.50" />
|
||||
<add key="SizerTcpPort" value="8001" />
|
||||
<add key="EntrataFrontiera" value="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="ExportIcoel" value="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="TrackerLotti" value="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="SyncState" value="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
</appSettings>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<appSettings>
|
||||
<add key="IndirizzoIpSizer" value="192.168.137.50" />
|
||||
<add key="SizerTcpPort" value="8001" />
|
||||
<add key="EntrataFrontiera" value="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="ExportIcoel" value="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="TrackerLotti" value="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="SyncState" value="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
</appSettings>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<netNamedPipeBinding>
|
||||
@@ -38,23 +38,23 @@
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
<!--
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
-->
|
||||
<!--
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
-->
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
@@ -68,6 +68,10 @@
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -55,10 +58,14 @@
|
||||
<None Include="conf.ini">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="INI\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.Icoel.DataLayer\EgwProxy.Icoel.DataLayer.csproj">
|
||||
<Project>{E36544CB-D699-48D8-9F81-C2758E7C7D19}</Project>
|
||||
<Project>{e36544cb-d699-48d8-9f81-c2758e7c7d19}</Project>
|
||||
<Name>EgwProxy.Icoel.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\EgwProxy.Icoel\EgwProxy.Icoel.csproj">
|
||||
@@ -66,8 +73,5 @@
|
||||
<Name>EgwProxy.Icoel</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="INI\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -36,11 +36,11 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
@@ -54,6 +54,10 @@
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -39,14 +39,17 @@
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.9\lib\net45\NLog.dll</HintPath>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.2.3\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="4.7.9" targetFramework="net462" />
|
||||
<package id="NLog" version="5.2.3" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>EgwProxy.SqlDb</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.SqlDb</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con generico DB SqlDb di frontiera x scambio dati (IOB-WIN-NEXT) - beta/unstable</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.SqlDb EgwProxy SqlDb</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="5.1.2" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.SqlDb\bin\Debug\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.SqlDb\bin\Debug\EgwProxy*.config" target="lib" />
|
||||
<file src="EgwProxy.SqlDb\bin\Debug\EgwProxy*.pdb" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>EgwProxy.SqlDb</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.SqlDb</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con generico DB SqlDb di frontiera x scambio dati (IOB-WIN-NEXT)</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.SqlDb EgwProxy SqlDb</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="5.1.2" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.SqlDb\bin\Release\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.SqlDb\bin\Release\EgwProxy*.config" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<appSettings>
|
||||
<add key="testFile" value="conf/testSetup.json" />
|
||||
<add key="server" value="SQL2016DEV" />
|
||||
<add key="userName" value="sa" />
|
||||
<add key="passwd" value="keyhammer16" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A11CA446-AE97-413D-A567-45A081F003DB}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>EgwProxy.SqlDb.Test</RootNamespace>
|
||||
<AssemblyName>EgwProxy.SqlDb.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Remote_DEBUG\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestSetup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="conf\.placeholder" />
|
||||
<None Include="conf\testSetup.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="postBuildTgt.bat" />
|
||||
<None Include="setupTgt.bat" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.SqlDb\EgwProxy.SqlDb.csproj">
|
||||
<Project>{a5f9e2c8-b866-4470-923c-11ba35270963}</Project>
|
||||
<Name>EgwProxy.SqlDb</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>"$(ProjectDir)setupTgt.bat" "$(ConfigurationName)" "$(ProjectDir)"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>"$(ProjectDir)postBuildTgt.bat" "$(ConfigurationName)" "$(TargetDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,296 @@
|
||||
using EgwProxy.SqlDb.Controllers;
|
||||
using EgwProxy.SqlDb.DbModels;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace EgwProxy.SqlDb.Test
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// legge conf in formato stringa
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ReadSetting(string key)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $"{ConfigurationManager.AppSettings[key]}" ?? "";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.Write("Eccezione in ReadSettings");
|
||||
Console.Write(exc.Message);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Helper separatore dash
|
||||
/// </summary>
|
||||
private const string separator = "------------------------";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Programma principale
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Test DB Client");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
string BaseDirectory = Path.GetDirectoryName(exePath);
|
||||
string testFile = Path.Combine(BaseDirectory, ReadSetting("testFile"));
|
||||
string connStr = "";
|
||||
DbController dbClient = new DbController(connStr);
|
||||
if (!string.IsNullOrEmpty(testFile))
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine($"Mode json ({testFile})");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
if (File.Exists(testFile))
|
||||
{
|
||||
var rawData = File.ReadAllText(testFile);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
TestSetup testConf = new TestSetup();
|
||||
try
|
||||
{
|
||||
testConf = JsonConvert.DeserializeObject<TestSetup>(rawData);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// setup server
|
||||
connStr = $"data source={testConf.server};initial catalog={testConf.dbName};persist security info=True;user id={testConf.user};password={testConf.password};MultipleActiveResultSets=True;App={testConf.app}";
|
||||
dbClient = new DbController(connStr);
|
||||
serverTest(dbClient);
|
||||
|
||||
// eseguo per ogni step
|
||||
foreach (var item in testConf.steps)
|
||||
{
|
||||
Console.WriteLine($"------ Step {item.id} | {item.description} ------");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(separator);
|
||||
switch (item.action)
|
||||
{
|
||||
case stepType.GetSyncState:
|
||||
var currTab = dbClient.SyncStateGetAll();
|
||||
if (currTab != null && currTab.Count > 0)
|
||||
{
|
||||
foreach (var syncRec in currTab)
|
||||
{
|
||||
sb.AppendLine($"{syncRec.TableName} | {syncRec.LastIdx} | {syncRec.Note} | {syncRec.LastUpdate}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine("Error: Table empty/missing!");
|
||||
}
|
||||
sb.AppendLine(separator);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case stepType.ResetPodl:
|
||||
sb.AppendLine("Inizio reset PODL");
|
||||
|
||||
var dbRes = dbClient.ResetPODLMes();
|
||||
if (dbRes.Count == 0)
|
||||
{
|
||||
sb.AppendLine("Pulizia eseguita!");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine("Problemi con svuotamento tab PODL");
|
||||
}
|
||||
|
||||
sb.AppendLine(separator);
|
||||
|
||||
break;
|
||||
case stepType.SetNewPodl:
|
||||
sb.AppendLine($"Inizio inserimento {item.paramList.Count} rec");
|
||||
// creo una lista di PODL da processare...
|
||||
List<MesPODLReqModel> CurrPodlReq = new List<MesPODLReqModel>();
|
||||
foreach (var podl in item.paramList)
|
||||
{
|
||||
int idxPodl = 0;
|
||||
int.TryParse(podl, out idxPodl);
|
||||
MesPODLReqModel newRec = new MesPODLReqModel()
|
||||
{
|
||||
Attivabile = true,
|
||||
CodArticolo = "ART000000",
|
||||
IdxMacchina = "SIMUL_01",
|
||||
IdxODL = 0,
|
||||
IdxPromessa = idxPodl,
|
||||
NumPezzi = 1
|
||||
};
|
||||
CurrPodlReq.Add(newRec);
|
||||
sb.AppendLine($"Aggiunto PODL{podl:0000000}");
|
||||
}
|
||||
// chiamo procedura insert PODL
|
||||
bool fatto = dbClient.MesPodlWriteReq(CurrPodlReq);
|
||||
sb.AppendLine($"Records Aggiunti!");
|
||||
sb.AppendLine(separator);
|
||||
break;
|
||||
case stepType.DbMigrateAndSync:
|
||||
try
|
||||
{
|
||||
var esitoMigrate = dbClient.DbForceMigrate();
|
||||
sb.Append($"Migration: {esitoMigrate}");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in migrate:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.ExecExportAll:
|
||||
try
|
||||
{
|
||||
var esitoExport = dbClient.SyncStateDoExportAll();
|
||||
sb.Append($"ExportAll: {esitoExport}");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in ExportAll:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
case stepType.ExecImportAll:
|
||||
try
|
||||
{
|
||||
var esitoImport = dbClient.SyncStateDoImportAll();
|
||||
sb.Append($"ImportAll: {esitoImport}");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in ImportAll:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
case stepType.GetMachFluxLog:
|
||||
try
|
||||
{
|
||||
var currFL = dbClient.MachFluxLogGetNew(0);
|
||||
// mostro le righe
|
||||
foreach (var fluxRow in currFL)
|
||||
{
|
||||
// aggiungo riga in out
|
||||
sb.Append($"{fluxRow.Id:000} | {fluxRow.DtEvento} | {fluxRow.CodFlux} | {fluxRow.Valore}");
|
||||
}
|
||||
// aggiorno syncstate...
|
||||
int lastIdx = currFL.Max(x => x.Id);
|
||||
SyncStateModel currSync = new SyncStateModel()
|
||||
{
|
||||
LastIdx = lastIdx,
|
||||
LastUpdate = DateTime.Now,
|
||||
Note = "Test update",
|
||||
TableName = "FluxLog"
|
||||
};
|
||||
dbClient.SyncStateUpsert(currSync);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in GetMachFluxLog:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
case stepType.GetMachProdData:
|
||||
try
|
||||
{
|
||||
var currFL = dbClient.MachProdDataGetNew(0);
|
||||
// mostro le righe
|
||||
foreach (var fluxRow in currFL)
|
||||
{
|
||||
// aggiungo riga in out
|
||||
sb.Append($"{fluxRow.Id:000} | {fluxRow.DtEve} | {fluxRow.CodComm} | {fluxRow.Action}");
|
||||
}
|
||||
// aggiorno syncstate...
|
||||
int lastIdx = currFL.Max(x => x.Id);
|
||||
SyncStateModel currSync = new SyncStateModel()
|
||||
{
|
||||
LastIdx = lastIdx,
|
||||
LastUpdate = DateTime.Now,
|
||||
Note = "Test update",
|
||||
TableName = "ProdData"
|
||||
};
|
||||
dbClient.SyncStateUpsert(currSync);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in GetMachProdData:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
case stepType.GetMachSignLog:
|
||||
try
|
||||
{
|
||||
var currFL = dbClient.MachSigLogGetNew(0);
|
||||
// mostro le righe
|
||||
foreach (var fluxRow in currFL)
|
||||
{
|
||||
// aggiungo riga in out
|
||||
sb.Append($"{fluxRow.Id:000} | {fluxRow.DtEve} | {fluxRow.ValInt} | {fluxRow.Valore}");
|
||||
}
|
||||
// aggiorno syncstate...
|
||||
int lastIdx = currFL.Max(x => x.Id);
|
||||
SyncStateModel currSync = new SyncStateModel()
|
||||
{
|
||||
LastIdx = lastIdx,
|
||||
LastUpdate = DateTime.Now,
|
||||
Note = "Test update",
|
||||
TableName = "SignLog"
|
||||
};
|
||||
dbClient.SyncStateUpsert(currSync);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
sb.AppendLine($"eccezione in GetMachSignLog:{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
string esitoStep = sb.ToString();
|
||||
|
||||
Console.WriteLine(esitoStep);
|
||||
Console.WriteLine($"------ Done Step {item.id} ------");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press a key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void serverTest(DbController dbClient)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
string testServer = dbClient.ServerOk();
|
||||
Console.WriteLine($"Test connessione: esito {testServer}");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.SqlDb.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.SqlDb.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a11ca446-ae97-413d-a567-45a081f003db")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
|
||||
ALTER PROCEDURE [dbo].[GetMachineFluxLog]
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
BEGIN tran
|
||||
|
||||
-- dichiarazioni variabili x recupero dati
|
||||
DECLARE @LastIdx INT = 0
|
||||
DECLARE @NewIdx INT = 0
|
||||
|
||||
-- recupero valore ultima riga stato processata...
|
||||
SELECT @LastIdx = ISNULL(LastIdx,0)
|
||||
FROM SyncState
|
||||
WHERE TableName = 'ToMachineFluxLog'
|
||||
|
||||
-- recupero nuovo MAX idx
|
||||
SELECT @NewIdx = ISNULL(MAX(ID),0)
|
||||
FROM syn_M2ERP_MACHINE_STATE
|
||||
|
||||
-- eseguo SOLO SE ho dati aggiuntivi...
|
||||
IF(@NewIdx > @LastIdx)
|
||||
BEGIN
|
||||
/* --------------------------------------------------
|
||||
* Invierò solo VARIAZIONI dei valori
|
||||
* - CurrentPP (Part Program)
|
||||
* - ActiveProdOrder (Ordine in esecuzione)
|
||||
*
|
||||
* andando ad incrociare ogni record col precedente...
|
||||
* -------------------------------------------------- */
|
||||
|
||||
-- processo dati ORDINI
|
||||
;WITH cteCurrOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ActiveProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
FROM syn_M2ERP_MACHINE_STATE
|
||||
WHERE ID > @LastIdx AND ID <= @NewIdx
|
||||
)
|
||||
, ctePrevOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ActiveProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
FROM syn_M2ERP_MACHINE_STATE
|
||||
WHERE ID >= @LastIdx AND ID < @NewIdx
|
||||
)
|
||||
|
||||
-- lego i valori col precedente x calcolare se siano variati x insert valori
|
||||
INSERT INTO MachineFluxLog(DtEvento, IdxMacchina, CodFlux, Valore, Cnt)
|
||||
SELECT curr.DtEvento, curr.IdxMacchina, 'ProdOrd' AS CodFlux, curr.ActiveProdOrder as Valore, 0 as Cnt
|
||||
FROM cteCurrOrd curr
|
||||
INNER JOIN ctePrevOrd prev
|
||||
ON curr.ID = prev.ID+1
|
||||
WHERE curr.ActiveProdOrder <> prev.ActiveProdOrder
|
||||
|
||||
-- processo dati Part Program
|
||||
;WITH cteCurrPP AS
|
||||
(
|
||||
SELECT ID
|
||||
,CurrentPP
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
FROM syn_M2ERP_MACHINE_STATE
|
||||
WHERE ID > @LastIdx AND ID <= @NewIdx
|
||||
)
|
||||
, ctePrevPP AS
|
||||
(
|
||||
SELECT ID
|
||||
,CurrentPP
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
FROM syn_M2ERP_MACHINE_STATE
|
||||
WHERE ID >= @LastIdx AND ID < @NewIdx
|
||||
)
|
||||
|
||||
-- lego i valori col precedente x calcolare se siano variati x insert valori
|
||||
INSERT INTO MachineFluxLog(DtEvento, IdxMacchina, CodFlux, Valore, Cnt)
|
||||
SELECT curr.DtEvento, curr.IdxMacchina, 'PartProg' as CodFlux, curr.CurrentPP as Valore, 0 as Cnt
|
||||
FROM cteCurrPP curr
|
||||
INNER JOIN ctePrevPP prev
|
||||
ON curr.ID = prev.ID+1
|
||||
WHERE curr.CurrentPP <> prev.CurrentPP
|
||||
|
||||
|
||||
-- aggiorno valore indice processato
|
||||
MERGE SyncState AS tgt
|
||||
USING (SELECT @NewIdx as LastIdx, 'ToMachineFluxLog' AS TableName) as src (LastIdx, TableName)
|
||||
ON (tgt.TableName = src.TableName)
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET LastIdx = src.LastIdx
|
||||
,Note = 'UPDATED from ' + CAST(@LastIdx AS NVARCHAR(50))
|
||||
,LastUpdate = GETDATE()
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT (LastIdx, TableName, Note, LastUpdate)
|
||||
VALUES (src.LastIdx, src.TableName, 'CREATED', GETDATE());
|
||||
|
||||
END
|
||||
|
||||
COMMIT tran
|
||||
END
|
||||
@@ -0,0 +1,166 @@
|
||||
ALTER PROCEDURE [dbo].[stp_GetMachineProdData]
|
||||
AS
|
||||
BEGIN
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
BEGIN tran
|
||||
|
||||
-- dichiarazioni variabili x recupero dati
|
||||
DECLARE @LastIdx INT = 0
|
||||
DECLARE @NewIdx INT = 0
|
||||
|
||||
-- recupero valore ultima riga stato processata...
|
||||
SELECT @LastIdx = ISNULL(LastIdx,0)
|
||||
FROM SyncState
|
||||
WHERE TableName = 'ToMachineProdData'
|
||||
|
||||
-- recupero nuovo MAX idx
|
||||
SELECT @NewIdx = ISNULL(MAX(ID),0)
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
|
||||
-- eseguo SOLO SE ho dati aggiuntivi...
|
||||
IF(@NewIdx > @LastIdx)
|
||||
BEGIN
|
||||
/* --------------------------------------------------
|
||||
* Invierò solo VARIAZIONI dei valori
|
||||
* - CurrentProdOrder (iniziato/concluso)
|
||||
* - Quantità Produzione
|
||||
* - dati FluxLog x ordini/quantità/tempi di produzione
|
||||
*
|
||||
* andando ad incrociare ogni record col precedente...
|
||||
* -------------------------------------------------- */
|
||||
|
||||
-- processo dati ORDINI
|
||||
;WITH cteCurrOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
,ProdOrderState
|
||||
,ProdQty
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
WHERE ID > @LastIdx AND ID <= @NewIdx
|
||||
)
|
||||
, ctePrevOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
,ProdOrderState
|
||||
,ProdQty
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
WHERE ID >= @LastIdx AND ID < @NewIdx
|
||||
)
|
||||
, cteActDec AS
|
||||
(
|
||||
SELECT curr.DtEvento as DtEve
|
||||
,curr.IdxMacchina
|
||||
,CASE
|
||||
WHEN curr.ProdOrderState = 1 THEN 'StartOrd'
|
||||
--WHEN curr.ProdOrderState = 2 THEN 'PauseOrd'
|
||||
WHEN curr.ProdOrderState = 3 THEN 'EndOrd'
|
||||
--WHEN curr.ProdOrderState = 6 THEN 'InsOrd'
|
||||
ELSE 'NONE'
|
||||
END AS OrdAction
|
||||
,CASE
|
||||
WHEN LEFT(curr.ProdOrder, 4) = 'PODL' THEN REPLACE(curr.ProdOrder,'PODL','')
|
||||
ELSE 0 END AS IdxPodl
|
||||
,CASE
|
||||
WHEN LEFT(curr.ProdOrder, 3) = 'ODL' THEN REPLACE(curr.ProdOrder,'ODL','')
|
||||
ELSE 0 END AS IdxOdl
|
||||
,curr.ProdOrder as CodComm
|
||||
,curr.ProdQty as PzCount
|
||||
FROM cteCurrOrd curr
|
||||
INNER JOIN ctePrevOrd prev
|
||||
ON curr.ID = prev.ID+1
|
||||
WHERE (curr.ProdOrder <> prev.ProdOrder)
|
||||
OR (curr.ProdOrderState <> prev.ProdOrderState)
|
||||
OR (curr.ProdQty <> prev.ProdQty)
|
||||
)
|
||||
-- lego i valori col precedente x calcolare se siano variati x insert valori
|
||||
INSERT INTO MachineProdData(DtEve, IdxMacchina, Action, IdxPodl, IdxOdl, CodComm, PzCount)
|
||||
SELECT DtEve, IdxMacchina, OrdAction, IdxPodl, IdxOdl, CodComm, PzCount
|
||||
FROM cteActDec
|
||||
WHERE OrdAction <> 'NONE'
|
||||
|
||||
-- ora processo ANCHE come fluxLog i record dei degli ordini (cod ordine, tempi...)
|
||||
;WITH cteCurrOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
,ProdOrderState
|
||||
,ProdQty
|
||||
,ElapsedTime
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
WHERE ID > @LastIdx AND ID <= @NewIdx
|
||||
)
|
||||
, ctePrevOrd AS
|
||||
(
|
||||
SELECT ID
|
||||
,ProdOrder
|
||||
,Targa as IdxMacchina
|
||||
,[DateTime] AS DtEvento
|
||||
,ProdOrderState
|
||||
,ProdQty
|
||||
,ElapsedTime
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
WHERE ID >= @LastIdx AND ID < @NewIdx
|
||||
)
|
||||
, cteActDec AS
|
||||
(
|
||||
SELECT curr.DtEvento as DtEve
|
||||
,curr.IdxMacchina
|
||||
,CASE
|
||||
WHEN curr.ProdOrderState = 1 THEN 'StartOrd'
|
||||
--WHEN curr.ProdOrderState = 2 THEN 'PauseOrd'
|
||||
WHEN curr.ProdOrderState = 3 THEN 'EndOrd'
|
||||
--WHEN curr.ProdOrderState = 6 THEN 'InsOrd'
|
||||
ELSE 'NONE'
|
||||
END AS OrdAction
|
||||
,CAST(CASE
|
||||
WHEN LEFT(curr.ProdOrder, 4) = 'PODL' THEN REPLACE(curr.ProdOrder,'PODL','')
|
||||
ELSE '0' END AS NVARCHAR(50)) AS IdxPodl
|
||||
,CAST(CASE
|
||||
WHEN LEFT(curr.ProdOrder, 3) = 'ODL' THEN REPLACE(curr.ProdOrder,'ODL','')
|
||||
ELSE '0' END AS NVARCHAR(50)) AS IdxOdl
|
||||
,CAST(curr.ProdOrder AS NVARCHAR(50)) as CodComm
|
||||
,curr.ProdQty as PzCount
|
||||
,CAST(curr.ElapsedTime AS NVARCHAR(50)) AS ElapsedTime
|
||||
FROM cteCurrOrd curr
|
||||
INNER JOIN ctePrevOrd prev
|
||||
ON curr.ID = prev.ID+1
|
||||
WHERE (curr.ProdOrder <> prev.ProdOrder)
|
||||
OR (curr.ProdOrderState <> prev.ProdOrderState)
|
||||
OR (curr.ProdQty <> prev.ProdQty)
|
||||
)
|
||||
-- lego i valori col precedente x calcolare se siano variati x insert valori
|
||||
--INSERT INTO MachineFluxLog(DtEvento, IdxMacchina, CodFlux, Valore, Cnt)
|
||||
SELECT DtEve as DtEvento, IdxMacchina, CodFlux, Valore,0 as Cnt
|
||||
FROM cteActDec
|
||||
UNPIVOT (Valore FOR CodFlux IN (CodComm, ElapsedTime, IdxOdl, IdxPOdl)) AS Unpvt
|
||||
WHERE OrdAction <> 'NONE'
|
||||
AND Valore <> '0'
|
||||
|
||||
-- aggiorno valore indice processato
|
||||
MERGE SyncState AS tgt
|
||||
USING (SELECT @NewIdx as LastIdx, 'ToMachineProdData' AS TableName) as src (LastIdx, TableName)
|
||||
ON (tgt.TableName = src.TableName)
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET LastIdx = src.LastIdx
|
||||
,Note = 'UPDATED from ' + CAST(@LastIdx AS NVARCHAR(50))
|
||||
,LastUpdate = GETDATE()
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT (LastIdx, TableName, Note, LastUpdate)
|
||||
VALUES (src.LastIdx, src.TableName, 'CREATED', GETDATE());
|
||||
|
||||
END
|
||||
|
||||
COMMIT tran
|
||||
|
||||
END
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
/****** MoonPro_IOB-ISF_PAMA Script Date: 13/03/2023 19:03:53 ******/
|
||||
|
||||
-- creazione sinonimi
|
||||
CREATE SYNONYM [dbo].[syn_ERP2M] FOR [P_HUB_PLD392].[dbo].[ERP2M]
|
||||
CREATE SYNONYM [dbo].[syn_M2ERP_MACHINE_STATE] FOR [P_HUB_PLD392].[dbo].[M2ERP_MACHINE_STATE]
|
||||
CREATE SYNONYM [dbo].[syn_M2ERP_PRODORDERS] FOR [P_HUB_PLD392].[dbo].[M2ERP_PRODORDERS]
|
||||
|
||||
GO
|
||||
|
||||
-- fix funzione
|
||||
/***************************************
|
||||
* FUNCTION f_padLeft
|
||||
*
|
||||
* fornisce una stringa della lunghezza desiderata aggiungendo a sx il carattere richiesto alla @string originale
|
||||
*
|
||||
* Steamware, S.E.L.
|
||||
* mod: 2010.03.19
|
||||
*
|
||||
****************************************/
|
||||
create FUNCTION [dbo].[f_padLeft] (@string VARCHAR(255), @desired_length INTEGER, @pad_character CHAR(1))
|
||||
RETURNS VARCHAR(255) AS
|
||||
BEGIN
|
||||
|
||||
-- Prefix the required number of spaces to bulk up the string and then replace the spaces with the desired character
|
||||
RETURN CASE
|
||||
WHEN LEN(@string) < @desired_length
|
||||
THEN REPLACE(SPACE(@desired_length - LEN(@string)), ' ', @pad_character) + @string
|
||||
ELSE @string
|
||||
END
|
||||
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- fix stored specifiche
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,98 @@
|
||||
select * from ActType
|
||||
select * from ActList
|
||||
select * from SyncState
|
||||
select * from MesPODL_last
|
||||
select * from MesPODL_req
|
||||
|
||||
select * from MachineFluxLog
|
||||
select * from MachineProdData
|
||||
select * from MachineSignalLog
|
||||
|
||||
|
||||
-- test scrittura PODL: OK!
|
||||
exec dbo.SyncPodlToMachine
|
||||
|
||||
exec dbo.GetMachineSigLog
|
||||
select * from SyncState
|
||||
select * from MachineSignalLog
|
||||
|
||||
/*
|
||||
truncate table MachineFluxLog
|
||||
update SyncState
|
||||
set lastidx=0
|
||||
where TableName='ToMachineFluxLog'
|
||||
*/
|
||||
|
||||
select top 2 * from MachineFluxLog order by 1 desc
|
||||
select top 2 * from MachineProdData order by 1 desc
|
||||
select top 10 * from MachineSignalLog order by 1 desc
|
||||
select * from SyncState
|
||||
|
||||
exec dbo.GetMachineFluxLog
|
||||
select * from MachineFluxLog
|
||||
|
||||
select * from syn_ERP2M
|
||||
select * from syn_M2ERP_MACHINE_STATE
|
||||
select * from syn_M2ERP_PRODORDERS
|
||||
|
||||
|
||||
select top 10 * from syn_M2ERP_PRODORDERS
|
||||
where ProdOrder LIKE 'PODL000%'
|
||||
|
||||
|
||||
select top 10 * from syn_M2ERP_PRODORDERS
|
||||
where ProdOrder LIKE '%ODL%'
|
||||
order by 1 desc
|
||||
|
||||
EXEC GetMachineProdData
|
||||
SELECT * FROM SyncState
|
||||
SELECT * FROM MachineFluxLog
|
||||
SELECT * FROM MachineProdData
|
||||
SELECT * FROM MachineSignalLog
|
||||
|
||||
|
||||
/*
|
||||
truncate table MachineProdData
|
||||
update SyncState
|
||||
set lastidx=0
|
||||
where TableName='ToMachineProdData'
|
||||
*/
|
||||
|
||||
select * from ActType
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
drop table __MigrationHistory
|
||||
drop table ActList
|
||||
drop table ActType
|
||||
drop table MachineEventList
|
||||
drop table MachineFluxLog
|
||||
drop table MachinePODL
|
||||
drop table MesPODL_last
|
||||
drop table MesPODL_req
|
||||
drop table SyncState
|
||||
|
||||
drop PROCEDURE dbo.BackupDb
|
||||
drop PROCEDURE dbo.ExportAll
|
||||
drop PROCEDURE dbo.GetMachineEvList
|
||||
drop PROCEDURE dbo.GetMachineFluxLog
|
||||
drop PROCEDURE dbo.ImportAll
|
||||
drop PROCEDURE dbo.ResetPodlMes
|
||||
drop PROCEDURE dbo.SyncPodlToMachine
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
select * from ERP2M
|
||||
|
||||
select * from M2ERP_MACHINE_STATE where ActiveProdOrder = 'ODL0003743'
|
||||
select * from M2ERP_PRODORDERS
|
||||
|
||||
select * from M2ERP_PRODORDERS where ProdOrder = 'ODL0003743'
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
-- =============================================
|
||||
-- Author: S.E.L.
|
||||
-- Create date: 2023.03.17
|
||||
-- Description: Verifica ordini aperti - EXT schema/special
|
||||
-- =============================================
|
||||
CREATE PROCEDURE ext.stp_OrdState
|
||||
(
|
||||
@onlyOpen INT = 0 -- 1 = solo ordini rimasti aperti/validi
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
|
||||
|
||||
IF (@onlyOpen = 0)
|
||||
BEGIN
|
||||
;WITH cteOrd AS
|
||||
(
|
||||
SELECT ProdOrder, MAX(id) as lastID
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
GROUP BY ProdOrder
|
||||
)
|
||||
SELECT m2erp.*
|
||||
FROM syn_M2ERP_PRODORDERS m2erp
|
||||
INNER JOIN cteord cte ON m2erp.ID=cte.lastID
|
||||
ORDER BY 1 DESC
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
;WITH cteOrd AS
|
||||
(
|
||||
SELECT ProdOrder, MAX(id) as lastID
|
||||
FROM syn_M2ERP_PRODORDERS
|
||||
GROUP BY ProdOrder
|
||||
)
|
||||
SELECT m2erp.*
|
||||
FROM syn_M2ERP_PRODORDERS m2erp
|
||||
INNER JOIN cteord cte ON m2erp.ID=cte.lastID
|
||||
WHERE m2erp.ProdOrderState NOT IN (3,4)
|
||||
ORDER BY 1 DESC
|
||||
END
|
||||
|
||||
|
||||
|
||||
END
|
||||
GO
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.SqlDb.Test
|
||||
{
|
||||
public class TestSetup
|
||||
{
|
||||
public string app { get; set; } = "testApp";
|
||||
public string server { get; set; } = "";
|
||||
public string user { get; set; } = "";
|
||||
public string password { get; set; } = "";
|
||||
public string dbName { get; set; } = "MoonPro_IOB_ISF_PAMA";
|
||||
public List<singleStep> steps { get; set; }
|
||||
}
|
||||
|
||||
public class singleStep
|
||||
{
|
||||
public string id { get; set; } = "00";
|
||||
public string description { get; set; } = "00";
|
||||
public stepType action { get; set; } = stepType.None;
|
||||
|
||||
public List<string> paramList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public enum stepType
|
||||
{
|
||||
None,
|
||||
DbMigrateAndSync,
|
||||
ExecExportAll,
|
||||
ExecImportAll,
|
||||
GetMachSignLog,
|
||||
GetMachProdData,
|
||||
GetMachFluxLog,
|
||||
GetSyncState,
|
||||
ResetPodl,
|
||||
SetNewPodl,
|
||||
//procPodl
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"server": "308SERVER60\\LANTEK",
|
||||
"user": "steamware",
|
||||
"password": "viadante16",
|
||||
"steps": [
|
||||
{
|
||||
"id": "00",
|
||||
"description": "Db Migrate + SYNC",
|
||||
"action": "DbMigrateAndSync",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "01",
|
||||
"description": "Test SYNC",
|
||||
"action": "GetSyncState",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "02",
|
||||
"description": "Reset PODL MES",
|
||||
"action": "ResetPodl",
|
||||
"paramList": []
|
||||
},
|
||||
//{
|
||||
// "id": "03",
|
||||
// "description": "upload Test PODL",
|
||||
// "action": "SetNewPodl",
|
||||
// "paramList": [
|
||||
// "1001",
|
||||
// "1002",
|
||||
// "1003"
|
||||
// ]
|
||||
//}
|
||||
{
|
||||
"id": "03",
|
||||
"description": "Export All",
|
||||
"action": "ExecExportAll",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "04",
|
||||
"description": "Import All",
|
||||
"action": "ExecImportAll",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "05",
|
||||
"description": "Get SignLog",
|
||||
"action": "GetMachSignLog",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "06",
|
||||
"description": "Get ProdData",
|
||||
"action": "GetMachProdData",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "07",
|
||||
"description": "Get FluxLog",
|
||||
"action": "GetMachFluxLog",
|
||||
"paramList": []
|
||||
},
|
||||
{
|
||||
"id": "08",
|
||||
"description": "Test SYNC",
|
||||
"action": "GetSyncState",
|
||||
"paramList": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="7.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.AccessControl" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Permissions" version="7.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1,74 @@
|
||||
@echo off
|
||||
echo Effettua pulizia post build: configurazione %1. directory %2
|
||||
|
||||
RD /S /Q %2"\lib\da"
|
||||
RD /S /Q %2"\lib\de"
|
||||
RD /S /Q %2"\lib\es"
|
||||
RD /S /Q %2"\lib\fr"
|
||||
RD /S /Q %2"\lib\it"
|
||||
RD /S /Q %2"\lib\ja-JP"
|
||||
RD /S /Q %2"\lib\ko"
|
||||
RD /S /Q %2"\lib\nl"
|
||||
RD /S /Q %2"\lib\pl"
|
||||
RD /S /Q %2"\lib\pt"
|
||||
RD /S /Q %2"\lib\ru"
|
||||
RD /S /Q %2"\lib\sv"
|
||||
RD /S /Q %2"\lib\tr"
|
||||
RD /S /Q %2"\lib\zh"
|
||||
|
||||
MOVE /Y %2"da" %2"lib\"
|
||||
MOVE /Y %2"de" %2"lib\"
|
||||
MOVE /Y %2"es" %2"lib\"
|
||||
MOVE /Y %2"fr" %2"lib\"
|
||||
MOVE /Y %2"it" %2"lib\"
|
||||
MOVE /Y %2"ja-JP" %2"lib\"
|
||||
MOVE /Y %2"ko" %2"lib\"
|
||||
MOVE /Y %2"nl" %2"lib\"
|
||||
MOVE /Y %2"pl" %2"lib\"
|
||||
MOVE /Y %2"pt" %2"lib\"
|
||||
MOVE /Y %2"ru" %2"lib\"
|
||||
MOVE /Y %2"sv" %2"lib\"
|
||||
MOVE /Y %2"tr" %2"lib\"
|
||||
MOVE /Y %2"zh" %2"lib\"
|
||||
|
||||
|
||||
if %1 == "Release" goto Release
|
||||
if %1 == "Debug" goto Debug
|
||||
if %1 == "Remote_DEBUG" goto RemoteDebug
|
||||
|
||||
:Release
|
||||
REM INIZIO eliminando i files pdb
|
||||
del /S %2"*.pdb""
|
||||
del /S %2"lib/*.pdb""
|
||||
echo Release: eliminato pdb!!!
|
||||
goto END
|
||||
|
||||
:Debug
|
||||
echo Debug: nulla da eliminare
|
||||
|
||||
REM copia script verso server remoto
|
||||
REM ROBOCOPY . \\10.150.0.1\Steamware\SqlDbTest-DEB /MIR
|
||||
|
||||
goto END
|
||||
|
||||
|
||||
:RemoteDebug
|
||||
REM copia script verso server remoto
|
||||
REM echo Debug remoto: effettuo robocopy sync (verificare remote per cliente)
|
||||
|
||||
REM FINASSI
|
||||
REM ROBOCOPY . \\10.150.0.1\Steamware\SqlDbTest-DEB /MIR
|
||||
REM Baglietto
|
||||
REM ROBOCOPY . \\192.168.60.15\Steamware\SqlDbTest-DEB /MIR
|
||||
REM GIACOVELLI LOCOROTONDO
|
||||
REM ROBOCOPY . \\192.168.1.93\Steamware\SqlDbTest-DEB /MIR
|
||||
REM IMI Remosa
|
||||
ROBOCOPY . \\192.168.0.12\Steamware\SqlDbTest-DEB /MIR
|
||||
|
||||
REM IOB-WIN-SIM
|
||||
REM ROBOCOPY . \\IOB-WIN-SIMULA\Steamware\SqlDbTest-DEB /MIR
|
||||
|
||||
goto END
|
||||
|
||||
:END
|
||||
echo Fatto!
|
||||
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
echo Effettua setup dei file specifici per i vari ambienti pre build installer: verifica da nome configurazione %1
|
||||
|
||||
|
||||
if %1 == "Release" goto Release
|
||||
if %1 == "Debug" goto Debug
|
||||
if %1 == "Remote_DEBUG" goto RemoteDebug
|
||||
|
||||
:Release
|
||||
echo Release: nulla da copiare
|
||||
goto END
|
||||
|
||||
:Debug
|
||||
echo Debug: copia file ini x simulazione Debug
|
||||
REM del %2"DATA\CONF\EsaKvara.ini"
|
||||
REM copy %2"Resources\SCM\EsaKvara_SIM.ini" %2"DATA\CONF\EsaKvara.ini"
|
||||
goto END
|
||||
|
||||
|
||||
:RemoteDebug
|
||||
echo RemoteDebug: nulla da copiare
|
||||
goto END
|
||||
|
||||
:END
|
||||
echo Fatto!
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33424.131
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.SqlDb", "EgwProxy.SqlDb\EgwProxy.SqlDb.csproj", "{A5F9E2C8-B866-4470-923C-11BA35270963}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.SqlDb.Test", "EgwProxy.SqlDb.Test\EgwProxy.SqlDb.Test.csproj", "{A11CA446-AE97-413D-A567-45A081F003DB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Remote_DEBUG|Any CPU = Remote_DEBUG|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A5F9E2C8-B866-4470-923C-11BA35270963}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Remote_DEBUG|Any CPU.ActiveCfg = Remote_DEBUG|Any CPU
|
||||
{A11CA446-AE97-413D-A567-45A081F003DB}.Remote_DEBUG|Any CPU.Build.0 = Remote_DEBUG|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E2472E21-58D3-4EAD-BC4A-BC3915B18BEF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="SyncState" connectionString="data source=SQL2016DEV;initial catalog=MoonPro_IOB_ISF;persist security info=True;user id=sa;password=keyhammer16;MultipleActiveResultSets=True;App=EgwProxy.SqlDb" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -0,0 +1,316 @@
|
||||
using EgwProxy.SqlDb.DbModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace EgwProxy.SqlDb.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller accesso dati DB IOB_ISF
|
||||
/// </summary>
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Avvio dell'oggetto gestione DB con stringa di connessione specifica
|
||||
/// </summary>
|
||||
/// <param name="connSyncState">Connessione DB locale di SYNC</param>
|
||||
public DbController(string connSyncState)
|
||||
{
|
||||
connString = connSyncState;
|
||||
Log.Info("Avviata classe DbController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab di ActList corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ActListModel> ActListGetAll()
|
||||
{
|
||||
List<ActListModel> dbResult = new List<ActListModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetActions
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab di ActType corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ActTypeModel> ActTypeGetAll()
|
||||
{
|
||||
List<ActTypeModel> dbResult = new List<ActTypeModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetActListType
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool DbForceMigrate()
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbSyncStateCtx.DbForceMigrate();
|
||||
fatto = true;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose classe
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
connString = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab FluxLog x i record successivi all'ID già processato
|
||||
/// </summary>
|
||||
/// <param name="lastIdx"></param>
|
||||
/// <returns></returns>
|
||||
public List<MachFluxLogModel> MachFluxLogGetNew(long lastIdx)
|
||||
{
|
||||
List<MachFluxLogModel> dbResult = new List<MachFluxLogModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetMachFluxLog
|
||||
.Where(x => x.Id > lastIdx)
|
||||
.OrderBy(x => x.Id)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab PODL Macchina x i record successivi all'ID già processato
|
||||
/// </summary>
|
||||
/// <param name="lastIdx"></param>
|
||||
/// <returns></returns>
|
||||
public List<MachPODLModel> MachPOdlGetNew(long lastIdx)
|
||||
{
|
||||
List<MachPODLModel> dbResult = new List<MachPODLModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetMachPODL
|
||||
.Where(x => x.IdxPromessa > lastIdx)
|
||||
.OrderBy(x => x.IdxPromessa)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab ProdData x i record successivi all'ID già processato
|
||||
/// </summary>
|
||||
/// <param name="lastIdx"></param>
|
||||
/// <returns></returns>
|
||||
public List<MachProdDataModel> MachProdDataGetNew(long lastIdx)
|
||||
{
|
||||
List<MachProdDataModel> dbResult = new List<MachProdDataModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetMachProdData
|
||||
.Where(x => x.Id > lastIdx)
|
||||
.OrderBy(x => x.Id)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab EvList x i record successivi all'ID già processato
|
||||
/// </summary>
|
||||
/// <param name="lastIdx"></param>
|
||||
/// <returns></returns>
|
||||
public List<MachSigLogModel> MachSigLogGetNew(long lastIdx)
|
||||
{
|
||||
List<MachSigLogModel> dbResult = new List<MachSigLogModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetMachEvList
|
||||
.Where(x => x.Id > lastIdx)
|
||||
.OrderBy(x => x.Id)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scrive elenco PODL attivi al momento x processing successivo
|
||||
/// </summary>
|
||||
/// <param name="CurrPodlReq"></param>
|
||||
/// <returns></returns>
|
||||
public bool MesPodlWriteReq(List<MesPODLReqModel> CurrPodlReq)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
try
|
||||
{
|
||||
// in primis verifica SE sia vuota la tab req...
|
||||
var oldData = dbSyncStateCtx
|
||||
.DbSetMesPodlReq
|
||||
.ToList();
|
||||
// se vuota scrive i record e salva
|
||||
if (oldData.Count == 0)
|
||||
{
|
||||
// aggiungo i nuovi record
|
||||
var dbResult = dbSyncStateCtx
|
||||
.DbSetMesPodlReq
|
||||
.AddRange(CurrPodlReq);
|
||||
// salvo
|
||||
dbSyncStateCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
catch //(Exception exc)
|
||||
{ }
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue reset tabelle PODL MEs e restituisce elenco finale (vuoto)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<MesPODLReqModel> ResetPODLMes()
|
||||
{
|
||||
List<MesPODLReqModel> dbResult = new List<MesPODLReqModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<MesPODLReqModel>("EXEC dbo.stp_ResetPodlMes")
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public string ServerOk()
|
||||
{
|
||||
return SyncStateGetAll().Count() > 0 ? "OK" : "NA";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<SyncStateModel> SyncStateDoExportAll()
|
||||
{
|
||||
List<SyncStateModel> dbResult = new List<SyncStateModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<SyncStateModel>("EXEC dbo.stp_ExportAll")
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<SyncStateModel> SyncStateDoImportAll()
|
||||
{
|
||||
List<SyncStateModel> dbResult = new List<SyncStateModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<SyncStateModel>("EXEC dbo.stp_ImportAll")
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera la tab di SyncState corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<SyncStateModel> SyncStateGetAll()
|
||||
{
|
||||
List<SyncStateModel> dbResult = new List<SyncStateModel>();
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetSyncState
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna record SyncState corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool SyncStateUpsert(SyncStateModel newVal)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbSyncStateCtx = new SyncStateDbContext(connString))
|
||||
{
|
||||
// cerco record
|
||||
var dbResult = dbSyncStateCtx
|
||||
.DbSetSyncState
|
||||
.Where(x => x.TableName == newVal.TableName)
|
||||
.FirstOrDefault();
|
||||
// se trovato aggiorno
|
||||
if (dbResult != null)
|
||||
{
|
||||
dbResult.LastIdx = newVal.LastIdx;
|
||||
dbResult.Note = newVal.Note;
|
||||
dbResult.LastUpdate = newVal.LastUpdate;
|
||||
//dbSyncStateCtx.Entry(dbResult).State = System.Data.Entity.EntityState.Modified;
|
||||
}
|
||||
// altrimenti aggiungo
|
||||
else
|
||||
{
|
||||
dbSyncStateCtx.DbSetSyncState.Add(newVal);
|
||||
}
|
||||
|
||||
// salvo
|
||||
dbSyncStateCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static string connString = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.SqlDb.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("ActList")]
|
||||
public partial class ActListModel
|
||||
{
|
||||
[Key, Column("IdxAct"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; } = 0;
|
||||
|
||||
public DateTime DtRif { get; set; } = DateTime.Today;
|
||||
|
||||
[StringLength(50)]
|
||||
public string Source { get; set; } = "IN";
|
||||
|
||||
[StringLength(50)]
|
||||
public string Dest { get; set; } = "OUT";
|
||||
|
||||
[StringLength(250)]
|
||||
public string Action { get; set; } = "";
|
||||
|
||||
[StringLength(2500)]
|
||||
public string Value { get; set; } = "";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.SqlDb.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("ActType")]
|
||||
public partial class ActTypeModel
|
||||
{
|
||||
[Key, StringLength(250)]
|
||||
public string Action { get; set; } = "";
|
||||
|
||||
[StringLength(500)]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.SqlDb.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("MachineFluxLog")]
|
||||
public partial class MachFluxLogModel
|
||||
{
|
||||
[Key, Column("IdxFL"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; } = 0;
|
||||
|
||||
public DateTime DtEvento { get; set; } = DateTime.Now;
|
||||
|
||||
[StringLength(50)]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
|
||||
[StringLength(50)]
|
||||
public string CodFlux { get; set; } = "";
|
||||
|
||||
[StringLength(250)]
|
||||
public string Valore { get; set; } = "";
|
||||
|
||||
public int Cnt { get; set; } = 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.SqlDb.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("MachinePODL")]
|
||||
public partial class MachPODLModel
|
||||
{
|
||||
[Key]
|
||||
public int IdxRec { get; set; } = 0;
|
||||
|
||||
public int IdxPromessa { get; set; } = 0;
|
||||
|
||||
[StringLength(50)]
|
||||
public string KeyRichiesta { get; set; } = "";
|
||||
[StringLength(50)]
|
||||
public string KeyBCode { get; set; } = "";
|
||||
|
||||
public bool Attivabile { get; set; } = false;
|
||||
|
||||
public int IdxODL { get; set; } = 0;
|
||||
|
||||
[StringLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
|
||||
[StringLength(50)]
|
||||
public string CodGruppo { get; set; } = "";
|
||||
|
||||
[StringLength(50)]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
|
||||
public int NumPezzi { get; set; } = 0;
|
||||
|
||||
public decimal TCAssegnato { get; set; } = 0;
|
||||
|
||||
public DateTime DueDate { get; set; } = DateTime.Today;
|
||||
|
||||
public int Priorita { get; set; } = 0;
|
||||
public int PzPallet { get; set; } = 0;
|
||||
|
||||
[StringLength(2500)]
|
||||
public string Note { get; set; } = "";
|
||||
|
||||
[StringLength(50)]
|
||||
public string CodCli { get; set; } = "";
|
||||
|
||||
public DateTime InsertDate { get; set; } = DateTime.Today;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user