Compare commits
1042
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63aad1e696 | ||
|
|
19666c33bf | ||
|
|
b06a2c5b62 | ||
|
|
6a55b26372 | ||
|
|
2f3d7bf698 | ||
|
|
dbea4abafb | ||
|
|
57622931a5 | ||
|
|
75368c2fe0 | ||
|
|
5e071bd35a | ||
|
|
77639318c6 | ||
|
|
1a890b11cb | ||
|
|
795f21f04b | ||
|
|
c95e86c2a6 | ||
|
|
18d2aa3b51 | ||
|
|
7ba3ea8b13 | ||
|
|
30b34c3a50 | ||
|
|
6a42800d2c | ||
|
|
70f132540f | ||
|
|
cd9eaaaba1 | ||
|
|
70aa1f4024 | ||
|
|
1d634d96fe | ||
|
|
4eb5254d96 | ||
|
|
6c2eee0cbc | ||
|
|
3c5265cecf | ||
|
|
478d35890d | ||
|
|
1b9b63412c | ||
|
|
3bb8fff3a1 | ||
|
|
694bc0ead4 | ||
|
|
cfc324d31e | ||
|
|
43b63e2843 | ||
|
|
f2ec510a70 | ||
|
|
453edbb28e | ||
|
|
bc9407f52f | ||
|
|
954cc5918f | ||
|
|
4ef16e7856 | ||
|
|
1eb3c3e725 | ||
|
|
a89c2d3d22 | ||
|
|
914837a5a2 | ||
|
|
9643a71ba5 | ||
|
|
aa7e0528f8 | ||
|
|
57bd8d569e | ||
|
|
b49d8871a2 | ||
|
|
b90d419bc5 | ||
|
|
1f48d498e1 | ||
|
|
da6139c932 | ||
|
|
be744b40a3 | ||
|
|
780ce657ca | ||
|
|
464be0f803 | ||
|
|
58a6cb9a24 | ||
|
|
9bf7b2ffde | ||
|
|
cde1f28215 | ||
|
|
db198cb7d0 | ||
|
|
99fe567e78 | ||
|
|
2261c8f0f5 | ||
|
|
f93b16fc52 | ||
|
|
7c3a43749c | ||
|
|
ecec7b9f1a | ||
|
|
1aca7335f7 | ||
|
|
ba5aee6640 | ||
|
|
abaf55e9b1 | ||
|
|
3a2dd0b0aa | ||
|
|
0fed1acfd8 | ||
|
|
d7c2300021 | ||
|
|
fca333299d | ||
|
|
a13b03a136 | ||
|
|
48054f5bf1 | ||
|
|
51f2897a33 | ||
|
|
7a3a07b0da | ||
|
|
7c3cfca86c | ||
|
|
352af15984 | ||
|
|
2c42933d58 | ||
|
|
2e68362836 | ||
|
|
c6736db7ea | ||
|
|
c005f03af8 | ||
|
|
459aabcc86 | ||
|
|
ad33097d5e | ||
|
|
8d7735735e | ||
|
|
25bbc46925 | ||
|
|
5a26b0ee35 | ||
|
|
09a397bed2 | ||
|
|
a33039bcae | ||
|
|
0ebd125266 | ||
|
|
fd16a6b6c3 | ||
|
|
cf19f764c7 | ||
|
|
88850d6c25 | ||
|
|
b173c61575 | ||
|
|
3b866f0952 | ||
|
|
94db524a11 | ||
|
|
f27616ce1f | ||
|
|
7f75af7119 | ||
|
|
05ab48cdc5 | ||
|
|
38e42723af | ||
|
|
f4ec60c9e0 | ||
|
|
fd51c209a3 | ||
|
|
01394b1978 | ||
|
|
9b7db08fcf | ||
|
|
6d7cdef223 | ||
|
|
d9c35fe02a | ||
|
|
250b3fa406 | ||
|
|
a5a3f16177 | ||
|
|
ffa7e21c18 | ||
|
|
4608c05df0 | ||
|
|
56ff5a0213 | ||
|
|
014fde301c | ||
|
|
0080a42423 | ||
|
|
2035a4c855 | ||
|
|
4dc6a190fa | ||
|
|
e0db322262 | ||
|
|
8f1bb45e42 | ||
|
|
f39aefd28f | ||
|
|
2cfc43dbfd | ||
|
|
f4168b5202 | ||
|
|
2d93b652e8 | ||
|
|
70782cd655 | ||
|
|
768fcc4f05 | ||
|
|
727491f99b | ||
|
|
c5f1c3a340 | ||
|
|
a78311104a | ||
|
|
4b5b06210c | ||
|
|
333645b044 | ||
|
|
23173074aa | ||
|
|
be8bb9c4e1 | ||
|
|
d07e132216 | ||
|
|
401fa12851 | ||
|
|
194ca84d38 | ||
|
|
7bbf62d735 | ||
|
|
3924e2fca5 | ||
|
|
2e39102e7c | ||
|
|
2a0849fae5 | ||
|
|
9f4e8f6eef | ||
|
|
d0fe36f86e | ||
|
|
10da22cd77 | ||
|
|
6dacc2d515 | ||
|
|
7baa9628d6 | ||
|
|
ec5229101f | ||
|
|
a0e0b1e788 | ||
|
|
f1e04396de | ||
|
|
d0cae8c2fc | ||
|
|
90c215d4c1 | ||
|
|
1b1dc78548 | ||
|
|
a112163f85 | ||
|
|
2a9f2e188d | ||
|
|
652e0cb06f | ||
|
|
123b1b08c2 | ||
|
|
b321bc354b | ||
|
|
03d7397242 | ||
|
|
45e78ef184 | ||
|
|
fe7c5893bb | ||
|
|
2b57c552d1 | ||
|
|
7f0d39b684 | ||
|
|
7273a8b13b | ||
|
|
a544a5cd4f | ||
|
|
ff9ade75d4 | ||
|
|
cfd5498521 | ||
|
|
9b7c30e1cd | ||
|
|
670e5d7fa9 | ||
|
|
8258235611 | ||
|
|
4d97f29943 | ||
|
|
ab8d59eb2d | ||
|
|
c324fa69b2 | ||
|
|
1cdb9b4cc2 | ||
|
|
f47fa49b80 | ||
|
|
6ade96c7ef | ||
|
|
61d31a3c67 | ||
|
|
014509ea30 | ||
|
|
1ce1a45ca6 | ||
|
|
b6da13a653 | ||
|
|
604b4d1751 | ||
|
|
874aaf2857 | ||
|
|
17a28def4e | ||
|
|
e72a1aa9e7 | ||
|
|
7b96ef1b4c | ||
|
|
ea048e6d82 | ||
|
|
109abfb4ad | ||
|
|
3f662ab19d | ||
|
|
b0de38909a | ||
|
|
267de44103 | ||
|
|
b7b0e55d94 | ||
|
|
c0d12f5721 | ||
|
|
27a945485f | ||
|
|
d76c81a9d8 | ||
|
|
143a3622dd | ||
|
|
75992293c6 | ||
|
|
0e004828b3 | ||
|
|
714751f404 | ||
|
|
27576e946e | ||
|
|
e548dddcbd | ||
|
|
8cbc8c497e | ||
|
|
c328140441 | ||
|
|
a10798c983 | ||
|
|
06909e260f | ||
|
|
5eca8a5150 | ||
|
|
88a13f9864 | ||
|
|
e03ae6195a | ||
|
|
c3cacaf407 | ||
|
|
4b479b3ceb | ||
|
|
c78cb805fb | ||
|
|
d17688fc9d | ||
|
|
fd59b9d5f0 | ||
|
|
0e71c9f5f5 | ||
|
|
bc3c14589e | ||
|
|
4331f49f6f | ||
|
|
294d19e9d1 | ||
|
|
ed615dbb31 | ||
|
|
e9ad57f588 | ||
|
|
7fee639b53 | ||
|
|
c2a5a8ec7d | ||
|
|
ec823cab97 | ||
|
|
83f88b6df3 | ||
|
|
7636fe7686 | ||
|
|
1e12c82be4 | ||
|
|
9879a80569 | ||
|
|
13b03f4f89 | ||
|
|
331de6ecfe | ||
|
|
7b649c4a62 | ||
|
|
9ccdaef354 | ||
|
|
fa114f4467 | ||
|
|
33cc650871 | ||
|
|
95737d05e1 | ||
|
|
955ffc48d3 | ||
|
|
d79dd908f6 | ||
|
|
4656ec30af | ||
|
|
a0be60a1b9 | ||
|
|
d296d6f000 | ||
|
|
8df4bd2537 | ||
|
|
cc5cdb88ff | ||
|
|
f66c6a93c5 | ||
|
|
a7b5ee33e2 | ||
|
|
fe90af5aa4 | ||
|
|
7e672d91e9 | ||
|
|
09f472bee2 | ||
|
|
30da0c5105 | ||
|
|
d2082cdbea | ||
|
|
c42596811e | ||
|
|
d095a19187 | ||
|
|
8089e2c898 | ||
|
|
a657d03fb0 | ||
|
|
4e829200f5 | ||
|
|
bef9be5cbe | ||
|
|
56f14323d1 | ||
|
|
4fcd22ca68 | ||
|
|
21890e74fe | ||
|
|
ef32564fba | ||
|
|
d95505726f | ||
|
|
bb7b892f7c | ||
|
|
836cdaf087 | ||
|
|
6f5c41abb8 | ||
|
|
6379321785 | ||
|
|
e4c6e4393e | ||
|
|
3e6bb81e39 | ||
|
|
ded6f18dd5 | ||
|
|
81643e2aef | ||
|
|
8a186f9f0c | ||
|
|
14aa39976a | ||
|
|
c077e0ddc2 | ||
|
|
d198a7b63a | ||
|
|
7f36a33dea | ||
|
|
db3d9fc65f | ||
|
|
f9738451db | ||
|
|
ec73b5cbea | ||
|
|
f3bd6b6469 | ||
|
|
fd50993fb9 | ||
|
|
079381dbb0 | ||
|
|
85bdc35342 | ||
|
|
2aaaa55e42 | ||
|
|
e999bea228 | ||
|
|
287c06383b | ||
|
|
202409c140 | ||
|
|
34886beccb | ||
|
|
3d200cc34e | ||
|
|
b13883530a | ||
|
|
032e04bc50 | ||
|
|
625b715832 | ||
|
|
e1ac360271 | ||
|
|
7eda88bdbe | ||
|
|
90fdb94e95 | ||
|
|
15979203ce | ||
|
|
53360a03af | ||
|
|
9f6f7c23f6 | ||
|
|
7419f4e886 | ||
|
|
f90a80c366 | ||
|
|
d9ec756e22 | ||
|
|
9f7c24c540 | ||
|
|
fe2833395d | ||
|
|
a181cf3815 | ||
|
|
dfce44a47a | ||
|
|
22280bf1e3 | ||
|
|
30aedb6eec | ||
|
|
12f175740f | ||
|
|
5c0f11aea1 | ||
|
|
879518c4a9 | ||
|
|
7afca6a254 | ||
|
|
1c56aa2eb1 | ||
|
|
ecaf00c5b3 | ||
|
|
bfdc77da97 | ||
|
|
f38aa4595f | ||
|
|
aa0b906a9f | ||
|
|
9e64e5a60e | ||
|
|
35eb05432b | ||
|
|
77c6298067 | ||
|
|
f43d1e5f47 | ||
|
|
63a74e1aef | ||
|
|
69e45e9ae8 | ||
|
|
53cf35014c | ||
|
|
d6e4239573 | ||
|
|
c76808e11e | ||
|
|
b2428a4211 | ||
|
|
aa0e919713 | ||
|
|
7e2a41b6cb | ||
|
|
258b1d2d1f | ||
|
|
a4ea200e38 | ||
|
|
43a27c16a6 | ||
|
|
3c693baab0 | ||
|
|
d186e2702c | ||
|
|
aee478114b | ||
|
|
6220530855 | ||
|
|
69ae37021c | ||
|
|
e2382a403b | ||
|
|
0ae45eb918 | ||
|
|
d8882f8d0c | ||
|
|
00c64411c5 | ||
|
|
c0f35a7d84 | ||
|
|
12cf05bb87 | ||
|
|
325c17647e | ||
|
|
c6eeb2107a | ||
|
|
70fd037161 | ||
|
|
ed4469bd5f | ||
|
|
5ce168071c | ||
|
|
4273d72b9d | ||
|
|
30f56d1f9b | ||
|
|
d560468f3c | ||
|
|
ac5e49d0fc | ||
|
|
447d1f510c | ||
|
|
c0651e4e2c | ||
|
|
f8865206e9 | ||
|
|
5e7d2431b3 | ||
|
|
9bb13f6d88 | ||
|
|
52dbd8afec | ||
|
|
99216321a8 | ||
|
|
31a0f04710 | ||
|
|
ac88add40b | ||
|
|
5a2c0460aa | ||
|
|
862cf67375 | ||
|
|
dae850616d | ||
|
|
72c2bd90e4 | ||
|
|
d4ecf28147 | ||
|
|
149e114359 | ||
|
|
7d63e7e417 | ||
|
|
d12e5d19c9 | ||
|
|
7a6b3b7a86 | ||
|
|
97fc02b601 | ||
|
|
9485403712 | ||
|
|
caeead0bc0 | ||
|
|
f93204e37e | ||
|
|
e6af91c6ab | ||
|
|
c89428eed8 | ||
|
|
b4f2b89139 | ||
|
|
aab7cdcf77 | ||
|
|
47cdedefd4 | ||
|
|
710145a32d | ||
|
|
2783d2cc77 | ||
|
|
751794c1ec | ||
|
|
a7a5df1991 | ||
|
|
62a296f909 | ||
|
|
c561aad661 | ||
|
|
0a301e1a84 | ||
|
|
37e727202c | ||
|
|
9023cc76a0 | ||
|
|
49bdd03c1c | ||
|
|
23f4b672b2 | ||
|
|
599d45086f | ||
|
|
93aed0e06a | ||
|
|
7eb94d7575 | ||
|
|
fa8b0bd6a1 | ||
|
|
c26e271676 | ||
|
|
7d87477d68 | ||
|
|
9002fb3828 | ||
|
|
10257a832a | ||
|
|
261f5a526c | ||
|
|
b5e0c121e8 | ||
|
|
6d99c456e4 | ||
|
|
8c6f0c2736 | ||
|
|
bd89af5e8c | ||
|
|
b0e4128d3c | ||
|
|
875a8f101a | ||
|
|
c5a8ef57ac | ||
|
|
c8adeed187 | ||
|
|
49f5f506d4 | ||
|
|
1c87585570 | ||
|
|
30eb52da77 | ||
|
|
6f089482e6 | ||
|
|
8e221cc263 | ||
|
|
441917b670 | ||
|
|
6251de3b38 | ||
|
|
d731125a14 | ||
|
|
d6fe64bc40 | ||
|
|
f8b93807ae | ||
|
|
2287a111c1 | ||
|
|
a08d92ea41 | ||
|
|
c41d7981ba | ||
|
|
37f5336806 | ||
|
|
ebdc98dfa7 | ||
|
|
f3c8c860f5 | ||
|
|
f7b27142c4 | ||
|
|
4fc37c54c5 | ||
|
|
849e1e57dd | ||
|
|
c768ca5eba | ||
|
|
c9516d90e9 | ||
|
|
327aae687a | ||
|
|
3cbe4617eb | ||
|
|
de69fe6b6f | ||
|
|
e53101dacb | ||
|
|
d3ec749848 | ||
|
|
410b7d3dd6 | ||
|
|
e87b233713 | ||
|
|
ca38ecb1cf | ||
|
|
5dfa70dc10 | ||
|
|
ff3daff15a | ||
|
|
7b7f235354 | ||
|
|
779c6247cd | ||
|
|
fcaffa8c5f | ||
|
|
d2ffcc903a | ||
|
|
1d12c97e30 | ||
|
|
3bcaeb214e | ||
|
|
85995040a8 | ||
|
|
826d06b532 | ||
|
|
3328e35cf4 | ||
|
|
091c56ec34 | ||
|
|
31e9910242 | ||
|
|
f6e3c72e9c | ||
|
|
3f618bc970 | ||
|
|
1c766e568c | ||
|
|
8ed9bfbfcb | ||
|
|
f1d66fc446 | ||
|
|
50977b367f | ||
|
|
45312d0564 | ||
|
|
3261d63b19 | ||
|
|
2894899ad4 | ||
|
|
dd5c709709 | ||
|
|
618247f4d5 | ||
|
|
abcf035143 | ||
|
|
0b015233a9 | ||
|
|
44d85b842c | ||
|
|
470f4a770b | ||
|
|
808a1ba0ea | ||
|
|
04cef606fc | ||
|
|
1ef6a1d0e4 | ||
|
|
b163a3a7b9 | ||
|
|
e7f7f28ff1 | ||
|
|
b9c17fd360 | ||
|
|
c7534a985a | ||
|
|
52583a05f6 | ||
|
|
081373fc0d | ||
|
|
9130604fa6 | ||
|
|
37b4726925 | ||
|
|
cc66eb5329 | ||
|
|
563c133676 | ||
|
|
e8b32c4ed3 | ||
|
|
72ca259771 | ||
|
|
d175c4b564 | ||
|
|
fb2aeb8192 | ||
|
|
24c25ab26c | ||
|
|
9da91e460f | ||
|
|
2634cf7de9 | ||
|
|
7417091f3f | ||
|
|
f9aad50f46 | ||
|
|
535cd5af2e | ||
|
|
4a8e469736 | ||
|
|
7d89f711fe | ||
|
|
7555a0389b | ||
|
|
1ac6e4b1a0 | ||
|
|
d2fc4c6134 | ||
|
|
73cad308aa | ||
|
|
c9f4c33ba1 | ||
|
|
3f0bdc593c | ||
|
|
0da2d38bd8 | ||
|
|
3a6ce52ead | ||
|
|
eb0582ae69 | ||
|
|
3143d094e8 | ||
|
|
f265a23f97 | ||
|
|
dceeb410c6 | ||
|
|
30be08fe4d | ||
|
|
20247d0bc2 | ||
|
|
c0ac325911 | ||
|
|
c02ab116cd | ||
|
|
7ec4f2a61e | ||
|
|
16129ba742 | ||
|
|
61853fb71f | ||
|
|
58f13eb1dc | ||
|
|
b999f17445 | ||
|
|
c8047854f6 | ||
|
|
91ee23287a | ||
|
|
85b08b8c65 | ||
|
|
c81079a876 | ||
|
|
8abe57552c | ||
|
|
3bf24b838b | ||
|
|
e37928bf89 | ||
|
|
525173bc9f | ||
|
|
aa6dacf0c5 | ||
|
|
69cc71ab3b | ||
|
|
fe52d31168 | ||
|
|
3ea4307716 | ||
|
|
5650df1a9f | ||
|
|
8f154ebf48 | ||
|
|
47a4c62e92 | ||
|
|
539ad769d0 | ||
|
|
5fa90d9eab | ||
|
|
ba9d56811c | ||
|
|
8eb8a328d1 | ||
|
|
e8327316dd | ||
|
|
3bd7001106 | ||
|
|
2e5ad53c6a | ||
|
|
ca0ae279e0 | ||
|
|
adf1120436 | ||
|
|
7879391de0 | ||
|
|
11ba9ea418 | ||
|
|
0fe84ca17c | ||
|
|
1009ca5111 | ||
|
|
2c973fb0be | ||
|
|
dba1f4e71c | ||
|
|
46fe124fe1 | ||
|
|
50688d7d8a | ||
|
|
a7396e3c4a | ||
|
|
41e969f79e | ||
|
|
7b3f78f745 | ||
|
|
14bc171246 | ||
|
|
a584c0751e | ||
|
|
3d7528e069 | ||
|
|
58cc75ef71 | ||
|
|
b5a9462e95 | ||
|
|
1bc421ac6d | ||
|
|
ad0d091b49 | ||
|
|
22de686a44 | ||
|
|
3e7eb09758 | ||
|
|
e2a276085b | ||
|
|
d561c579e0 | ||
|
|
371d117746 | ||
|
|
28c681a562 | ||
|
|
2131efb522 | ||
|
|
6e20774edf | ||
|
|
a7c7744ff3 | ||
|
|
019aefbc61 | ||
|
|
81a23305ba | ||
|
|
4001abff02 | ||
|
|
25bfbeb8d6 | ||
|
|
44025c3978 | ||
|
|
a3aa9747b8 | ||
|
|
009243b091 | ||
|
|
e31e0b6680 | ||
|
|
449bb2522b | ||
|
|
453dce9520 | ||
|
|
655592186b | ||
|
|
1ebf67233b | ||
|
|
1588dabcbe | ||
|
|
09d3995e6c | ||
|
|
db20385a6d | ||
|
|
d701935ddf | ||
|
|
d3888e3c32 | ||
|
|
94f0795247 | ||
|
|
4def73d738 | ||
|
|
99445406fc | ||
|
|
8c32d18aec | ||
|
|
20c31153de | ||
|
|
025fa57e24 | ||
|
|
6f04d0bf07 | ||
|
|
ecb9a805e5 | ||
|
|
0577acad93 | ||
|
|
d7f83fa4d4 | ||
|
|
4c4f4d52d2 | ||
|
|
0bf9025c0d | ||
|
|
7a0f56cad8 | ||
|
|
2784b57a05 | ||
|
|
b9fc9748c7 | ||
|
|
c98299d916 | ||
|
|
f6e25fd966 | ||
|
|
557b9429bf | ||
|
|
139f7bbd0a | ||
|
|
ec25f6426a | ||
|
|
00283b4f28 | ||
|
|
e08b5cde69 | ||
|
|
ec8e4c36a4 | ||
|
|
07c7718320 | ||
|
|
2953e977ef | ||
|
|
92522b1229 | ||
|
|
9ef9dcd7b9 | ||
|
|
5fd8096ef0 | ||
|
|
5f59543a14 | ||
|
|
d44593d6d4 | ||
|
|
38744ff8e8 | ||
|
|
83e935a3f4 | ||
|
|
4d96e73866 | ||
|
|
a55ce75e2e | ||
|
|
c45dbf1dac | ||
|
|
2d08629608 | ||
|
|
49bc67a64f | ||
|
|
abec4d9281 | ||
|
|
149bc601e2 | ||
|
|
66deede936 | ||
|
|
0df5511bf7 | ||
|
|
2e68218cfe | ||
|
|
80f3568dbd | ||
|
|
5fd0ff9e71 | ||
|
|
4dcfa05157 | ||
|
|
42648f31a5 | ||
|
|
e0b628dce9 | ||
|
|
6e9c7e28e6 | ||
|
|
ac091a7d26 | ||
|
|
8f31532917 | ||
|
|
612e7955cf | ||
|
|
ce92031ff7 | ||
|
|
5a7e63871d | ||
|
|
7ade7f6e24 | ||
|
|
e470ef0553 | ||
|
|
fb01a4f8df | ||
|
|
eacdca8669 | ||
|
|
df97a6dd01 | ||
|
|
0259d4ff1d | ||
|
|
f71e9938bb | ||
|
|
69f8e3f4fc | ||
|
|
f49c888307 | ||
|
|
04a2da4371 | ||
|
|
59372b23e4 | ||
|
|
2970c0d7d4 | ||
|
|
392f1b09b2 | ||
|
|
79f66e9641 | ||
|
|
e90fceca86 | ||
|
|
24d5cee8b4 | ||
|
|
31f608a9ec | ||
|
|
1ba4c4f343 | ||
|
|
700d9656b2 | ||
|
|
0c17d9abc2 | ||
|
|
2c1476b74c | ||
|
|
0fa71727ac | ||
|
|
20cacf26ae | ||
|
|
1d406b0c7e | ||
|
|
a099d27b86 | ||
|
|
3e53ec9191 | ||
|
|
637cbd9954 | ||
|
|
717251ca5e | ||
|
|
5d3bb41275 | ||
|
|
e5211fee00 | ||
|
|
41cb078a94 | ||
|
|
0a5e4076e1 | ||
|
|
c3534e21fa | ||
|
|
e9e934cfb1 | ||
|
|
a417ddda85 | ||
|
|
06159c6b68 | ||
|
|
22c14d169b | ||
|
|
f273a8839a | ||
|
|
db09db3cd0 | ||
|
|
ba8a8b8673 | ||
|
|
62ae81c7b3 | ||
|
|
6db9567eb9 | ||
|
|
8ef08c53b3 | ||
|
|
6f354bfeee | ||
|
|
818d764b3d | ||
|
|
9fdbdb05f4 | ||
|
|
d392131005 | ||
|
|
389b9e382b | ||
|
|
6fd84e2f2a | ||
|
|
689ea71846 | ||
|
|
66295594e9 | ||
|
|
042b80b9f4 | ||
|
|
c4da241516 | ||
|
|
74ccbfa760 | ||
|
|
46d8838d0e | ||
|
|
94d2c32025 | ||
|
|
64124cc0f7 | ||
|
|
24c5bc5097 | ||
|
|
1ffde5de50 | ||
|
|
3828da2f8f | ||
|
|
1554d3cc33 | ||
|
|
d808b306b6 | ||
|
|
45aeb808fa | ||
|
|
74f9fc0c18 | ||
|
|
c2c90a2c2e | ||
|
|
05ab077dda | ||
|
|
1ae422c74e | ||
|
|
5da62c3a5d | ||
|
|
86a98118fb | ||
|
|
6a51208a13 | ||
|
|
0749f5e724 | ||
|
|
f65644f553 | ||
|
|
dc74da6e86 | ||
|
|
301c4c2c97 | ||
|
|
8ec820a7f7 | ||
|
|
18734e0f85 | ||
|
|
9980504c47 | ||
|
|
626960da9f | ||
|
|
535728b982 | ||
|
|
ace9672a2e | ||
|
|
05a13861ac | ||
|
|
24374b85c1 | ||
|
|
8c358f1e3c | ||
|
|
289285f517 | ||
|
|
3ee9e0f4eb | ||
|
|
d6c924a51f | ||
|
|
3a739c5b64 | ||
|
|
3564f4ba8e | ||
|
|
5ad9d81cc1 | ||
|
|
0292634374 | ||
|
|
d4418b8d8a | ||
|
|
a33f136e77 | ||
|
|
f85f8e9e2c | ||
|
|
01541c9e0d | ||
|
|
4bfffc945a | ||
|
|
16509c2eab | ||
|
|
bc1f85b657 | ||
|
|
6b0a5d60f4 | ||
|
|
33439b63a0 | ||
|
|
bb24d1207d | ||
|
|
8fc477ec04 | ||
|
|
bf06c9e14f | ||
|
|
5a263107da | ||
|
|
d30bb2e329 | ||
|
|
8248bd8e47 | ||
|
|
378653c536 | ||
|
|
f2d330bd0e | ||
|
|
c1c93cbdc4 | ||
|
|
47a14e143e | ||
|
|
b7aa85f4fc | ||
|
|
90e25f3fcf | ||
|
|
d67e81d8a6 | ||
|
|
057915baaa | ||
|
|
fe268b6122 | ||
|
|
ca61597863 | ||
|
|
a04def360d | ||
|
|
5e43a8501b | ||
|
|
e893264075 | ||
|
|
cf20704811 | ||
|
|
37c5b23a86 | ||
|
|
82d8fe6e17 | ||
|
|
4ca3697845 | ||
|
|
71130bd26b | ||
|
|
37626d8f45 | ||
|
|
f95369d3a4 | ||
|
|
aa00891f8e | ||
|
|
d44f9ba2b6 | ||
|
|
c3b7b1e5a4 | ||
|
|
f3309e4a40 | ||
|
|
8fa059c186 | ||
|
|
96e61aea2b | ||
|
|
565779c9c8 | ||
|
|
b4ccd682c3 | ||
|
|
dba1331556 | ||
|
|
8803ae2274 | ||
|
|
69d09b7fc2 | ||
|
|
8ddfc8654e | ||
|
|
7a3243e882 | ||
|
|
4fc3b89e06 | ||
|
|
a17419ac12 | ||
|
|
88905132e7 | ||
|
|
111bed58d6 | ||
|
|
bed61324d6 | ||
|
|
1a889352b8 | ||
|
|
5bba126a36 | ||
|
|
e01b955d46 | ||
|
|
e3431b0e1e | ||
|
|
b6d646b910 | ||
|
|
bb679a2790 | ||
|
|
e3af0a6426 | ||
|
|
b2108b9e5f | ||
|
|
d100002107 | ||
|
|
afd61303c5 | ||
|
|
d1c3e81a38 | ||
|
|
46419edfee | ||
|
|
81c91d7866 | ||
|
|
34ee092919 | ||
|
|
d07344a88a | ||
|
|
66ae1c632b | ||
|
|
7cc7b71edd | ||
|
|
a223dfd463 | ||
|
|
61e8bc5ffa | ||
|
|
bba52a736a | ||
|
|
c5d575a019 | ||
|
|
08f8441aca | ||
|
|
6bf116cbef | ||
|
|
cc96b3fa5b | ||
|
|
b489452bd1 | ||
|
|
fa4e3997e4 | ||
|
|
7659cbbee6 | ||
|
|
548b845f62 | ||
|
|
4f733656a0 | ||
|
|
f4ef244a10 | ||
|
|
839000d48c | ||
|
|
bcb8f419ee | ||
|
|
059c399240 | ||
|
|
13b3cd6bc4 | ||
|
|
3cd4f4c5d9 | ||
|
|
02b20df652 | ||
|
|
416bdf16e0 | ||
|
|
75a4f66714 | ||
|
|
a5b9c26a97 | ||
|
|
0aa476d9dd | ||
|
|
0f4eec1df6 | ||
|
|
4bc73f847c | ||
|
|
e1271c16d9 | ||
|
|
c7d2140e16 | ||
|
|
ac6ee6ff83 | ||
|
|
1507cf31ce | ||
|
|
aad04647ac | ||
|
|
934d3977d8 | ||
|
|
03b0e52bef | ||
|
|
1da2b8e87c | ||
|
|
e3d16142ac | ||
|
|
b972e40a28 | ||
|
|
c508255ab3 | ||
|
|
e9ec884eb9 | ||
|
|
592d28e898 | ||
|
|
b826fa6a20 | ||
|
|
74c2a303da | ||
|
|
dcf50073e7 | ||
|
|
375871012c | ||
|
|
b7b67cce69 | ||
|
|
6c22bff1fd | ||
|
|
0b12805d4a | ||
|
|
4bac1a4628 | ||
|
|
2cf164c445 | ||
|
|
11904e177b | ||
|
|
527e6b5053 | ||
|
|
053ebca267 | ||
|
|
5e7fae9d47 | ||
|
|
0e4ce99612 | ||
|
|
3c75637752 | ||
|
|
fb890ded1f | ||
|
|
4399f31a83 | ||
|
|
ca4b21e593 | ||
|
|
23a4edb610 | ||
|
|
accc1c622c | ||
|
|
e50ea6a5db | ||
|
|
04ce6f55db | ||
|
|
f0493e60d8 | ||
|
|
13edc9c9ff | ||
|
|
fd0ea4404b | ||
|
|
df9d0f908a | ||
|
|
779394ffd6 | ||
|
|
a230ecef9b | ||
|
|
061bcfdc0f | ||
|
|
aced10498b | ||
|
|
cd963d01e4 | ||
|
|
458dd5fff4 | ||
|
|
0c342fa188 | ||
|
|
43b13443ab | ||
|
|
c867d4e4b1 | ||
|
|
0f541142cc | ||
|
|
b0c55d09b0 | ||
|
|
ee71431210 | ||
|
|
a8196db676 | ||
|
|
8dc78d49eb | ||
|
|
3999d1c49b | ||
|
|
aceb928dba | ||
|
|
f17db695d3 | ||
|
|
214dd8ec08 | ||
|
|
2f974d7b52 | ||
|
|
9f1dce896f | ||
|
|
a8294bb01a | ||
|
|
28e4bdda29 | ||
|
|
7d408df904 | ||
|
|
caec6adf8d | ||
|
|
a38c0dbe33 | ||
|
|
d779d4ad50 | ||
|
|
9b71ce0fee | ||
|
|
8b18005b8e | ||
|
|
a550ef1b50 | ||
|
|
63a60b32cc | ||
|
|
ca4dc8d330 | ||
|
|
0a52aa5c53 | ||
|
|
591fc03ca2 | ||
|
|
ebd7b1249f | ||
|
|
1b6eeaf4ad | ||
|
|
1d3dac0e51 | ||
|
|
48da58b681 | ||
|
|
68639eadf0 | ||
|
|
dc77984c10 | ||
|
|
5b4e1cd694 | ||
|
|
3fbd974fa9 | ||
|
|
b457496297 | ||
|
|
dd83491169 | ||
|
|
a73a8fb993 | ||
|
|
fb7a99653d | ||
|
|
297d75a2b3 | ||
|
|
47c5bb159a | ||
|
|
610b2d178c | ||
|
|
bb45e551a3 | ||
|
|
77cf6177dc | ||
|
|
a830856df2 | ||
|
|
efe215f4d0 | ||
|
|
5e2e2f841c | ||
|
|
9da436ab2d | ||
|
|
5333b96c88 | ||
|
|
6561a11661 | ||
|
|
1c9334a52b | ||
|
|
2e00693a33 | ||
|
|
8617ce4562 | ||
|
|
78416ef452 | ||
|
|
9ad50af4dd | ||
|
|
a6f3d62a01 | ||
|
|
a25b5fc6b8 | ||
|
|
9e26e94e97 | ||
|
|
a571cb5f15 | ||
|
|
2e00c94d34 | ||
|
|
f1506b9aee | ||
|
|
2805471301 | ||
|
|
89f55e091f | ||
|
|
da6c47d0ff | ||
|
|
63cac73de3 | ||
|
|
c8ed5b0565 | ||
|
|
c6342fea49 | ||
|
|
7a3748f7e0 | ||
|
|
516b479c0c | ||
|
|
a43e059733 | ||
|
|
0ac79f4e46 | ||
|
|
c06744b3bb | ||
|
|
218a2c17a2 | ||
|
|
a629f6834b | ||
|
|
bf5337cf63 | ||
|
|
7713f0cd63 | ||
|
|
2711520666 | ||
|
|
4a6c0ba447 | ||
|
|
3f3281e2f4 | ||
|
|
0eadd3fe33 | ||
|
|
4bf42be80a | ||
|
|
d7f829737a | ||
|
|
25cc62c7c6 | ||
|
|
47596c7bca | ||
|
|
7129853902 | ||
|
|
f08466f702 | ||
|
|
4248d40917 | ||
|
|
7cf28366f4 | ||
|
|
037c82e22e | ||
|
|
6de13b12f9 | ||
|
|
cf69aa93e6 | ||
|
|
4b915b78b6 | ||
|
|
a891a62ffa | ||
|
|
7a768484a1 | ||
|
|
5f7af3309d | ||
|
|
1f3a1dabbc | ||
|
|
4b61495960 | ||
|
|
d091a37171 | ||
|
|
189b78d7d3 | ||
|
|
8ee7a31b97 | ||
|
|
055be66421 | ||
|
|
86a3e56a27 | ||
|
|
0db98e4182 | ||
|
|
3102596a3d | ||
|
|
41aa195785 | ||
|
|
954186265e | ||
|
|
33cced07c6 | ||
|
|
afbf6f360d | ||
|
|
df2be585a1 | ||
|
|
c81f527cb8 | ||
|
|
0f67382c27 | ||
|
|
b42b8ddfa3 | ||
|
|
f3efd409c6 | ||
|
|
9011b134d6 | ||
|
|
7c33bad362 | ||
|
|
e49a4d674f | ||
|
|
7872f192ed | ||
|
|
870bba0aa6 | ||
|
|
35c7b2b0cf | ||
|
|
9e6c8acca4 | ||
|
|
099bbdd328 | ||
|
|
720c5db2d0 | ||
|
|
659833c5bf | ||
|
|
5ea9bcdd8b | ||
|
|
3ec7c11797 | ||
|
|
7f899175d1 | ||
|
|
112edd1c8a | ||
|
|
819c1bbec4 | ||
|
|
6b6968561b | ||
|
|
24fbb69e25 | ||
|
|
79751732a3 | ||
|
|
e6e62ed2c8 | ||
|
|
8f2cbf4081 | ||
|
|
c25f501909 | ||
|
|
bf72a6bf78 | ||
|
|
a1380dbb8a | ||
|
|
501798a8cb | ||
|
|
a240bc2c19 | ||
|
|
a804a3866a | ||
|
|
069ffb80e9 | ||
|
|
5255080291 | ||
|
|
ae35d9f0d7 | ||
|
|
afbd653611 | ||
|
|
9a55111e1e | ||
|
|
422a3053b7 | ||
|
|
feb74ee09f | ||
|
|
7cebb2b7f1 | ||
|
|
8097c6283c | ||
|
|
8f08ef5ee4 | ||
|
|
fd26f16776 | ||
|
|
21a83df99d | ||
|
|
616acf0e37 | ||
|
|
3cff87cf97 | ||
|
|
9202d903a5 | ||
|
|
a9a9a56c09 | ||
|
|
aee7819a9c | ||
|
|
d3bc1c4725 | ||
|
|
d0474b22f9 | ||
|
|
5bd1f94be0 | ||
|
|
629fe1b615 | ||
|
|
c92b888ec2 | ||
|
|
5df42daa71 | ||
|
|
9349396d9a | ||
|
|
38425a05f9 | ||
|
|
9d1b99b08e | ||
|
|
4f7a762bf1 | ||
|
|
11cb2e0efd | ||
|
|
78f58bea19 | ||
|
|
a2e830d0c3 | ||
|
|
2ffab17caf | ||
|
|
49aba5c67b | ||
|
|
1b24177b68 | ||
|
|
bf7a967633 | ||
|
|
f5669e50a8 | ||
|
|
2ae0d0d454 | ||
|
|
241785846e | ||
|
|
0d6fd6950c | ||
|
|
bb99d6444c | ||
|
|
db4f114caf | ||
|
|
80d83da9c9 | ||
|
|
54e02e6263 | ||
|
|
c4af911f15 | ||
|
|
f9690ee772 | ||
|
|
623c6a7941 | ||
|
|
7a5129208c | ||
|
|
e15c56f1e2 | ||
|
|
5d808e436a | ||
|
|
20e40a5c49 | ||
|
|
885dae812d | ||
|
|
35bd91f7e8 | ||
|
|
305f2768bb | ||
|
|
5f733161c6 | ||
|
|
4fc13acd1a | ||
|
|
365f6a23c8 | ||
|
|
331d5751c3 | ||
|
|
dfb965edbc | ||
|
|
c7cc69fd73 | ||
|
|
d187aa885d | ||
|
|
b1b4535d9b | ||
|
|
b085a727f0 | ||
|
|
e548e1da63 |
+2
-1
@@ -401,4 +401,5 @@ FodyWeavers.xsd
|
||||
|
||||
/fmtall
|
||||
/genmacall
|
||||
*AssemblyInfo.cs
|
||||
*AssemblyInfo.cs
|
||||
/PROMS/Baseline/Baseline.sln
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
@@ -44,6 +44,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -53,13 +54,14 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdjustBuildRevision", "AdjustBuildRevision.csproj", "{D1AB675E-828D-4781-BACD-8A2324CD84A5}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SourceCodeControl) = preSolution
|
||||
SccNumberOfProjects = 2
|
||||
SccProjectUniqueName0 = AdjustBuildRevision.csproj
|
||||
SccLocalPath0 = .
|
||||
SccLocalPath1 = .
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|x86.Build.0 = Debug|x86
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|x86.ActiveCfg = Release|x86
|
||||
{D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -32,9 +32,9 @@ namespace AdjustBuildRevision
|
||||
{
|
||||
// Allow for setting build revision on either proms or the roeditor:
|
||||
if (Directory.GetCurrentDirectory().ToUpper().Contains("REFOBJ"))
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.3.yyMM.dHH") + "\")");
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.4.yyMM.dHH") + "\")");
|
||||
else
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.2.yyMM.dHH") + "\")");
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.3.yyMM.dHH") + "\")");
|
||||
// if (outline != line)
|
||||
// {
|
||||
// Console.WriteLine("Before: '{0}'", line);
|
||||
|
||||
Binary file not shown.
@@ -22,7 +22,7 @@
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -30,15 +30,17 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
+118
-40
@@ -456,7 +456,7 @@ namespace Baseline
|
||||
switch (myLast)
|
||||
{
|
||||
case LastWas.Pagination:
|
||||
line = OpenPDF(line);
|
||||
OpenPDF(line);
|
||||
break;
|
||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||
OpenOnePDF(myLine,1);
|
||||
@@ -479,7 +479,7 @@ namespace Baseline
|
||||
switch (myLast)
|
||||
{
|
||||
case LastWas.Pagination:
|
||||
line = OpenPDF(line);
|
||||
OpenPDF(line);
|
||||
break;
|
||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||
OpenOnePDF(myLine,2);
|
||||
@@ -491,34 +491,99 @@ namespace Baseline
|
||||
break;
|
||||
}
|
||||
}
|
||||
string exePath;
|
||||
private string OpenPDF(string line)
|
||||
|
||||
/// <summary>
|
||||
/// This will return the full path to the PDF file
|
||||
/// </summary>
|
||||
/// <param name="fi"></param>
|
||||
/// <param name="patern"></param>
|
||||
/// <returns></returns>
|
||||
private string GetPFDFileAndPath(FileInfo fi, string patern)
|
||||
{
|
||||
int page = int.Parse(line.Substring(0, 6));
|
||||
string[] fileList = Directory.GetFiles(fi.DirectoryName, patern);
|
||||
// sort the list of file list
|
||||
Array.Sort((string[])fileList);
|
||||
return fileList.FirstOrDefault(); // the PDF file that we what should be top of the list then.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This will parse out the procedure number for the PROMS ShortPath representation of a procedure section or step part
|
||||
/// In the PROMS ShortPath, ".S" is used to delimit the procedure number, section then uses "..S" for the step parts
|
||||
/// This method was written to handle cases where ".S" is used as part of the procedure number
|
||||
/// </summary>
|
||||
/// <param name="txt"></param>
|
||||
/// <returns></returns>
|
||||
private string ParseOutProcedureNumberFromLine(string txt)
|
||||
{
|
||||
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
|
||||
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
|
||||
// 1.SBGEN.SC. ==> short path of attachment section "C"
|
||||
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
|
||||
string rtnstr = null;
|
||||
int lidx = -1;
|
||||
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
|
||||
// so look for the last occurence of ".." which will be the end of the section information
|
||||
lidx = txt.LastIndexOf("..");
|
||||
if (lidx > 0)
|
||||
{
|
||||
lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number
|
||||
}
|
||||
else
|
||||
{
|
||||
lidx = txt.LastIndexOf(".S"); // this will position us to the end of the procedure number if there was no step information
|
||||
}
|
||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||
line = line.Substring(8, line.IndexOf(".S") - 8).Replace("/", "_").Replace("\\", "_");
|
||||
rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
|
||||
return rtnstr;
|
||||
}
|
||||
|
||||
string exePath;
|
||||
private void OpenPDF(string line)
|
||||
{
|
||||
int pageNum = int.Parse(line.Substring(0, 6));
|
||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||
string ProcNum = ParseOutProcedureNumberFromLine(line);
|
||||
string procPatern = string.Format("*{0}*.pdf", string.IsNullOrEmpty(line) ? "noProcNumber" : ProcNum);
|
||||
|
||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||
FileInfo fi1 = new FileInfo(ff.File1);
|
||||
FileInfo fi2 = new FileInfo(ff.File2);
|
||||
string PDFfileName1 = GetPFDFileAndPath(fi1,procPatern);
|
||||
string PDFfileName2 = GetPFDFileAndPath(fi2,procPatern);
|
||||
if (string.IsNullOrEmpty(PDFfileName1) || string.IsNullOrEmpty(PDFfileName2)) return;
|
||||
|
||||
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
|
||||
if (exePath == null)
|
||||
{
|
||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf");
|
||||
exePath = TryToGetPath(p);
|
||||
p.Kill(); // No need to keep it open
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
|
||||
exePath = TryToGetPath(p);
|
||||
p.Kill(); // No need to keep it open
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.DoEvents();
|
||||
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
Console.WriteLine(msg);
|
||||
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Open the first PDF on a Specific Page
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi1.DirectoryName + "\\" + line + ".pdf ");
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum,PDFfileName1));
|
||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||
// Move the PDF Reader window to 0,0
|
||||
MoveProcess(p1, 0, 0);
|
||||
// Open the first PDF on a Specific Page
|
||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi2.DirectoryName + "\\" + line + ".pdf ");
|
||||
|
||||
// Open the second PDF on a Specific Page
|
||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum, PDFfileName2));
|
||||
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
|
||||
// Move the PDF Reader window to 960,0
|
||||
// TODO: This Offset could be a Setting
|
||||
MoveProcess(p2, 960, 0);
|
||||
return line;
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Try to get the location of the PDF Reader executable
|
||||
@@ -530,7 +595,7 @@ namespace Baseline
|
||||
p.WaitForInputIdle();
|
||||
while (p.MainModule == null)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", p.MainWindowTitle,p.ProcessName);
|
||||
Console.WriteLine("{0} - {1}", p.MainWindowTitle, p.ProcessName);
|
||||
p.WaitForInputIdle();
|
||||
Application.DoEvents();
|
||||
}
|
||||
@@ -594,40 +659,52 @@ namespace Baseline
|
||||
/// <param name="list"></param>
|
||||
private void OpenOnePDF(Line myLine, int list)
|
||||
{
|
||||
if (myLine == null) return; // no PDF to open
|
||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
|
||||
|
||||
// if no procedure number, PROMS creates pdf filename "NoProcNumber.pdf"
|
||||
// create pattern to use to get the PDF from the directory
|
||||
// add wildcards (*) to file the file if any prefix or suffix was added to the filename
|
||||
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
|
||||
int pagenum = myLine.MyPage.Number;
|
||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||
FileInfo fi1 = new FileInfo(ff.File1);
|
||||
FileInfo fi2 = new FileInfo(ff.File2);
|
||||
if (exePath == null)
|
||||
{
|
||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf");
|
||||
while (exePath == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
exePath = p.MainModule.FileName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.DoEvents();
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
p.Kill();
|
||||
}
|
||||
string PDFfileName = null;
|
||||
if (list == 1)
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf ");
|
||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||
FileInfo fi1 = new FileInfo(ff.File1);
|
||||
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
|
||||
}
|
||||
else
|
||||
else // list == 2
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf ");
|
||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2);
|
||||
FileInfo fi2 = new FileInfo(ff.File2);
|
||||
PDFfileName = GetPFDFileAndPath(fi2, procPatern);
|
||||
}
|
||||
if (string.IsNullOrEmpty(PDFfileName)) return; // no PDF to open
|
||||
|
||||
// if exePath is null, then open the found PDF with the default PDF viewer and
|
||||
// capture/save the entire name and path of the default PDF viewer
|
||||
if (exePath == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
|
||||
exePath = TryToGetPath(tp);
|
||||
tp.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.DoEvents();
|
||||
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
Console.WriteLine(msg);
|
||||
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// open the PDF and jump to the page number
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName));
|
||||
psi1.UseShellExecute = false;
|
||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||
}
|
||||
/// <summary>
|
||||
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
||||
@@ -709,11 +786,12 @@ namespace Baseline
|
||||
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Initialize Results List Box
|
||||
lbResults1.Items.Clear();
|
||||
Procedure myProc = lbProcedures.SelectedItem as Procedure;
|
||||
if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures
|
||||
//TODO: May need to consider if there are duplicate procedure numers and titles
|
||||
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
||||
// Build the results ListBox for the left window
|
||||
lbResults1.Items.Clear();
|
||||
if (myProc1 != null)
|
||||
{
|
||||
foreach (Page myPage in myProc1.MyPages)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ClassLibrary1
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" 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>{EEA3D698-C9BC-4A38-9D5F-B89CBC68B739}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ClassLibrary1</RootNamespace>
|
||||
<AssemblyName>ClassLibrary1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</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="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.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,36 +0,0 @@
|
||||
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("ClassLibrary1")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Windows User")]
|
||||
[assembly: AssemblyProduct("ClassLibrary1")]
|
||||
[assembly: AssemblyCopyright("Copyright © Windows User 2016")]
|
||||
[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("1223b3df-00ea-4978-8df2-cb49ac67e751")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,77 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsoframer", "dsoframer.vcproj", "{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleCSharp", "..\SampleCSharp\SampleCSharp.csproj", "{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestC1DockingTab", "..\TestC1DockingTab\TestC1DockingTab.csproj", "{D066A5C4-72B8-45F8-A117-B967019F41AE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarDockable", "..\DotNetBarDockable\DotNetBarDockable.csproj", "{96DC8B48-A4E2-4826-A182-BE112B628B50}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarControl", "..\DotNetBarControl\DotNetBarControl.csproj", "{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.Build.0 = Release|Win32
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,77 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsoframer", "dsoframer.vcproj", "{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleCSharp", "..\SampleCSharp\SampleCSharp.csproj", "{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestC1DockingTab", "..\TestC1DockingTab\TestC1DockingTab.csproj", "{D066A5C4-72B8-45F8-A117-B967019F41AE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarDockable", "..\DotNetBarDockable\DotNetBarDockable.csproj", "{96DC8B48-A4E2-4826-A182-BE112B628B50}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarControl", "..\DotNetBarControl\DotNetBarControl.csproj", "{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.Build.0 = Release|Win32
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,178 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="DataLoader.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<log4net>
|
||||
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
|
||||
<param name="File" value="${USERPROFILE}/My Documents/VEPROMS/DMErrorLog.txt" />
|
||||
<param name="AppendToFile" value="false" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="Header" value="[Header]\r\n" />
|
||||
<param name="Footer" value="[Footer]\r\n" />
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="--> %date [%thread] %-5level %logger (%property{log4net:HostName}) [%ndc] - %message%newline"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
|
||||
<threshold value="WARN" />
|
||||
<mapping>
|
||||
<level value="DEBUG" />
|
||||
<eventLogEntryType value="Information" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="INFO" />
|
||||
<eventLogEntryType value="Information" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="WARN" />
|
||||
<eventLogEntryType value="Warning" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="ERROR" />
|
||||
<eventLogEntryType value="Error" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="FATAL" />
|
||||
<eventLogEntryType value="Error" />
|
||||
</mapping>
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="---> %d [%t] %-5p %c - %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="INFO" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
<appender-ref ref="LogFileAppender" />
|
||||
<appender-ref ref="EventLogAppender" />
|
||||
</root>
|
||||
<logger name="Volian.CSLA.Library">
|
||||
<level value="WARN" />
|
||||
</logger>
|
||||
</log4net>
|
||||
<appSettings>
|
||||
<add key="OperatingMode" value="debug" />
|
||||
<add key="CslaAuthentication" value="Windows" />
|
||||
<!-- Active Connection -->
|
||||
<!-- Inactive Connections
|
||||
-->
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<!--<add name="VEPROMS_RHM_CHANGE"
|
||||
connectionString="Data Source=rhmdesktop\SQLEXPRESS;AttachDbFilename="C:\VS2005Projects\VEPROMS_USERS\VEPROMS_Users.mdf";Integrated Security=True;User Instance=True"
|
||||
providerName="System.Data.SqlClient" />-->
|
||||
<add name="VEPROMS"
|
||||
connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=VEPROMS;Integrated Security=True"
|
||||
providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<userSettings>
|
||||
<DataLoader.Properties.Settings>
|
||||
<setting name="VeSamFilename" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="DbfPathname" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="LoadWordDoc" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="LoadRTFDoc" serializeAs="String">
|
||||
<value>Unchecked</value>
|
||||
</setting>
|
||||
<setting name="PurgeData" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="VePromsFilename" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="LogFileLoc" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="BackupFileName" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="BackupFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="ConnectionString" serializeAs="String">
|
||||
<value>Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True</value>
|
||||
</setting>
|
||||
<setting name="DBName" serializeAs="String">
|
||||
<value>VEPROMS</value>
|
||||
</setting>
|
||||
<setting name="DBPath" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="PDFFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="CheckRTF" serializeAs="String">
|
||||
<value>Unchecked</value>
|
||||
</setting>
|
||||
<setting name="Skip" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="ConvertTo" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="RedPDFs" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="OnlyThisSet" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="ExecutionMode" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Phase1" serializeAs="String">
|
||||
<value>Phase1</value>
|
||||
</setting>
|
||||
<setting name="Phase2" serializeAs="String">
|
||||
<value>Phase2</value>
|
||||
</setting>
|
||||
<setting name="Phase3" serializeAs="String">
|
||||
<value>Phase3</value>
|
||||
</setting>
|
||||
<setting name="FormatFolder" serializeAs="String">
|
||||
<value>c:\development\fmtall</value>
|
||||
</setting>
|
||||
<setting name="GenMacFolder" serializeAs="String">
|
||||
<value>c:\development\genmacall</value>
|
||||
</setting>
|
||||
<setting name="LoadApproved" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="Phase4" serializeAs="String">
|
||||
<value>Phase4</value>
|
||||
</setting>
|
||||
<setting name="ProcessOnlyInLocation" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="WhatROsToConvert" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="SelectedROFst" serializeAs="String">
|
||||
<value>-1</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenConvertingToText" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenShowingMissingRO" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenShowingDifferentRO" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="HowMany" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
</DataLoader.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -1,177 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="DataLoader.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<log4net>
|
||||
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
|
||||
<param name="File" value="${USERPROFILE}/My Documents/VEPROMS/DMErrorLog.txt" />
|
||||
<param name="AppendToFile" value="false" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="Header" value="[Header]\r\n" />
|
||||
<param name="Footer" value="[Footer]\r\n" />
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="--> %date [%thread] %-5level %logger (%property{log4net:HostName}) [%ndc] - %message%newline"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
|
||||
<threshold value="WARN" />
|
||||
<mapping>
|
||||
<level value="DEBUG" />
|
||||
<eventLogEntryType value="Information" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="INFO" />
|
||||
<eventLogEntryType value="Information" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="WARN" />
|
||||
<eventLogEntryType value="Warning" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="ERROR" />
|
||||
<eventLogEntryType value="Error" />
|
||||
</mapping>
|
||||
<mapping>
|
||||
<level value="FATAL" />
|
||||
<eventLogEntryType value="Error" />
|
||||
</mapping>
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="---> %d [%t] %-5p %c - %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="INFO" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
<appender-ref ref="LogFileAppender" />
|
||||
<appender-ref ref="EventLogAppender" />
|
||||
</root>
|
||||
<logger name="Volian.CSLA.Library">
|
||||
<level value="WARN" />
|
||||
</logger>
|
||||
</log4net>
|
||||
<appSettings>
|
||||
<add key="OperatingMode" value="debug" />
|
||||
<add key="CslaAuthentication" value="Windows" />
|
||||
<!-- Active Connection -->
|
||||
<!-- Inactive Connections
|
||||
-->
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<!--<add name="VEPROMS_RHM_CHANGE"
|
||||
connectionString="Data Source=rhmdesktop\SQLEXPRESS;AttachDbFilename="C:\VS2005Projects\VEPROMS_USERS\VEPROMS_Users.mdf";Integrated Security=True;User Instance=True"
|
||||
providerName="System.Data.SqlClient" />-->
|
||||
<!--<add name="VEPROMS"
|
||||
connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=VEPROMS;Integrated Security=True"
|
||||
providerName="System.Data.SqlClient" /> -->
|
||||
<add name="VEPROMS" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog={MENU};Integrated Security=True" providerName="System.Data.SqlClient" />
|
||||
|
||||
</connectionStrings>
|
||||
<userSettings>
|
||||
<DataLoader.Properties.Settings>
|
||||
<setting name="VeSamFilename" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="DbfPathname" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="LoadWordDoc" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="LoadRTFDoc" serializeAs="String">
|
||||
<value>Unchecked</value>
|
||||
</setting>
|
||||
<setting name="PurgeData" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="VePromsFilename" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="LogFileLoc" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="BackupFileName" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="BackupFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="ConnectionString" serializeAs="String">
|
||||
<value>Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True</value>
|
||||
</setting>
|
||||
<setting name="DBName" serializeAs="String">
|
||||
<value>VEPROMS</value>
|
||||
</setting>
|
||||
<setting name="DBPath" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="PDFFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="CheckRTF" serializeAs="String">
|
||||
<value>Unchecked</value>
|
||||
</setting>
|
||||
<setting name="Skip" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="ConvertTo" serializeAs="String">
|
||||
<value>1</value>
|
||||
</setting>
|
||||
<setting name="RedPDFs" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="OnlyThisSet" serializeAs="String">
|
||||
<value>Checked</value>
|
||||
</setting>
|
||||
<setting name="ExecutionMode" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="Phase1" serializeAs="String">
|
||||
<value>Phase1</value>
|
||||
</setting>
|
||||
<setting name="Phase2" serializeAs="String">
|
||||
<value>Phase2</value>
|
||||
</setting>
|
||||
<setting name="Phase3" serializeAs="String">
|
||||
<value>Phase3</value>
|
||||
</setting>
|
||||
<setting name="FormatFolder" serializeAs="String">
|
||||
<value>c:\development\fmtall</value>
|
||||
</setting>
|
||||
<setting name="GenMacFolder" serializeAs="String">
|
||||
<value>c:\development\genmacall</value>
|
||||
</setting>
|
||||
<setting name="LoadApproved" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="Phase4" serializeAs="String">
|
||||
<value>Phase4</value>
|
||||
</setting>
|
||||
<setting name="ProcessOnlyInLocation" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="WhatROsToConvert" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="SelectedROFst" serializeAs="String">
|
||||
<value>-1</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenConvertingToText" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenShowingMissingRO" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="AnnotateWhenShowingDifferentRO" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</DataLoader.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public Dictionary<string, string> MyProcAPL;
|
||||
private static Dictionary<string, string> GetApple(string proc)
|
||||
{
|
||||
Dictionary<string, string> procAPL = new Dictionary<string, string>();
|
||||
FileInfo myFile = new FileInfo(proc);
|
||||
FileStream fs = myFile.OpenRead();
|
||||
BinaryReader br = new BinaryReader(fs);
|
||||
byte[] myBuff = new byte[myFile.Length];
|
||||
br.Read(myBuff, 0, (int)myFile.Length);
|
||||
br.Close();
|
||||
fs.Close();
|
||||
int offset = 0;
|
||||
while (offset < myBuff.Length)
|
||||
{
|
||||
string recnum = Encoding.Default.GetString(myBuff, offset, 8);
|
||||
int applicability = BitConverter.ToInt32(myBuff, offset + 8);
|
||||
string applicabilityToStr = string.Format("{0:X8}", applicability);
|
||||
//4294967296
|
||||
if (!procAPL.ContainsKey(recnum))
|
||||
procAPL.Add(recnum, applicabilityToStr);
|
||||
else
|
||||
if (procAPL[recnum] != applicabilityToStr)
|
||||
procAPL[recnum] = applicabilityToStr;
|
||||
offset += 12;
|
||||
}
|
||||
return procAPL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public Dictionary<string, string> MyProcAPL;
|
||||
private static Dictionary<string, string> GetApple(string proc)
|
||||
{
|
||||
Dictionary<string, string> procAPL = new Dictionary<string, string>();
|
||||
FileInfo myFile = new FileInfo(proc);
|
||||
FileStream fs = myFile.OpenRead();
|
||||
BinaryReader br = new BinaryReader(fs);
|
||||
byte[] myBuff = new byte[myFile.Length];
|
||||
br.Read(myBuff, 0, (int)myFile.Length);
|
||||
br.Close();
|
||||
fs.Close();
|
||||
int offset = 0;
|
||||
while (offset < myBuff.Length)
|
||||
{
|
||||
string recnum = Encoding.Default.GetString(myBuff, offset, 8);
|
||||
//if ((myFile.Name.ToUpper() == "PROC000.APL" && (recnum == "00002491")))
|
||||
// System.Threading.Thread.Sleep(1000);
|
||||
int applicability = BitConverter.ToInt32(myBuff, offset + 8);
|
||||
string applicabilityToStr = string.Format("{0:X8}", applicability);
|
||||
//4294967296
|
||||
if (!procAPL.ContainsKey(recnum))
|
||||
procAPL.Add(recnum, applicabilityToStr);
|
||||
else
|
||||
if (procAPL[recnum] != applicabilityToStr)
|
||||
procAPL[recnum] = applicabilityToStr;
|
||||
offset += 12;
|
||||
}
|
||||
return procAPL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,516 +0,0 @@
|
||||
//using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.IO;
|
||||
using System.Data.OleDb;
|
||||
using System.Data;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public bool BuildApprovedRevision()
|
||||
{
|
||||
if(!frmMain.RunScript("PROMSApproveApprove.sql", frmMain.DBName)) return false;
|
||||
bool rv = false;
|
||||
using (Stage myStage = GetApprovedStage())
|
||||
{
|
||||
if (myStage == null)
|
||||
return rv;
|
||||
DocVersionInfoList dvil = DocVersionInfoList.Get();
|
||||
foreach (DocVersionInfo dvi in dvil)
|
||||
{
|
||||
if (dvi.Procedures.Count > 0)
|
||||
{
|
||||
if (!frmMain.MySettings.OnlyThisSet || frmMain.ProcedureSetPath.ToUpper() == dvi.MyFolder.Title.ToUpper())
|
||||
{
|
||||
string approvedFolder = dvi.MyFolder.Title + @"\APPROVED";
|
||||
//B2012-094 fix
|
||||
if (!Directory.Exists(approvedFolder)) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved folder does not exist";
|
||||
else if (!File.Exists(approvedFolder + @"\SET.DBF")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Set.dbf does not exist";
|
||||
else if (!File.Exists(approvedFolder + @"\USAGERO.DBF")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved UsageRO.dbf does not exist";
|
||||
else if (!Directory.Exists(approvedFolder + @"\PDFS")) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not exist";
|
||||
else if (Directory.GetFiles(approvedFolder + @"\PDFS","*.PDF").Length == 0) frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not contain any pdf files";
|
||||
else rv |= BuildApprovedRevision(myStage, approvedFolder, dvi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private static Stage GetApprovedStage()
|
||||
{
|
||||
StageInfoList sil = StageInfoList.Get();
|
||||
foreach (StageInfo si in sil)
|
||||
{
|
||||
if (si.Name.ToUpper() == "APPROVED")
|
||||
return si.Get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private bool BuildApprovedRevision(Stage myStage, string approvedFolder, DocVersionInfo dvi)
|
||||
{
|
||||
bool rv = false;
|
||||
if (dvi.MultiUnitCount <= 1)
|
||||
{
|
||||
ApprovedFolder af = new ApprovedFolder(approvedFolder);
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
rv |= BuildApprovedRevision(myStage, af, pi, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ApprovedFolder af = new ApprovedFolder(approvedFolder, dvi);
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
for (int i = 1; i <= dvi.MultiUnitCount; i++)
|
||||
rv |= BuildApprovedRevision(myStage, af, pi, i);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private bool BuildApprovedRevision(Stage myStage, ApprovedFolder af, ProcedureInfo pi, int selectedSlave)
|
||||
{
|
||||
bool rv = false;
|
||||
if (selectedSlave > 0)
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave;
|
||||
frmMain.MyInfo = string.Format("Loading approved data for Procedure: {0}", pi.DisplayNumber);
|
||||
// if working draft procedure does not exist in approved folder, don't bother processing
|
||||
if (!af.EntryFromProc.ContainsKey(pi.DisplayNumber)) return rv;
|
||||
using (Revision revision = CreateRevision(af, pi))
|
||||
{
|
||||
System.DateTime dts = pi.DTS;
|
||||
string userID = af.EntryFromProc[pi.DisplayNumber].UserID;
|
||||
using (Version version = Version.MakeVersion(revision, myStage, GetPDF(af,pi), GetSummaryPDF(), dts, userID))
|
||||
{
|
||||
using (Check check = Check.MakeCheck(revision, myStage, af.BuildConsistencyChecks(pi)))
|
||||
{
|
||||
rv |= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!rv)
|
||||
frmMain.MyInfo = string.Format("Loading Procedure: {0} FAILED MISERABLY", pi.DisplayNumber);
|
||||
return rv;
|
||||
}
|
||||
private byte[] GetSummaryPDF()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
private byte[] GetPDF(ApprovedFolder af, ProcedureInfo pi)
|
||||
{
|
||||
string pdf = string.Format(@"{0}\PDFS\{1}.pdf", af.Path, pi.DisplayNumber);
|
||||
FileInfo pdfFile = new FileInfo(pdf);
|
||||
if (pdfFile.Exists)
|
||||
{
|
||||
FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
byte[] pdfBuf = new byte[pdfFile.Length];
|
||||
fs.Read(pdfBuf, 0, pdfBuf.Length);
|
||||
fs.Close();
|
||||
return pdfBuf;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private Revision CreateRevision(ApprovedFolder af, ProcedureInfo pi)
|
||||
{
|
||||
int typeID = 1; //revision not tempmod
|
||||
ProcInfo pinf = af.EntryFromProc[pi.DisplayNumber];
|
||||
string revisionNumber = pinf.Rev;
|
||||
System.DateTime revisionDate = System.DateTime.Parse(pinf.RevDate ?? "1/1/1980");
|
||||
string notes = "Migration Of Current Approved Revision";
|
||||
RevisionConfig cfg = new RevisionConfig();
|
||||
cfg.History_StartDate = pinf.StartDateTime;
|
||||
if (pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
|
||||
cfg.Applicability_Index = pi.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||
string config = cfg.ToString();
|
||||
System.DateTime dts = pi.DTS;
|
||||
string userID = pinf.UserID;
|
||||
return Revision.MakeRevision(pi.ItemID, typeID, revisionNumber, revisionDate, notes, config, dts, userID);
|
||||
}
|
||||
}
|
||||
public partial class ApprovedFolder
|
||||
{
|
||||
private OleDbConnection _Connection;
|
||||
public OleDbConnection Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_Connection == null)
|
||||
_Connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _Path + ";Extended Properties=dBase III;Persist Security Info=False");
|
||||
return _Connection;
|
||||
}
|
||||
}
|
||||
private string _Path;
|
||||
public string Path
|
||||
{
|
||||
get { return _Path; }
|
||||
set { _Path = value; }
|
||||
}
|
||||
private System.DateTime _ROFstDate = System.DateTime.MinValue;
|
||||
public System.DateTime ROFstDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ROFstDate == System.DateTime.MinValue)
|
||||
{
|
||||
FileInfo fi = new FileInfo(string.Format(@"{0}\ro.fst",Path));
|
||||
if(fi.Exists)
|
||||
_ROFstDate = fi.LastWriteTimeUtc;
|
||||
}
|
||||
return _ROFstDate;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _ROValues = new Dictionary<string, string>();
|
||||
private Dictionary<string, System.DateTime> _LibDocDates = new Dictionary<string,System.DateTime>();
|
||||
private Dictionary<string, List<string>> _ProcROs = new Dictionary<string,List<string>>();
|
||||
private Dictionary<string, List<string>> _LibROs = new Dictionary<string,List<string>>();
|
||||
private Dictionary<string, List<string>> _LibDocs = new Dictionary<string,List<string>>();
|
||||
|
||||
public string BuildConsistencyChecks(ProcedureInfo proc)
|
||||
{
|
||||
/*
|
||||
<ConsistencyChecks ItemID="1">
|
||||
<ROChecks ROFstDate="2011-04-11T14:13:44">
|
||||
<ROCheck ROID="0001000003960000" ROValue="1430 PSIG" />
|
||||
</ROChecks>
|
||||
<LibDocChecks>
|
||||
<LibDocCheck DocID="1" DocDate="2011-12-06T11:12:40.633" />
|
||||
</LibDocChecks>
|
||||
</ConsistencyChecks>
|
||||
*/
|
||||
ConsistencyChecks cc = new ConsistencyChecks();
|
||||
cc.ItemID = proc.ItemID;
|
||||
BuildROChecks(cc, proc);
|
||||
BuildLibDocChecks(cc, proc);
|
||||
return cc.ToString().Replace("OldDocDate=\"0001-01-01T00:00:00\"", "");
|
||||
}
|
||||
|
||||
private void BuildLibDocChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
||||
{
|
||||
if (_LibDocs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string libdoc in _LibDocs[proc.DisplayNumber])
|
||||
{
|
||||
FileInfo fi = new FileInfo(string.Format(@"{0}\RTFFILES\{1}.LIB",Path,libdoc));
|
||||
if (fi.Exists)
|
||||
{
|
||||
//if (proc.MyDocVersion.VersionID > 1)
|
||||
// System.Threading.Thread.Sleep(5000);
|
||||
int docid = GetDocID(libdoc, proc.MyDocVersion.VersionID);
|
||||
if (docid > 0)
|
||||
cc.LibDocConsistency.AddLibDocCheck(docid, fi.LastWriteTimeUtc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int GetDocID(string libdoc, int versionid)
|
||||
{
|
||||
DocumentInfo di = DocumentInfo.GetByLibDocName(libdoc, versionid);
|
||||
return di.DocID;
|
||||
}
|
||||
|
||||
private void BuildROChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
||||
{
|
||||
cc.ROConsistency.ROFstDate = ROFstDate;
|
||||
if (_ProcROs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string roid in _ProcROs[proc.DisplayNumber])
|
||||
cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
|
||||
}
|
||||
//int cnt = cc.ROConsistency.MyROChecks.Length;
|
||||
if (_LibDocs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string libdoc in _LibDocs[proc.DisplayNumber])
|
||||
{
|
||||
if (_LibROs.ContainsKey(libdoc))
|
||||
{
|
||||
foreach (string roid in _LibROs[libdoc])
|
||||
cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetROValue(string roid)
|
||||
{
|
||||
if (!_ROValues.ContainsKey(roid))
|
||||
{
|
||||
//if (roid.Contains("000128"))
|
||||
// System.Console.WriteLine();
|
||||
//string ss = _Lookup.GetRoValue(roid);
|
||||
//ss = ItemInfo.ConvertToDisplayText(ss);
|
||||
//ss = ss.Replace('\n', ';');
|
||||
|
||||
_ROValues.Add(roid, PrepareForXML(ItemInfo.ConvertToDisplayText(_Lookup.GetRoValue(roid))));
|
||||
}
|
||||
return _ROValues[roid];
|
||||
}
|
||||
|
||||
private string PrepareForXML(string rovalue)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (char c in rovalue)
|
||||
{
|
||||
if (c < ' ')
|
||||
sb.Append(string.Format(@"\x{0:X4}", (int)c));
|
||||
else
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
private string FormatROID(string roid)
|
||||
{
|
||||
if (roid.Length == 16 && roid.EndsWith("0000"))
|
||||
return roid.Substring(0, 12).ToUpper();
|
||||
return roid.ToUpper();
|
||||
}
|
||||
|
||||
private Dictionary<string, ProcInfo> _EntryFromProc;
|
||||
public Dictionary<string, ProcInfo> EntryFromProc
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_EntryFromProc == null)
|
||||
_EntryFromProc = FillEntryFromProc();
|
||||
return _EntryFromProc;
|
||||
}
|
||||
}
|
||||
private Dictionary<string, ProcInfo> FillEntryFromProc()
|
||||
{
|
||||
Dictionary<string, ProcInfo> rv = new Dictionary<string, ProcInfo>();
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
if (!rv.ContainsKey(dr["NUMBER"].ToString()))
|
||||
rv.Add(dr["NUMBER"].ToString(), new ProcInfo(dr, Path));
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private ROFSTLookup _Lookup;
|
||||
public ApprovedFolder(string path)
|
||||
{
|
||||
_Path = path;
|
||||
FillROs();
|
||||
FillLibDocs();
|
||||
_Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
|
||||
}
|
||||
public ApprovedFolder(string path, DocVersionInfo dvi)
|
||||
{
|
||||
_Path = path;
|
||||
FillROs();
|
||||
FillLibDocs();
|
||||
_Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
|
||||
_EntryFromProc = FillEntryFromProcMulti(dvi);
|
||||
}
|
||||
|
||||
private Dictionary<string, ProcInfo> FillEntryFromProcMulti(DocVersionInfo dvi)
|
||||
{
|
||||
Dictionary<string, ProcInfo> rv = new Dictionary<string, ProcInfo>();
|
||||
for (int i = 1; i <= dvi.MultiUnitCount; i++)
|
||||
{
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = i;
|
||||
rv.Add(pi.DisplayNumber, new ProcInfo(pi, Path));
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private void FillLibDocs()
|
||||
{
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct FROMNUMBER, TONUMBER from [tran] where tonumber like 'DOC%'", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
string number = dr["FROMNUMBER"].ToString();
|
||||
string libdoc = dr["TONUMBER"].ToString();
|
||||
if (!_LibDocs.ContainsKey(number))
|
||||
_LibDocs.Add(number, new List<string>());
|
||||
if (!_LibDocs[number].Contains(libdoc))
|
||||
_LibDocs[number].Add(libdoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FillROs()
|
||||
{
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct NUMBER, ROID from [usagero]", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
string number = dr["NUMBER"].ToString();
|
||||
string roid = dr["ROID"].ToString();
|
||||
if (number.StartsWith("DOC"))
|
||||
{
|
||||
if (!_LibROs.ContainsKey(number))
|
||||
_LibROs.Add(number, new List<string>());
|
||||
if (!_LibROs[number].Contains(roid))
|
||||
_LibROs[number].Add(roid);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_ProcROs.ContainsKey(number))
|
||||
_ProcROs.Add(number, new List<string>());
|
||||
if (!_ProcROs[number].Contains(roid))
|
||||
_ProcROs[number].Add(roid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public partial class ProcInfo
|
||||
{
|
||||
private log4net.ILog log;
|
||||
private string _Number;
|
||||
public string Number
|
||||
{
|
||||
get { return _Number; }
|
||||
set { _Number = value; }
|
||||
}
|
||||
private string _Entry;
|
||||
public string Entry
|
||||
{
|
||||
get { return _Entry; }
|
||||
set { _Entry = value; }
|
||||
}
|
||||
private string _UserID;
|
||||
public string UserID
|
||||
{
|
||||
get { return _UserID; }
|
||||
set { _UserID = value; }
|
||||
}
|
||||
private System.DateTime _StartDateTime;
|
||||
public System.DateTime StartDateTime
|
||||
{
|
||||
get { return _StartDateTime; }
|
||||
set { _StartDateTime = value; }
|
||||
}
|
||||
private string _Rev;
|
||||
public string Rev
|
||||
{
|
||||
get { return _Rev; }
|
||||
set { _Rev = value; }
|
||||
}
|
||||
private string _RevDate;
|
||||
public string RevDate
|
||||
{
|
||||
get { return _RevDate; }
|
||||
set { _RevDate = value; }
|
||||
}
|
||||
private string _ReviewDate;
|
||||
public string ReviewDate
|
||||
{
|
||||
get { return _ReviewDate; }
|
||||
set { _ReviewDate = value; }
|
||||
}
|
||||
public ProcInfo(ProcedureInfo pi, string afpath)
|
||||
{
|
||||
Number = pi.DisplayNumber;
|
||||
Entry = pi.DisplayText;
|
||||
UserID = pi.UserID;
|
||||
StartDateTime = pi.DTS;
|
||||
RevDate = pi.ProcedureConfig.Print_RevDate;
|
||||
Rev = pi.ProcedureConfig.Print_Rev;
|
||||
}
|
||||
public ProcInfo(DataRow dr, string afpath)
|
||||
{
|
||||
Number = dr["NUMBER"].ToString();
|
||||
Entry = dr["ENTRY"].ToString();
|
||||
UserID = dr["INITIALS"].ToString();
|
||||
if (UserID == string.Empty) UserID = "UNKNOWN";
|
||||
//string date = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString()).ToString("MM/dd/yyyy HH:MM");//System.DateTime.Parse(dr["DATE"].ToString()).ToString("MM/dd/yyyy");
|
||||
//string time = dr["TIME"].ToString();
|
||||
//if (time.EndsWith(":"))
|
||||
// date += " " + time.Substring(0, 2) + ":" + time.Substring(2, 2);
|
||||
//else
|
||||
// date += " " + time.Substring(0, 2) + ":" + time.Substring(3, 2);
|
||||
//StartDateTime = System.DateTime.Parse(date);
|
||||
StartDateTime = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString());
|
||||
RevDate = StartDateTime.ToString("MM/dd/yyyy");
|
||||
FixItems fis = new FixItems(new FileInfo(string.Format(@"{0}\{1}.fix", afpath, Entry)));
|
||||
if (fis.Count > 0)
|
||||
{
|
||||
Rev = fis[0].Rev;
|
||||
RevDate = fis[0].RevDate ?? GetDBFRevDate(afpath);
|
||||
ReviewDate = fis[0].ReviewDate;
|
||||
}
|
||||
}
|
||||
public System.DateTime GetDTS(string date, string time)
|
||||
{
|
||||
// Set the date/time stamp. If there is no 'date', set the date
|
||||
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
||||
// set the time to 0:0:0 (midnight).
|
||||
|
||||
System.DateTime dts = System.DateTime.Now;
|
||||
string month = "01";
|
||||
string day = "01";
|
||||
string year = "2000";
|
||||
string hour = "";
|
||||
string minute = "";
|
||||
try
|
||||
{
|
||||
if (date != null && date != "")
|
||||
{
|
||||
int indx1 = date.IndexOf("/");
|
||||
month = date.Substring(0, indx1);
|
||||
int indx2 = date.IndexOf("/", indx1 + 1);
|
||||
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
||||
year = date.Substring(indx2 + 1, 4);
|
||||
}
|
||||
if (time == null || time == "")
|
||||
{
|
||||
hour = "0";
|
||||
minute = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
hour = time.Substring(0, 2);
|
||||
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
||||
if (indxc == time.Length - 1)
|
||||
minute = time.Substring(2, 2);
|
||||
else
|
||||
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
||||
}
|
||||
dts = new System.DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
||||
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Bad Date/Time {0} {1}. Set to NOW.", date, time);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
//frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
return dts;
|
||||
}
|
||||
return dts;
|
||||
}
|
||||
|
||||
private string GetDBFRevDate(string afpath)
|
||||
{
|
||||
FileInfo fi = new FileInfo(afpath + @"\" + Entry + ".dbf");
|
||||
if (fi.Exists)
|
||||
return fi.LastWriteTime.ToShortDateString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,521 +0,0 @@
|
||||
//using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.IO;
|
||||
using System.Data.OleDb;
|
||||
using System.Data;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public bool BuildApprovedRevision()
|
||||
{
|
||||
if(!frmMain.RunScript("PROMSApproveApprove.sql", frmMain.MySettings.DBName)) return false;
|
||||
bool rv = false;
|
||||
using (Stage myStage = GetApprovedStage())
|
||||
{
|
||||
if (myStage == null)
|
||||
return rv;
|
||||
DocVersionInfoList dvil = DocVersionInfoList.Get();
|
||||
foreach (DocVersionInfo dvi in dvil)
|
||||
{
|
||||
if (dvi.Procedures.Count > 0)
|
||||
{
|
||||
if (!frmMain.MySettings.OnlyThisSet || frmMain.MySettings.ProcedureSetPath.ToUpper() == dvi.MyFolder.Title.ToUpper())
|
||||
{
|
||||
string approvedFolder = dvi.MyFolder.Title + @"\APPROVED";
|
||||
//B2012-094 fix
|
||||
if (!Directory.Exists(approvedFolder))
|
||||
frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved folder does not exist";
|
||||
else if (!File.Exists(approvedFolder + @"\SET.DBF"))
|
||||
frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Set.dbf does not exist";
|
||||
else if (!File.Exists(approvedFolder + @"\USAGERO.DBF"))
|
||||
frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved UsageRO.dbf does not exist";
|
||||
else if (!Directory.Exists(approvedFolder + @"\PDFS"))
|
||||
frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not exist";
|
||||
else if (Directory.GetFiles(approvedFolder + @"\PDFS", "*.PDF").Length == 0)
|
||||
frmMain.MyWarning = "**** " + dvi.MyFolder.Title + " Approved Pdfs folder does not contain any pdf files";
|
||||
else rv |= BuildApprovedRevision(myStage, approvedFolder, dvi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private static Stage GetApprovedStage()
|
||||
{
|
||||
StageInfoList sil = StageInfoList.Get();
|
||||
foreach (StageInfo si in sil)
|
||||
{
|
||||
if (si.Name.ToUpper() == "APPROVED")
|
||||
return si.Get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private bool BuildApprovedRevision(Stage myStage, string approvedFolder, DocVersionInfo dvi)
|
||||
{
|
||||
bool rv = false;
|
||||
if (dvi.MultiUnitCount <= 1)
|
||||
{
|
||||
ApprovedFolder af = new ApprovedFolder(approvedFolder);
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
rv |= BuildApprovedRevision(myStage, af, pi, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ApprovedFolder af = new ApprovedFolder(approvedFolder, dvi);
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
for (int i = 1; i <= dvi.MultiUnitCount; i++)
|
||||
rv |= BuildApprovedRevision(myStage, af, pi, i);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private bool BuildApprovedRevision(Stage myStage, ApprovedFolder af, ProcedureInfo pi, int selectedSlave)
|
||||
{
|
||||
bool rv = false;
|
||||
if (selectedSlave > 0)
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave;
|
||||
frmMain.MyInfo = string.Format("Loading approved data for Procedure: {0}", pi.DisplayNumber);
|
||||
// if working draft procedure does not exist in approved folder, don't bother processing
|
||||
if (!af.EntryFromProc.ContainsKey(pi.DisplayNumber)) return rv;
|
||||
using (Revision revision = CreateRevision(af, pi))
|
||||
{
|
||||
System.DateTime dts = pi.DTS;
|
||||
string userID = af.EntryFromProc[pi.DisplayNumber].UserID;
|
||||
using (Version version = Version.MakeVersion(revision, myStage, GetPDF(af,pi), GetSummaryPDF(), dts, userID))
|
||||
{
|
||||
using (Check check = Check.MakeCheck(revision, myStage, af.BuildConsistencyChecks(pi)))
|
||||
{
|
||||
rv |= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!rv)
|
||||
frmMain.MyInfo = string.Format("Loading Procedure: {0} FAILED MISERABLY", pi.DisplayNumber);
|
||||
return rv;
|
||||
}
|
||||
private byte[] GetSummaryPDF()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
private byte[] GetPDF(ApprovedFolder af, ProcedureInfo pi)
|
||||
{
|
||||
string pdf = string.Format(@"{0}\PDFS\{1}.pdf", af.Path, pi.DisplayNumber);
|
||||
FileInfo pdfFile = new FileInfo(pdf);
|
||||
if (pdfFile.Exists)
|
||||
{
|
||||
FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
byte[] pdfBuf = new byte[pdfFile.Length];
|
||||
fs.Read(pdfBuf, 0, pdfBuf.Length);
|
||||
fs.Close();
|
||||
return pdfBuf;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private Revision CreateRevision(ApprovedFolder af, ProcedureInfo pi)
|
||||
{
|
||||
int typeID = 1; //revision not tempmod
|
||||
ProcInfo pinf = af.EntryFromProc[pi.DisplayNumber];
|
||||
string revisionNumber = pinf.Rev;
|
||||
System.DateTime revisionDate = System.DateTime.Parse(pinf.RevDate ?? "1/1/1980");
|
||||
string notes = "Migration Of Current Approved Revision";
|
||||
RevisionConfig cfg = new RevisionConfig();
|
||||
cfg.History_StartDate = pinf.StartDateTime;
|
||||
if (pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
|
||||
cfg.Applicability_Index = pi.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||
string config = cfg.ToString();
|
||||
System.DateTime dts = pi.DTS;
|
||||
string userID = pinf.UserID;
|
||||
return Revision.MakeRevision(pi.ItemID, typeID, revisionNumber, revisionDate, notes, config, dts, userID);
|
||||
}
|
||||
}
|
||||
public partial class ApprovedFolder
|
||||
{
|
||||
private OleDbConnection _Connection;
|
||||
public OleDbConnection Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_Connection == null)
|
||||
_Connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _Path + ";Extended Properties=dBase III;Persist Security Info=False");
|
||||
return _Connection;
|
||||
}
|
||||
}
|
||||
private string _Path;
|
||||
public string Path
|
||||
{
|
||||
get { return _Path; }
|
||||
set { _Path = value; }
|
||||
}
|
||||
private System.DateTime _ROFstDate = System.DateTime.MinValue;
|
||||
public System.DateTime ROFstDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ROFstDate == System.DateTime.MinValue)
|
||||
{
|
||||
FileInfo fi = new FileInfo(string.Format(@"{0}\ro.fst",Path));
|
||||
if(fi.Exists)
|
||||
_ROFstDate = fi.LastWriteTimeUtc;
|
||||
}
|
||||
return _ROFstDate;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _ROValues = new Dictionary<string, string>();
|
||||
private Dictionary<string, System.DateTime> _LibDocDates = new Dictionary<string,System.DateTime>();
|
||||
private Dictionary<string, List<string>> _ProcROs = new Dictionary<string,List<string>>();
|
||||
private Dictionary<string, List<string>> _LibROs = new Dictionary<string,List<string>>();
|
||||
private Dictionary<string, List<string>> _LibDocs = new Dictionary<string,List<string>>();
|
||||
|
||||
public string BuildConsistencyChecks(ProcedureInfo proc)
|
||||
{
|
||||
/*
|
||||
<ConsistencyChecks ItemID="1">
|
||||
<ROChecks ROFstDate="2011-04-11T14:13:44">
|
||||
<ROCheck ROID="0001000003960000" ROValue="1430 PSIG" />
|
||||
</ROChecks>
|
||||
<LibDocChecks>
|
||||
<LibDocCheck DocID="1" DocDate="2011-12-06T11:12:40.633" />
|
||||
</LibDocChecks>
|
||||
</ConsistencyChecks>
|
||||
*/
|
||||
ConsistencyChecks cc = new ConsistencyChecks();
|
||||
cc.ItemID = proc.ItemID;
|
||||
BuildROChecks(cc, proc);
|
||||
BuildLibDocChecks(cc, proc);
|
||||
return cc.ToString().Replace("OldDocDate=\"0001-01-01T00:00:00\"", "");
|
||||
}
|
||||
|
||||
private void BuildLibDocChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
||||
{
|
||||
if (_LibDocs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string libdoc in _LibDocs[proc.DisplayNumber])
|
||||
{
|
||||
FileInfo fi = new FileInfo(string.Format(@"{0}\RTFFILES\{1}.LIB",Path,libdoc));
|
||||
if (fi.Exists)
|
||||
{
|
||||
//if (proc.MyDocVersion.VersionID > 1)
|
||||
// System.Threading.Thread.Sleep(5000);
|
||||
int docid = GetDocID(libdoc, proc.MyDocVersion.VersionID);
|
||||
if (docid > 0)
|
||||
cc.LibDocConsistency.AddLibDocCheck(docid, fi.LastWriteTimeUtc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int GetDocID(string libdoc, int versionid)
|
||||
{
|
||||
DocumentInfo di = DocumentInfo.GetByLibDocName(libdoc, versionid);
|
||||
return di.DocID;
|
||||
}
|
||||
|
||||
private void BuildROChecks(ConsistencyChecks cc, ProcedureInfo proc)
|
||||
{
|
||||
cc.ROConsistency.ROFstDate = ROFstDate;
|
||||
if (_ProcROs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string roid in _ProcROs[proc.DisplayNumber])
|
||||
cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
|
||||
}
|
||||
//int cnt = cc.ROConsistency.MyROChecks.Length;
|
||||
if (_LibDocs.ContainsKey(proc.DisplayNumber))
|
||||
{
|
||||
foreach (string libdoc in _LibDocs[proc.DisplayNumber])
|
||||
{
|
||||
if (_LibROs.ContainsKey(libdoc))
|
||||
{
|
||||
foreach (string roid in _LibROs[libdoc])
|
||||
cc.ROConsistency.AddROCheck(FormatROID(roid), GetROValue(FormatROID(roid)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetROValue(string roid)
|
||||
{
|
||||
if (!_ROValues.ContainsKey(roid))
|
||||
{
|
||||
//if (roid.Contains("000128"))
|
||||
// System.Console.WriteLine();
|
||||
//string ss = _Lookup.GetRoValue(roid);
|
||||
//ss = ItemInfo.ConvertToDisplayText(ss);
|
||||
//ss = ss.Replace('\n', ';');
|
||||
|
||||
_ROValues.Add(roid, PrepareForXML(ItemInfo.ConvertToDisplayText(_Lookup.GetRoValue(roid))));
|
||||
}
|
||||
return _ROValues[roid];
|
||||
}
|
||||
|
||||
private string PrepareForXML(string rovalue)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (char c in rovalue)
|
||||
{
|
||||
if (c < ' ')
|
||||
sb.Append(string.Format(@"\x{0:X4}", (int)c));
|
||||
else
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
private string FormatROID(string roid)
|
||||
{
|
||||
if (roid.Length == 16 && roid.EndsWith("0000"))
|
||||
return roid.Substring(0, 12).ToUpper();
|
||||
return roid.ToUpper();
|
||||
}
|
||||
|
||||
private Dictionary<string, ProcInfo> _EntryFromProc;
|
||||
public Dictionary<string, ProcInfo> EntryFromProc
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_EntryFromProc == null)
|
||||
_EntryFromProc = FillEntryFromProc();
|
||||
return _EntryFromProc;
|
||||
}
|
||||
}
|
||||
private Dictionary<string, ProcInfo> FillEntryFromProc()
|
||||
{
|
||||
Dictionary<string, ProcInfo> rv = new Dictionary<string, ProcInfo>();
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
if (!rv.ContainsKey(dr["NUMBER"].ToString()))
|
||||
rv.Add(dr["NUMBER"].ToString(), new ProcInfo(dr, Path));
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private ROFSTLookup _Lookup;
|
||||
public ApprovedFolder(string path)
|
||||
{
|
||||
_Path = path;
|
||||
FillROs();
|
||||
FillLibDocs();
|
||||
_Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
|
||||
}
|
||||
public ApprovedFolder(string path, DocVersionInfo dvi)
|
||||
{
|
||||
_Path = path;
|
||||
FillROs();
|
||||
FillLibDocs();
|
||||
_Lookup = new ROFSTLookup(string.Format(@"{0}\RO.FST", Path));
|
||||
_EntryFromProc = FillEntryFromProcMulti(dvi);
|
||||
}
|
||||
|
||||
private Dictionary<string, ProcInfo> FillEntryFromProcMulti(DocVersionInfo dvi)
|
||||
{
|
||||
Dictionary<string, ProcInfo> rv = new Dictionary<string, ProcInfo>();
|
||||
for (int i = 1; i <= dvi.MultiUnitCount; i++)
|
||||
{
|
||||
foreach (ProcedureInfo pi in dvi.Procedures)
|
||||
{
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = i;
|
||||
rv.Add(pi.DisplayNumber, new ProcInfo(pi, Path));
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private void FillLibDocs()
|
||||
{
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct FROMNUMBER, TONUMBER from [tran] where tonumber like 'DOC%'", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
string number = dr["FROMNUMBER"].ToString();
|
||||
string libdoc = dr["TONUMBER"].ToString();
|
||||
if (!_LibDocs.ContainsKey(number))
|
||||
_LibDocs.Add(number, new List<string>());
|
||||
if (!_LibDocs[number].Contains(libdoc))
|
||||
_LibDocs[number].Add(libdoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FillROs()
|
||||
{
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter("Select distinct NUMBER, ROID from [usagero]", Connection))
|
||||
{
|
||||
using (DataSet ds = new DataSet())
|
||||
{
|
||||
da.Fill(ds);
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
string number = dr["NUMBER"].ToString();
|
||||
string roid = dr["ROID"].ToString();
|
||||
if (number.StartsWith("DOC"))
|
||||
{
|
||||
if (!_LibROs.ContainsKey(number))
|
||||
_LibROs.Add(number, new List<string>());
|
||||
if (!_LibROs[number].Contains(roid))
|
||||
_LibROs[number].Add(roid);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_ProcROs.ContainsKey(number))
|
||||
_ProcROs.Add(number, new List<string>());
|
||||
if (!_ProcROs[number].Contains(roid))
|
||||
_ProcROs[number].Add(roid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public partial class ProcInfo
|
||||
{
|
||||
private log4net.ILog log;
|
||||
private string _Number;
|
||||
public string Number
|
||||
{
|
||||
get { return _Number; }
|
||||
set { _Number = value; }
|
||||
}
|
||||
private string _Entry;
|
||||
public string Entry
|
||||
{
|
||||
get { return _Entry; }
|
||||
set { _Entry = value; }
|
||||
}
|
||||
private string _UserID;
|
||||
public string UserID
|
||||
{
|
||||
get { return _UserID; }
|
||||
set { _UserID = value; }
|
||||
}
|
||||
private System.DateTime _StartDateTime;
|
||||
public System.DateTime StartDateTime
|
||||
{
|
||||
get { return _StartDateTime; }
|
||||
set { _StartDateTime = value; }
|
||||
}
|
||||
private string _Rev;
|
||||
public string Rev
|
||||
{
|
||||
get { return _Rev; }
|
||||
set { _Rev = value; }
|
||||
}
|
||||
private string _RevDate;
|
||||
public string RevDate
|
||||
{
|
||||
get { return _RevDate; }
|
||||
set { _RevDate = value; }
|
||||
}
|
||||
private string _ReviewDate;
|
||||
public string ReviewDate
|
||||
{
|
||||
get { return _ReviewDate; }
|
||||
set { _ReviewDate = value; }
|
||||
}
|
||||
public ProcInfo(ProcedureInfo pi, string afpath)
|
||||
{
|
||||
Number = pi.DisplayNumber;
|
||||
Entry = pi.DisplayText;
|
||||
UserID = pi.UserID;
|
||||
StartDateTime = pi.DTS;
|
||||
RevDate = pi.ProcedureConfig.Print_RevDate;
|
||||
Rev = pi.ProcedureConfig.Print_Rev;
|
||||
}
|
||||
public ProcInfo(DataRow dr, string afpath)
|
||||
{
|
||||
Number = dr["NUMBER"].ToString();
|
||||
Entry = dr["ENTRY"].ToString();
|
||||
UserID = dr["INITIALS"].ToString();
|
||||
if (UserID == string.Empty) UserID = "UNKNOWN";
|
||||
//string date = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString()).ToString("MM/dd/yyyy HH:MM");//System.DateTime.Parse(dr["DATE"].ToString()).ToString("MM/dd/yyyy");
|
||||
//string time = dr["TIME"].ToString();
|
||||
//if (time.EndsWith(":"))
|
||||
// date += " " + time.Substring(0, 2) + ":" + time.Substring(2, 2);
|
||||
//else
|
||||
// date += " " + time.Substring(0, 2) + ":" + time.Substring(3, 2);
|
||||
//StartDateTime = System.DateTime.Parse(date);
|
||||
StartDateTime = GetDTS(dr["DATE"].ToString(), dr["TIME"].ToString());
|
||||
RevDate = StartDateTime.ToString("MM/dd/yyyy");
|
||||
FixItems fis = new FixItems(new FileInfo(string.Format(@"{0}\{1}.fix", afpath, Entry)));
|
||||
if (fis.Count > 0)
|
||||
{
|
||||
Rev = fis[0].Rev;
|
||||
RevDate = fis[0].RevDate ?? GetDBFRevDate(afpath);
|
||||
ReviewDate = fis[0].ReviewDate;
|
||||
}
|
||||
}
|
||||
public System.DateTime GetDTS(string date, string time)
|
||||
{
|
||||
// Set the date/time stamp. If there is no 'date', set the date
|
||||
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
||||
// set the time to 0:0:0 (midnight).
|
||||
|
||||
System.DateTime dts = System.DateTime.Now;
|
||||
string month = "01";
|
||||
string day = "01";
|
||||
string year = "2000";
|
||||
string hour = "";
|
||||
string minute = "";
|
||||
try
|
||||
{
|
||||
if (date != null && date != "")
|
||||
{
|
||||
int indx1 = date.IndexOf("/");
|
||||
month = date.Substring(0, indx1);
|
||||
int indx2 = date.IndexOf("/", indx1 + 1);
|
||||
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
||||
year = date.Substring(indx2 + 1, 4);
|
||||
}
|
||||
if (time == null || time == "")
|
||||
{
|
||||
hour = "0";
|
||||
minute = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
hour = time.Substring(0, 2);
|
||||
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
||||
if (indxc == time.Length - 1)
|
||||
minute = time.Substring(2, 2);
|
||||
else
|
||||
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
||||
}
|
||||
dts = new System.DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
||||
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Bad Date/Time {0} {1}. Set to NOW.", date, time);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
//frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
return dts;
|
||||
}
|
||||
return dts;
|
||||
}
|
||||
|
||||
private string GetDBFRevDate(string afpath)
|
||||
{
|
||||
FileInfo fi = new FileInfo(afpath + @"\" + Entry + ".dbf");
|
||||
if (fi.Exists)
|
||||
return fi.LastWriteTime.ToShortDateString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
class ConfigInfo
|
||||
{
|
||||
private XmlDocument xmldoc;
|
||||
public ConfigInfo(string xml)
|
||||
{
|
||||
xmldoc = new XmlDocument();
|
||||
if (xml == null)
|
||||
xmldoc.LoadXml("<Config/>");
|
||||
else
|
||||
xmldoc.LoadXml(xml);
|
||||
}
|
||||
|
||||
public ConfigInfo(string xml, string ename, string aname, string avalue)
|
||||
{
|
||||
xmldoc = new XmlDocument();
|
||||
if (xml == null)
|
||||
xmldoc.LoadXml("<Config/>");
|
||||
else
|
||||
xmldoc.LoadXml(xml);
|
||||
AddItem(ename, aname.Replace(' ','_'), avalue);
|
||||
}
|
||||
public bool AddItem(string ename, string aname, string avalue)
|
||||
{
|
||||
if (aname != null && aname != "")
|
||||
{
|
||||
//if (xmldoc == null)
|
||||
//{
|
||||
// xmldoc = new XmlDocument();
|
||||
// xmldoc.AppendChild(xmldoc.CreateElement("ConfigInfo"));
|
||||
//}
|
||||
// see if ename element exists, use it to add attributes,
|
||||
// otherwise, create the element.
|
||||
|
||||
XmlNode nxml = null;
|
||||
XmlNodeList xl = xmldoc.DocumentElement.SelectNodes(string.Format("//{0}", ename));
|
||||
switch (xl.Count)
|
||||
{
|
||||
case 0: // No nodes found
|
||||
nxml = xmldoc.DocumentElement.AppendChild(xmldoc.CreateElement(ename));
|
||||
break;
|
||||
default: // Found the node
|
||||
nxml = xl[0];
|
||||
if (nxml.GetType() != typeof(XmlElement))
|
||||
{
|
||||
frmLoader._MyLog.ErrorFormat("Invalid xml element type when migrating config data - element = {0}, name = {1} , value = {2}", ename, aname, avalue);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname.Replace(' ', '_')));
|
||||
//added by jcb 20131216
|
||||
//aname = SanitizeXmlString(aname);
|
||||
//XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname));
|
||||
//end added by jcb 20131216
|
||||
xa.Value = avalue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//added by jcb 20131216
|
||||
public string SanitizeXmlString(string xml)
|
||||
{
|
||||
if (xml == null)
|
||||
throw new ArgumentNullException("xml");
|
||||
xml = xml.Replace(' ', '_').Replace("/", "_fslash_").Replace("(", "_lparen_").Replace((char)0xA0, '_').Replace((char)0x20, '_').Replace(":", "_colon_");
|
||||
StringBuilder buffer = new StringBuilder(xml.Length);
|
||||
foreach (char c in xml)
|
||||
{
|
||||
if (IsLegalXmlChar(c))
|
||||
buffer.Append(c);
|
||||
}
|
||||
return buffer.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a given character is allowed by XML 1.0.
|
||||
/// </summary>
|
||||
public bool IsLegalXmlChar(int character)
|
||||
{
|
||||
return
|
||||
(
|
||||
character == 0x9 /* == '\t' == 9 */ ||
|
||||
character == 0xA /* == '\n' == 10 */ ||
|
||||
character == 0xD /* == '\r' == 13 */ ||
|
||||
(character >= 0x20 && character <= 0xD7FF) ||
|
||||
(character >= 0xE000 && character <= 0xFFFD) ||
|
||||
(character >= 0x10000 && character <= 0x10FFFF)
|
||||
);
|
||||
}
|
||||
//end added by jcb 20131216
|
||||
|
||||
public int ItemCount
|
||||
{
|
||||
get { return xmldoc.DocumentElement.ChildNodes.Count; }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (xmldoc != null) return xmldoc.InnerXml;
|
||||
else return null;
|
||||
}
|
||||
public void AddSlaveNode(int index)
|
||||
{
|
||||
XmlElement slaves = xmldoc.SelectSingleNode("Config/Slaves") as XmlElement;
|
||||
if (slaves == null)
|
||||
{
|
||||
slaves = xmldoc.CreateElement("Slaves");
|
||||
xmldoc.DocumentElement.AppendChild(slaves);
|
||||
}
|
||||
XmlElement slave = xmldoc.CreateElement("Slave");
|
||||
XmlAttribute xa = xmldoc.CreateAttribute("index");
|
||||
xa.InnerText = index.ToString();
|
||||
slave.Attributes.Append(xa);
|
||||
slaves.AppendChild(slave);
|
||||
}
|
||||
public void AddSlaveItem(int index, string aname, string avalue)
|
||||
{
|
||||
string srch = "Config/Slaves/Slave[@index='" + index.ToString() + "']";
|
||||
XmlElement slave = xmldoc.SelectSingleNode(srch) as XmlElement;
|
||||
if (slave != null)
|
||||
{
|
||||
XmlAttribute xa = xmldoc.CreateAttribute(aname);
|
||||
xa.InnerText = avalue;
|
||||
slave.Attributes.Append(xa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
class ConfigInfo
|
||||
{
|
||||
private XmlDocument xmldoc;
|
||||
public ConfigInfo(string xml)
|
||||
{
|
||||
xmldoc = new XmlDocument();
|
||||
if (xml == null)
|
||||
xmldoc.LoadXml("<Config/>");
|
||||
else
|
||||
xmldoc.LoadXml(xml);
|
||||
}
|
||||
|
||||
public ConfigInfo(string xml, string ename, string aname, string avalue)
|
||||
{
|
||||
xmldoc = new XmlDocument();
|
||||
if (xml == null)
|
||||
xmldoc.LoadXml("<Config/>");
|
||||
else
|
||||
xmldoc.LoadXml(xml);
|
||||
AddItem(ename, aname.Replace(' ','_'), avalue);
|
||||
}
|
||||
public bool AddItem(string ename, string aname, string avalue)
|
||||
{
|
||||
if (aname != null && aname != "")
|
||||
{
|
||||
//if (xmldoc == null)
|
||||
//{
|
||||
// xmldoc = new XmlDocument();
|
||||
// xmldoc.AppendChild(xmldoc.CreateElement("ConfigInfo"));
|
||||
//}
|
||||
// see if ename element exists, use it to add attributes,
|
||||
// otherwise, create the element.
|
||||
|
||||
XmlNode nxml = null;
|
||||
XmlNodeList xl = xmldoc.DocumentElement.SelectNodes(string.Format("//{0}", ename));
|
||||
switch (xl.Count)
|
||||
{
|
||||
case 0: // No nodes found
|
||||
nxml = xmldoc.DocumentElement.AppendChild(xmldoc.CreateElement(ename));
|
||||
break;
|
||||
default: // Found the node
|
||||
nxml = xl[0];
|
||||
if (nxml.GetType() != typeof(XmlElement))
|
||||
{
|
||||
frmLoader._MyLog.ErrorFormat("Invalid xml element type when migrating config data - element = {0}, name = {1} , value = {2}", ename, aname, avalue);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//added by jcb 20131216
|
||||
aname = SanitizeXmlString(aname);
|
||||
XmlAttribute xa = nxml.Attributes.Append(xmldoc.CreateAttribute(aname));
|
||||
//end added by jcb 20131216
|
||||
xa.Value = avalue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//added by jcb 20131216
|
||||
public string SanitizeXmlString(string xml)
|
||||
{
|
||||
if (xml == null)
|
||||
throw new ArgumentNullException("xml");
|
||||
xml = xml.Replace(' ', '_').Replace("/", "_fslash_").Replace("(", "_lparen_").Replace((char)0xA0, '_').Replace((char)0x20, '_').Replace(":", "_colon_");
|
||||
StringBuilder buffer = new StringBuilder(xml.Length);
|
||||
foreach (char c in xml)
|
||||
{
|
||||
if (IsLegalXmlChar(c))
|
||||
buffer.Append(c);
|
||||
}
|
||||
return buffer.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a given character is allowed by XML 1.0.
|
||||
/// </summary>
|
||||
public bool IsLegalXmlChar(int character)
|
||||
{
|
||||
return
|
||||
(
|
||||
character == 0x9 /* == '\t' == 9 */ ||
|
||||
character == 0xA /* == '\n' == 10 */ ||
|
||||
character == 0xD /* == '\r' == 13 */ ||
|
||||
(character >= 0x20 && character <= 0xD7FF) ||
|
||||
(character >= 0xE000 && character <= 0xFFFD) ||
|
||||
(character >= 0x10000 && character <= 0x10FFFF)
|
||||
);
|
||||
}
|
||||
//end added by jcb 20131216
|
||||
|
||||
public int ItemCount
|
||||
{
|
||||
get { return xmldoc.DocumentElement.ChildNodes.Count; }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (xmldoc != null) return xmldoc.InnerXml;
|
||||
else return null;
|
||||
}
|
||||
public void AddSlaveNode(int index)
|
||||
{
|
||||
XmlElement slaves = xmldoc.SelectSingleNode("Config/Slaves") as XmlElement;
|
||||
if (slaves == null)
|
||||
{
|
||||
slaves = xmldoc.CreateElement("Slaves");
|
||||
xmldoc.DocumentElement.AppendChild(slaves);
|
||||
}
|
||||
XmlElement slave = xmldoc.CreateElement("Slave");
|
||||
XmlAttribute xa = xmldoc.CreateAttribute("index");
|
||||
xa.InnerText = index.ToString();
|
||||
slave.Attributes.Append(xa);
|
||||
slaves.AppendChild(slave);
|
||||
}
|
||||
public void AddSlaveItem(int index, string aname, string avalue)
|
||||
{
|
||||
string srch = "Config/Slaves/Slave[@index='" + index.ToString() + "']";
|
||||
XmlElement slave = xmldoc.SelectSingleNode(srch) as XmlElement;
|
||||
if (slave != null)
|
||||
{
|
||||
XmlAttribute xa = xmldoc.CreateAttribute(aname);
|
||||
xa.InnerText = avalue;
|
||||
slave.Attributes.Append(xa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Schema;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
[XmlRoot("Proms2010Print")]
|
||||
//[Serializable()]
|
||||
public class ConversionRTBProblems
|
||||
{
|
||||
private RTBProblems _RTBProblems;
|
||||
|
||||
public RTBProblems RTBProblems
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_RTBProblems == null) _RTBProblems = new RTBProblems();
|
||||
return _RTBProblems;
|
||||
}
|
||||
set { _RTBProblems = value; }
|
||||
}
|
||||
public void Save(string fileName)
|
||||
{
|
||||
XmlSerializer<ConversionRTBProblems>.WriteFile(this, fileName);
|
||||
}
|
||||
public static ConversionRTBProblems LoadProblems(string fileName)
|
||||
{
|
||||
return XmlSerializer<ConversionRTBProblems>.ReadFile(fileName);
|
||||
}
|
||||
public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
|
||||
{
|
||||
_RTBProblems.Add(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath);
|
||||
}
|
||||
//public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
|
||||
//{
|
||||
// _RTBProblems.Add(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath, iteminfo);
|
||||
//}
|
||||
}
|
||||
public class RTBProblems : List<RTBProblem>
|
||||
{
|
||||
//public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
|
||||
public void Add(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
|
||||
{
|
||||
base.Add(new RTBProblem(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath));
|
||||
//base.Add(new RTBProblem(itemID, contentID, originalRTF, oldRTF, stepRTF, newRTF, stepPath, iteminfo));
|
||||
}
|
||||
}
|
||||
public class RTBProblem
|
||||
{
|
||||
public RTBProblem()
|
||||
{
|
||||
}
|
||||
//public RTBProblem(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath, ItemInfo iteminfo)
|
||||
public RTBProblem(int itemID, int contentID, string originalRTF, string oldRTF, string stepRTF, string newRTF, string stepPath)
|
||||
{
|
||||
_ItemID = itemID;
|
||||
_ContentID = contentID;
|
||||
_OldRTF = oldRTF;
|
||||
_NewRTF = newRTF;
|
||||
_StepPath = stepPath;
|
||||
_OriginalRTF = originalRTF;
|
||||
_StepRtf = stepRTF;
|
||||
//_itemInfo = iteminfo;
|
||||
}
|
||||
private int _ItemID;
|
||||
[XmlAttribute("ItemID")]
|
||||
public int ItemID
|
||||
{
|
||||
get { return _ItemID; }
|
||||
set { _ItemID = value; }
|
||||
}
|
||||
private int _ContentID;
|
||||
[XmlAttribute("ContentID")]
|
||||
public int ContentID
|
||||
{
|
||||
get { return _ContentID; }
|
||||
set { _ContentID = value; }
|
||||
}
|
||||
private string _OriginalRTF;
|
||||
[XmlAttribute("OriginalRTF")]
|
||||
public string OriginalRTF
|
||||
{
|
||||
get { return _OriginalRTF; }
|
||||
set { _OriginalRTF = value; }
|
||||
}
|
||||
private string _OldRTF;
|
||||
[XmlAttribute("OldRTF")]
|
||||
public string OldRTF
|
||||
{
|
||||
get { return _OldRTF; }
|
||||
set { _OldRTF = value; }
|
||||
}
|
||||
private string _StepRtf;
|
||||
[XmlAttribute("StepRTF")]
|
||||
public string StepRtf
|
||||
{
|
||||
get { return _StepRtf; }
|
||||
set { _StepRtf = value; }
|
||||
}
|
||||
private string _NewRTF;
|
||||
[XmlAttribute("NewRTF")]
|
||||
public string NewRTF
|
||||
{
|
||||
get { return _NewRTF; }
|
||||
set { _NewRTF = value; }
|
||||
}
|
||||
private string _StepPath;
|
||||
[XmlAttribute("StepPath")]
|
||||
public string StepPath
|
||||
{
|
||||
get { return _StepPath; }
|
||||
set { _StepPath = value; }
|
||||
}
|
||||
private string _Comparison;
|
||||
[XmlIgnore]
|
||||
public string Comparison
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Comparison == null)
|
||||
_Comparison = GetComparison(_OldRTF, _NewRTF);
|
||||
return _Comparison;
|
||||
}
|
||||
}
|
||||
private string _StripRTF;
|
||||
[XmlIgnore]
|
||||
public string StripRTF
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_StripRTF == null)
|
||||
_StripRTF = GetStrip(_StepRtf);
|
||||
return _StripRTF;
|
||||
}
|
||||
set { _StripRTF = value; }
|
||||
}
|
||||
|
||||
//private ItemInfo _itemInfo;
|
||||
//[XmlIgnore]
|
||||
//public ItemInfo ItemInfo
|
||||
//{
|
||||
// get { return _itemInfo; }
|
||||
// set { _itemInfo = value; }
|
||||
//}
|
||||
|
||||
private string GetStrip(string _StepRtf)
|
||||
{
|
||||
string rttval = DisplayText.StaticStripRtfCommands(_StepRtf);
|
||||
//string rttval = Volian.Controls.Library.DisplayText.StaticStripRtfCommands(_StepRtf, _itemInfo);
|
||||
//return rttval.Replace(@"\u8209?", "-");
|
||||
return rttval;
|
||||
}
|
||||
private string GetComparison(string str1, string str2)
|
||||
{
|
||||
if (str1 == str2) return str1;
|
||||
int endMatch = 0;
|
||||
int l1 = str1.Length;
|
||||
int l2 = str2.Length;
|
||||
int min = l1 > l2 ? l2 : l1;
|
||||
int startMatch = min;
|
||||
for (int i = 0; i < min; i++)
|
||||
if (str1[i] != str2[i])
|
||||
{
|
||||
startMatch = i;
|
||||
break;
|
||||
}
|
||||
min = min - startMatch;
|
||||
endMatch = min;
|
||||
for (int i = 1; i < min; i++)
|
||||
if (str1[l1 - i] != str2[l2 - i])
|
||||
{
|
||||
endMatch = i - 1;
|
||||
break;
|
||||
}
|
||||
string prefix = str1.Substring(0, startMatch);
|
||||
string part1 = str1.Substring(startMatch, l1 - (startMatch + endMatch));
|
||||
string part2 = str2.Substring(startMatch, l2 - (startMatch + endMatch));
|
||||
string suffix = str1.Substring(l1 - endMatch, endMatch);
|
||||
return prefix + "\r\n<<<" + part1 + "|||" + part2 + ">>>\r\n" + suffix;
|
||||
}
|
||||
private ItemInfo _MyItem;
|
||||
[XmlIgnore]
|
||||
public ItemInfo MyItem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyItem == null)
|
||||
_MyItem = ItemInfo.Get(_ItemID);
|
||||
return _MyItem;
|
||||
}
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return MyItem.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for CurSet.
|
||||
/// </summary>
|
||||
public class CurSet
|
||||
{
|
||||
private int NUMCBTEXTYPE = 5; // number of changebar text types.
|
||||
public string PathName;
|
||||
private string DefaultPlantFmt;
|
||||
|
||||
public CurSet(string pname)
|
||||
{
|
||||
PathName = pname;
|
||||
DefaultPlantFmt = null;
|
||||
}
|
||||
|
||||
private string ReadTheString(BinaryReader bw, int maxlen)
|
||||
{
|
||||
StringBuilder retStr = new StringBuilder(maxlen+1);
|
||||
// read a series of characters until a null is found.
|
||||
char ac;
|
||||
bool done = false;
|
||||
while(done==false)
|
||||
{
|
||||
ac = bw.ReadChar();
|
||||
if (ac=='\0')
|
||||
done=true;
|
||||
else
|
||||
retStr.Append(ac);
|
||||
}
|
||||
return retStr.ToString();
|
||||
}
|
||||
|
||||
public FolderConfig Convert(FolderConfig cfg)
|
||||
{
|
||||
BinaryReader br;
|
||||
ArrayList DefaultUserCBMsg = new ArrayList(2);
|
||||
FileStream fs;
|
||||
FileInfo fi = new FileInfo(PathName);
|
||||
try
|
||||
{
|
||||
fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite );
|
||||
br = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DataLoader.frmLoader._MyLog.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
|
||||
return cfg;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sbyte tmpsbyte;
|
||||
string tmpstring;
|
||||
tmpsbyte=br.ReadSByte(); // DefaultDestination not used
|
||||
|
||||
// the next byte has three settings embedded in it, the type of change
|
||||
// bar (Print_ChangeBar), the change bar location and its text.
|
||||
tmpsbyte= br.ReadSByte();
|
||||
cfg.Print_ChangeBar = (PrintChangeBar)((int)tmpsbyte > 2 ? 3 : (int)tmpsbyte);
|
||||
if (tmpsbyte > 2)
|
||||
{
|
||||
cfg.Print_ChangeBarLoc = (PrintChangeBarLoc)((tmpsbyte - 3) / NUMCBTEXTYPE);
|
||||
int ts = (tmpsbyte - 3) % NUMCBTEXTYPE;
|
||||
cfg.Print_ChangeBarText = (PrintChangeBarText)((tmpsbyte - 3) % NUMCBTEXTYPE);
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg.Print_ChangeBarLoc = PrintChangeBarLoc.WithText;
|
||||
cfg.Print_ChangeBarText = PrintChangeBarText.DateChgID;
|
||||
}
|
||||
cfg.Print_NumCopies=br.ReadSByte();
|
||||
cfg.Print_Pagination=(PrintPagination) br.ReadSByte();
|
||||
tmpstring = ReadTheString(br,4); // DefaultPrinter not used
|
||||
cfg.Format_Plant = ReadTheString(br,10);
|
||||
DefaultPlantFmt = cfg.Format_Plant;
|
||||
tmpstring = ReadTheString(br, 128); // DefaultDestFName not used
|
||||
tmpsbyte = br.ReadSByte(); // DefaultPlotterType not used
|
||||
tmpsbyte = br.ReadSByte(); // DefaultPlotterPort not used
|
||||
tmpsbyte = br.ReadSByte(); // DefaultCIEType not used.
|
||||
for (int i=0;i<8;i++) // DefPenColors[8] not used
|
||||
tmpsbyte = br.ReadSByte();
|
||||
cfg.Print_Watermark = (PrintWatermark)br.ReadSByte();
|
||||
cfg.Print_UserCBMess1 = ReadTheString(br, 10);
|
||||
cfg.Print_UserCBMess2 = ReadTheString(br, 10);
|
||||
tmpsbyte = br.ReadSByte(); // DontPrintStatusTree not used
|
||||
cfg.Print_UserFormat = ReadTheString(br, 10);
|
||||
//tmpsbyte = br.ReadSByte();
|
||||
//cfg.Print_Duplex = tmpsbyte == 0 ? true : false;
|
||||
if (cfg.Print_UserFormat.Trim() != string.Empty)
|
||||
DefaultPlantFmt += " " + cfg.Print_UserFormat;
|
||||
br.Close();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
if(br!=null) br.Close();
|
||||
DataLoader.frmLoader._MyLog.ErrorFormat("Error migrating {0} Curset.dat, error = {1}", PathName, e.Message);
|
||||
}
|
||||
fs.Close();
|
||||
return cfg;
|
||||
}
|
||||
public string GetDefFmt()
|
||||
{
|
||||
return DefaultPlantFmt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataLoader</RootNamespace>
|
||||
<AssemblyName>DataLoader</AssemblyName>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</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>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</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="C1.Win.C1FlexGrid.2, Version=2.6.20142.835, Culture=neutral, PublicKeyToken=79882d576c6336da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Csla, Version=2.1.4.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\csla20cs-2.1.4-070223\csla20cs\csla20cs\Csla\bin\Debug\Csla.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\..\Proms3rdPartyLibraries\Ionic\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>bin\Debug\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.SqlServer.ConnectionInfo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Applicability.cs" />
|
||||
<Compile Include="Approve.cs" />
|
||||
<Compile Include="ConfigInfo.cs" />
|
||||
<Compile Include="ConversionRTBProblems.cs" />
|
||||
<Compile Include="CurSet.cs" />
|
||||
<Compile Include="DataLoaderGlitches.cs" />
|
||||
<Compile Include="DataLoaderSettings.cs" />
|
||||
<Compile Include="dlgExportImport.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="dlgExportImport.designer.cs">
|
||||
<DependentUpon>dlgExportImport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ErrorReport.cs" />
|
||||
<Compile Include="FixItem.cs" />
|
||||
<Compile Include="FolderTreeNode.cs" />
|
||||
<Compile Include="Documents.cs">
|
||||
</Compile>
|
||||
<Compile Include="Formats.cs" />
|
||||
<Compile Include="frmCntTkn.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmCntTkn.designer.cs">
|
||||
<DependentUpon>frmCntTkn.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmErrors.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmErrors.designer.cs">
|
||||
<DependentUpon>frmErrors.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmLoader.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmLoader.Designer.cs">
|
||||
<DependentUpon>frmLoader.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmPG.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmPG.designer.cs">
|
||||
<DependentUpon>frmPG.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GroupProp.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GroupProp.Designer.cs">
|
||||
<DependentUpon>GroupProp.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LibDoc.cs">
|
||||
</Compile>
|
||||
<Compile Include="LoadConfig.cs">
|
||||
</Compile>
|
||||
<Compile Include="Loader.cs" />
|
||||
<Compile Include="LoadTreeNh.cs">
|
||||
</Compile>
|
||||
<Compile Include="OutsideTransition.cs" />
|
||||
<Compile Include="PrivateProfile.cs" />
|
||||
<Compile Include="Procedures.cs">
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="dlgExportImport.resx">
|
||||
<DependentUpon>dlgExportImport.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmCntTkn.resx">
|
||||
<DependentUpon>frmCntTkn.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmErrors.resx">
|
||||
<DependentUpon>frmErrors.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmLoader.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>frmLoader.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmPG.resx">
|
||||
<DependentUpon>frmPG.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GroupProp.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>GroupProp.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="App.config" />
|
||||
<None Include="BuildVEPROMS.Sql">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
<None Include="PROMS2010.SQL">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="PROMSApproveApprove.sql">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="PROMSFixes.Sql">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="PROMStoAPPR.sql">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="PROMStoCM.sql">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="RefObjs.cs">
|
||||
</Compile>
|
||||
<Compile Include="RichTextBox41.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RichTextBox41.Designer.cs">
|
||||
<DependentUpon>RichTextBox41.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ROFixer.cs" />
|
||||
<Compile Include="ROFST.cs" />
|
||||
<Compile Include="SecObj.cs">
|
||||
</Compile>
|
||||
<Compile Include="Sections.cs">
|
||||
</Compile>
|
||||
<Compile Include="SQLScriptRunner.cs" />
|
||||
<Compile Include="Steps.cs">
|
||||
</Compile>
|
||||
<Compile Include="TextConvert.cs" />
|
||||
<Compile Include="TransitionFixer.cs" />
|
||||
<Compile Include="Transitions.cs">
|
||||
</Compile>
|
||||
<Compile Include="LoadTreeDB.cs">
|
||||
</Compile>
|
||||
<Compile Include="DocVersions.cs">
|
||||
</Compile>
|
||||
<Compile Include="UIFileNameEditor.cs" />
|
||||
<Compile Include="WordDocument.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LBWordLibrary\LBWordLibrary.csproj">
|
||||
<Project>{70F23722-19A3-4AC1-A900-55831C945786}</Project>
|
||||
<Name>LBWordLibrary</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VEPROMS.CSLA.Library\VEPROMS.CSLA.Library.csproj">
|
||||
<Project>{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}</Project>
|
||||
<Name>VEPROMS.CSLA.Library</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Volian.Base.Library\Volian.Base.Library.csproj">
|
||||
<Project>{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}</Project>
|
||||
<Name>Volian.Base.Library</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Volian.Controls.Library\Volian.Controls.Library.csproj">
|
||||
<Project>{8556527C-6615-487F-8AF7-22EBC3EF0268}</Project>
|
||||
<Name>Volian.Controls.Library</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Volian.Utils.Library\Volian.Utils.Library.csproj">
|
||||
<Project>{62314B9C-DA84-4037-8B68-AA18C1F641F5}</Project>
|
||||
<Name>Volian.Utils.Library</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="vlnControl.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,153 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataLoader", "DataLoader.csproj", "{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Utils.Library", "..\Volian.Utils.Library\Volian.Utils.Library.csproj", "{62314B9C-DA84-4037-8B68-AA18C1F641F5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEPROMS.CSLA.Library", "..\VEPROMS.CSLA.Library\VEPROMS.CSLA.Library.csproj", "{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPocalipse.IFilter", "..\EPocalipse.IFilter\EPocalipse.IFilter.csproj", "{400462CE-40B3-498F-B95A-B1D2AE679359}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LBWordLibrary", "..\LBWordLibrary\LBWordLibrary.csproj", "{70F23722-19A3-4AC1-A900-55831C945786}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Controls.Library", "..\Volian.Controls.Library\Volian.Controls.Library.csproj", "{8556527C-6615-487F-8AF7-22EBC3EF0268}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Base.Library", "..\Volian.Base.Library\Volian.Base.Library.csproj", "{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYPlots", "..\XYPlots\XYPlots.csproj", "{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SourceCodeControl) = preSolution
|
||||
SccNumberOfProjects = 7
|
||||
SccProjectUniqueName0 = ..\\Volian.Utils.Library\\Volian.Utils.Library.csproj
|
||||
SccProjectName0 = \u0022$/PROMS/Volian.Utils.Library\u0022,\u0020DICAAAAA
|
||||
SccLocalPath0 = ..\\Volian.Utils.Library
|
||||
SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName1 = ..\\VEPROMS.CSLA.Library\\VEPROMS.CSLA.Library.csproj
|
||||
SccProjectName1 = \u0022$/PROMS/VEPROMS.CSLA.Library\u0022,\u0020TPBAAAAA
|
||||
SccLocalPath1 = ..\\VEPROMS.CSLA.Library
|
||||
SccProvider1 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName2 = DataLoader.csproj
|
||||
SccProjectName2 = \u0022$/PROMS/DataLoader\u0022,\u0020IIAAAAAA
|
||||
SccLocalPath2 = .
|
||||
SccProvider2 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName3 = ..\\Volian.Controls.Library\\Volian.Controls.Library.csproj
|
||||
SccProjectName3 = \u0022$/PROMS/Volian.Controls.Library\u0022,\u0020TVBAAAAA
|
||||
SccLocalPath3 = ..\\Volian.Controls.Library
|
||||
SccProvider3 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName4 = ..\\LBWordLibrary\\LBWordLibrary.csproj
|
||||
SccProjectName4 = \u0022$/PROMS/LBWordLibrary\u0022,\u0020QUDAAAAA
|
||||
SccLocalPath4 = ..\\LBWordLibrary
|
||||
SccProvider4 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName5 = ..\\Volian.Base.Library\\Volian.Base.Library.csproj
|
||||
SccProjectName5 = \u0022$/PROMS/Volian.Base.Library\u0022,\u0020QJEAAAAA
|
||||
SccLocalPath5 = ..\\Volian.Base.Library
|
||||
SccProvider5 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
SccProjectUniqueName6 = ..\\XYPlots\\XYPlots.csproj
|
||||
SccProjectName6 = \u0022$/PROMS/XYPlots\u0022,\u0020BRDAAAAA
|
||||
SccLocalPath6 = ..\\XYPlots
|
||||
SccProvider6 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Demo|Any CPU = Demo|Any CPU
|
||||
Demo|x86 = Demo|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Demo|x86.ActiveCfg = Debug|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|Any CPU.Build.0 = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Demo|x86.ActiveCfg = Debug|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Debug|x86.Build.0 = Debug|x86
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|Any CPU.Build.0 = Demo|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.ActiveCfg = Demo|x86
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Demo|x86.Build.0 = Demo|x86
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.ActiveCfg = Release|x86
|
||||
{41B2D786-1C03-4C1A-9247-DA9F0D6B06D5}.Release|x86.Build.0 = Release|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Debug|x86.Build.0 = Debug|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|Any CPU.Build.0 = Demo|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|x86.ActiveCfg = Demo|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Demo|x86.Build.0 = Demo|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Release|x86.ActiveCfg = Release|x86
|
||||
{400462CE-40B3-498F-B95A-B1D2AE679359}.Release|x86.Build.0 = Release|x86
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Demo|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Demo|Any CPU.Build.0 = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Demo|x86.ActiveCfg = Debug|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{70F23722-19A3-4AC1-A900-55831C945786}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|x86.Build.0 = Debug|x86
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|Any CPU.Build.0 = Demo|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|x86.ActiveCfg = Demo|x86
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Demo|x86.Build.0 = Demo|x86
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|x86.ActiveCfg = Release|x86
|
||||
{8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|x86.Build.0 = Release|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Debug|x86.Build.0 = Debug|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|Any CPU.ActiveCfg = Debug|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|x86.ActiveCfg = Debug|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Demo|x86.Build.0 = Debug|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|x86.ActiveCfg = Release|x86
|
||||
{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}.Release|x86.Build.0 = Release|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|x86.Build.0 = Debug|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|Any CPU.ActiveCfg = Demo|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|Any CPU.Build.0 = Demo|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|x86.ActiveCfg = Demo|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Demo|x86.Build.0 = Demo|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|x86.ActiveCfg = Release|x86
|
||||
{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,213 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Schema;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
[XmlRoot("DataLoaderGlitches")]
|
||||
//[Serializable()]
|
||||
public class DataLoaderGlitches
|
||||
{
|
||||
private Glitches _Glitches;
|
||||
|
||||
public Glitches Glitches
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Glitches == null) _Glitches = new Glitches();
|
||||
return _Glitches;
|
||||
}
|
||||
set { _Glitches = value; }
|
||||
}
|
||||
public void Add(string cause, string originalText, string newText)
|
||||
{
|
||||
Glitches.Add(cause, originalText, newText);
|
||||
}
|
||||
public void Save(string fileName)
|
||||
{
|
||||
XmlSerializer<DataLoaderGlitches>.WriteFile(this, fileName);
|
||||
}
|
||||
public static DataLoaderGlitches LoadProblems(string fileName)
|
||||
{
|
||||
return XmlSerializer<DataLoaderGlitches>.ReadFile(fileName);
|
||||
}
|
||||
}
|
||||
public class Glitches : List<Glitch>
|
||||
{
|
||||
public void Add(string cause, string originalText, string newText)
|
||||
{
|
||||
base.Add(new Glitch(cause, originalText, newText));
|
||||
}
|
||||
}
|
||||
public class Glitch
|
||||
{
|
||||
public Glitch()
|
||||
{
|
||||
}
|
||||
public Glitch(string cause, string originalText, string newText)
|
||||
{
|
||||
_Cause = cause;
|
||||
_OriginalText = originalText;
|
||||
_NewText = newText;
|
||||
}
|
||||
private string _Cause;
|
||||
[XmlAttribute("Cause")]
|
||||
public string Cause
|
||||
{
|
||||
get { return _Cause; }
|
||||
set { _Cause = value; }
|
||||
}
|
||||
private string _OriginalText;
|
||||
[XmlAttribute("OriginalText")]
|
||||
public string OriginalText
|
||||
{
|
||||
get { return _OriginalText; }
|
||||
set { _OriginalText = value; }
|
||||
}
|
||||
private string _NewText;
|
||||
[XmlAttribute("NewText")]
|
||||
public string NewText
|
||||
{
|
||||
get { return _NewText; }
|
||||
set { _NewText = value; }
|
||||
}
|
||||
private string _Comparison;
|
||||
[XmlIgnore]
|
||||
public string Comparison
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Comparison == null)
|
||||
_Comparison = GetComparison(_OriginalText, _NewText);
|
||||
return _Comparison;
|
||||
}
|
||||
}
|
||||
private string GetComparison(string str1, string str2)
|
||||
{
|
||||
if(str1 == str2)return str1;
|
||||
int endMatch = 0;
|
||||
int l1 = str1.Length;
|
||||
int l2 = str2.Length;
|
||||
int min = l1 > l2 ? l2 : l1;
|
||||
int startMatch = min;
|
||||
for(int i = 0; i< min; i++)
|
||||
if (str1[i] != str2[i])
|
||||
{
|
||||
startMatch = i;
|
||||
break;
|
||||
}
|
||||
for (int i = 1; i < min; i++)
|
||||
if (str1[l1-i] != str2[l2-i])
|
||||
{
|
||||
endMatch = i-1;
|
||||
break;
|
||||
}
|
||||
string prefix = str1.Substring(0, startMatch);
|
||||
string part1 = str1.Substring(startMatch, l1 - (startMatch + endMatch));
|
||||
string part2 = str2.Substring(startMatch, l2 - (startMatch + endMatch));
|
||||
string suffix = str1.Substring(l1 - endMatch, endMatch);
|
||||
_Delta = "<<<" + part1 + "|||" + part2 + ">>>";
|
||||
return prefix + "\r\n<<<" + part1 + "|||" + part2 + ">>>\r\n" + suffix;
|
||||
}
|
||||
private string _Delta = null;
|
||||
public override string ToString()
|
||||
{
|
||||
if (Comparison == null) { ;} // This gets the Comparsion and sets _Delta
|
||||
return _Delta;
|
||||
}
|
||||
}
|
||||
public static class XmlSerializer<T> where T : class
|
||||
{
|
||||
public static string StringSerialize(T t)
|
||||
{
|
||||
string strOutput = string.Empty;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
xs.Serialize(new NonXsiTextWriter(ms, Encoding.UTF8), t);
|
||||
//xs.Serialize(ms, t);
|
||||
ms.Position = 0;
|
||||
StreamReader sr = new StreamReader(ms);
|
||||
strOutput = sr.ReadToEnd();
|
||||
ms.Close();
|
||||
}
|
||||
return strOutput;
|
||||
}
|
||||
public static T StringDeserialize(string s)
|
||||
{
|
||||
T t;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
|
||||
UTF8Encoding enc = new UTF8Encoding();
|
||||
Byte[] arrBytData = enc.GetBytes(s);
|
||||
using (MemoryStream ms = new MemoryStream(arrBytData))
|
||||
{
|
||||
t = (T)xs.Deserialize(ms);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
public static void WriteFile(T t, string fileName)
|
||||
{
|
||||
string strOutput = string.Empty;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
|
||||
using (FileStream fs = new FileStream(fileName, FileMode.Create))
|
||||
{
|
||||
xs.Serialize(new NonXsiTextWriter(fs, Encoding.UTF8), t);
|
||||
fs.Close();
|
||||
}
|
||||
}
|
||||
public static T ReadFile(string fileName)
|
||||
{
|
||||
T t;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.volian.com");
|
||||
using (FileStream fs = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
t = (T)xs.Deserialize(fs);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
public class NonXsiTextWriter : XmlTextWriter
|
||||
{
|
||||
public NonXsiTextWriter(TextWriter w) : base(w) { }
|
||||
public NonXsiTextWriter(Stream w, Encoding encoding)
|
||||
: base(w, encoding)
|
||||
{
|
||||
this.Formatting = Formatting.Indented;
|
||||
}
|
||||
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
||||
bool _skip = false;
|
||||
public override void WriteStartAttribute(string prefix, string localName, string ns)
|
||||
{
|
||||
if ((prefix == "xmlns" && (localName == "xsd" || localName == "xsi")) || // Omits XSD and XSI declarations.
|
||||
ns == XmlSchema.InstanceNamespace) // Omits all XSI attributes.
|
||||
{
|
||||
_skip = true;
|
||||
return;
|
||||
}
|
||||
if (localName == "xlink_href")
|
||||
base.WriteStartAttribute(prefix, "xlink:href", ns);
|
||||
else
|
||||
base.WriteStartAttribute(prefix, localName, ns);
|
||||
}
|
||||
public override void WriteString(string text)
|
||||
{
|
||||
if (_skip) return;
|
||||
base.WriteString(text);
|
||||
}
|
||||
public override void WriteEndAttribute()
|
||||
{
|
||||
if (_skip)
|
||||
{ // Reset the flag, so we keep writing.
|
||||
_skip = false;
|
||||
return;
|
||||
}
|
||||
base.WriteEndAttribute();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,710 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
using System.Reflection;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
[Serializable]
|
||||
class DataLoaderSettings:ICloneable
|
||||
{
|
||||
private static List<string> _MyDataPaths = Loader.DataPaths;
|
||||
#region Clone
|
||||
public object Clone()
|
||||
{
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
|
||||
binaryFormatter.Serialize(memoryStream, this);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
return binaryFormatter.Deserialize(memoryStream);
|
||||
}
|
||||
#endregion
|
||||
#region 16-Bit Executable
|
||||
private string _VEPromsPath; // Folder
|
||||
[Category("16-Bit Executable")]
|
||||
[DisplayName("VEProms Exe Folder")]
|
||||
[Description("Path to the VE-PROMS Executable Folder")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string VEPromsPath
|
||||
{
|
||||
get { return _VEPromsPath; }
|
||||
set { _VEPromsPath = value; }
|
||||
}
|
||||
private string _VESamFile; // File
|
||||
[Category("16-Bit Executable")]
|
||||
[DisplayName("VEProms Security File")]
|
||||
[Description("VE-PROMS Securty File (VESam)")]
|
||||
[UIFilenameEditor.FileDialogFilterAttribute("VEProms Security File|vesam.opt")]
|
||||
[EditorAttribute(typeof(UIFilenameEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string VESamFile
|
||||
{
|
||||
get { return _VESamFile; }
|
||||
set { _VESamFile = value; }
|
||||
}
|
||||
#endregion
|
||||
#region 16-Bit Data
|
||||
private string _ProcedureSetPath; // Folder
|
||||
[Category("16-Bit Data")]
|
||||
[DisplayName("Procedure Folder")]
|
||||
[Description("Path to the Data Set being converted")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string ProcedureSetPath
|
||||
{
|
||||
get { return _ProcedureSetPath; }
|
||||
set { _ProcedureSetPath = value; }
|
||||
}
|
||||
private bool _OnlyThisSet; // Boolean
|
||||
[Category("16-Bit Data")]
|
||||
[DisplayName("Only Process this Procedure Set")]
|
||||
[Description("Only Convert the Selected Procedure Set")]
|
||||
public bool OnlyThisSet
|
||||
{
|
||||
get { return _OnlyThisSet; }
|
||||
set { _OnlyThisSet = value; }
|
||||
}
|
||||
private bool _LoadApproved; // Boolean
|
||||
[Category("16-Bit Data")]
|
||||
[DisplayName("Load approved data for this Procedure Set")]
|
||||
[Description("Load approved PDFs (if they exist) and consistency checks for the Selected Procedure Set")]
|
||||
public bool LoadApproved
|
||||
{
|
||||
get { return _LoadApproved; }
|
||||
set { _LoadApproved = value; }
|
||||
}
|
||||
private string _ProcessOnlyInLocation; // Folder
|
||||
[Category("16-Bit Data")]
|
||||
[DisplayName("Process Only In Location")]
|
||||
[Description("Limit to folder or group of folders (otherwise all plants will be processed)")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string ProcessOnlyInLocation
|
||||
{
|
||||
get { return _ProcessOnlyInLocation; }
|
||||
set { _ProcessOnlyInLocation = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Format Data
|
||||
private string _FormatFolder; // Folder
|
||||
[Category("Format Data")]
|
||||
[DisplayName("Format Folder")]
|
||||
[Description("Location of XML Format Files.")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string FormatFolder
|
||||
{
|
||||
get { return _FormatFolder; }
|
||||
set { _FormatFolder = value; }
|
||||
}
|
||||
private string _GenMacFolder; // Folder
|
||||
[Category("Format Data")]
|
||||
[DisplayName("GenMac Folder")]
|
||||
[Description("Location of XML (SVG) GenMac Macro Files.")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string GenMacFolder
|
||||
{
|
||||
get { return _GenMacFolder; }
|
||||
set { _GenMacFolder = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Backup Data
|
||||
private string _BackupFileName; // String
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Backup File Name")]
|
||||
[Description("Name of Backup File in the batch files created in the Log Folder")]
|
||||
public string BackupFileName
|
||||
{
|
||||
get { return _BackupFileName; }
|
||||
set { _BackupFileName = value; }
|
||||
}
|
||||
private string _BackupFolder; // Folder
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Backup Folder")]
|
||||
[Description("Location of Backup Files created during each phase of the conversion process.")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string BackupFolder
|
||||
{
|
||||
get { return _BackupFolder; }
|
||||
set { _BackupFolder = value; }
|
||||
}
|
||||
private string _Phase1Suffix; // String
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Phase 1 Suffix")]
|
||||
[Description("Suffix to use for backup before Transitions are Fixed")]
|
||||
public string Phase1Suffix
|
||||
{
|
||||
get { return _Phase1Suffix; }
|
||||
set { _Phase1Suffix = value; }
|
||||
}
|
||||
private string _Phase2Suffix; // String
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Phase 2 Suffix")]
|
||||
[Description("Suffix to use for backup before Change Manager Script")]
|
||||
public string Phase2Suffix
|
||||
{
|
||||
get { return _Phase2Suffix; }
|
||||
set { _Phase2Suffix = value; }
|
||||
}
|
||||
private string _Phase3Suffix; // String
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Phase 3 Suffix")]
|
||||
[Description("Suffix to use for backup before Approval Script")]
|
||||
public string Phase3Suffix
|
||||
{
|
||||
get { return _Phase3Suffix; }
|
||||
set { _Phase3Suffix = value; }
|
||||
}
|
||||
private string _Phase4Suffix; // String
|
||||
[Category("Backup Data")]
|
||||
[DisplayName("Phase 4 Suffix")]
|
||||
[Description("Suffix to use for backup before Loading Approved Data")]
|
||||
public string Phase4Suffix
|
||||
{
|
||||
get { return _Phase4Suffix; }
|
||||
set { _Phase4Suffix = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Process Log
|
||||
private string _LogFilePath; // Folder
|
||||
[Category("Process Log")]
|
||||
[DisplayName("Log File Folder")]
|
||||
[Description("Location of the Log Files")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string LogFilePath
|
||||
{
|
||||
get { return _LogFilePath; }
|
||||
set { _LogFilePath = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Sql Database
|
||||
private string _ConnectionString; // String
|
||||
[Category("Sql Database")]
|
||||
[DisplayName("SQL Connection String")]
|
||||
[Description("Connection string for SQL")]
|
||||
public string ConnectionString
|
||||
{
|
||||
get { return _ConnectionString; }
|
||||
set { _ConnectionString = value; }
|
||||
}
|
||||
private string _DBName; // String
|
||||
[Category("Sql Database")]
|
||||
[DisplayName("Database Name")]
|
||||
[Description("Name of the Database that will be created to contain the converted data.")]
|
||||
public string DBName
|
||||
{
|
||||
get { return _DBName; }
|
||||
set { _DBName = value; }
|
||||
}
|
||||
private string _DBPath; // Folder
|
||||
[Category("Sql Database")]
|
||||
[DisplayName("Database File Folder")]
|
||||
[Description("Location of the Database files.")]
|
||||
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public string DBPath
|
||||
{
|
||||
get { return _DBPath; }
|
||||
set { _DBPath = value; }
|
||||
}
|
||||
private bool _PurgeExistingData;
|
||||
[Category("Sql Database")]
|
||||
[DisplayName("Purge Existing Data")]
|
||||
[Description("Should the data in the SQL database be purged (emptied) before adding this data.")]
|
||||
public bool PurgeExistingData
|
||||
{
|
||||
get { return _PurgeExistingData; }
|
||||
set { _PurgeExistingData = value; }
|
||||
}
|
||||
#endregion
|
||||
//#region PDFs
|
||||
//private string _PDFFolder; // Folder
|
||||
//[Category("PDFs")]
|
||||
//[DisplayName("PDF Folder")]
|
||||
//[Description("Location for PDFs when printing.")]
|
||||
//[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
//public string PDFFolder
|
||||
//{
|
||||
// get { return _PDFFolder; }
|
||||
// set { _PDFFolder = value; }
|
||||
//}
|
||||
//#endregion
|
||||
#region Debugging
|
||||
private ExecutionMode _ExecutionMode;
|
||||
[TypeConverter(typeof(EnumDescConverter))]
|
||||
[DisplayName("Execution Mode")]
|
||||
[Category("Debugging")]
|
||||
[Description("Mode for Conversion")]
|
||||
public ExecutionMode ExecutionMode
|
||||
{
|
||||
get { return _ExecutionMode; }
|
||||
set { _ExecutionMode = value; }
|
||||
}
|
||||
private bool _CheckRTF;
|
||||
[DisplayName("Check RTF")]
|
||||
[Category("Debugging")]
|
||||
[Description("This makes the Fix Transtion Code work Differently. Not sure what it does.")]
|
||||
public bool CheckRTF
|
||||
{
|
||||
get { return _CheckRTF; }
|
||||
set { _CheckRTF = value; }
|
||||
}
|
||||
private int _Skip; // Skip specified procedures during load.
|
||||
[DisplayName("Skip First n Procedures")]
|
||||
[Category("Debugging")]
|
||||
[Description("Skip the specified number of procedures during conversion to get to a problem quicker.")]
|
||||
public int Skip
|
||||
{
|
||||
get { return _Skip; }
|
||||
set { _Skip = value; }
|
||||
}
|
||||
private int _HowMany=0; // Skip specified procedures during load.
|
||||
[DisplayName("How Many Procedures should be converted")]
|
||||
[Category("Debugging")]
|
||||
[Description("Only process part of the set.")]
|
||||
public int HowMany
|
||||
{
|
||||
get { return _HowMany; }
|
||||
set { _HowMany = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Accessory Pages
|
||||
private AccPageConversion _ConvertTo;
|
||||
[TypeConverter(typeof(EnumDescConverter))]
|
||||
[DisplayName("Convert To")]
|
||||
[Category("Accessory Pages")]
|
||||
[Description("Format to which the Accessory Page converted")]
|
||||
public AccPageConversion ConvertTo
|
||||
{
|
||||
get { return _ConvertTo; }
|
||||
set { _ConvertTo = value; }
|
||||
}
|
||||
private bool _RedPDFs; // Boolean
|
||||
[Category("Accessory Pages")]
|
||||
[DisplayName("Print MSWord PDFs in Red")]
|
||||
[Description("Creates Word PDFs in Debug Mode so that Debug printing will not require Word to print again.")]
|
||||
public bool RedPDFs
|
||||
{
|
||||
get { return _RedPDFs; }
|
||||
set { _RedPDFs = value; }
|
||||
}
|
||||
#endregion
|
||||
#region RO Update
|
||||
private ROUpdateMode _WhatROsToConvert = 0;
|
||||
[Category("RO Update")]
|
||||
[DisplayName("What ROs To Convert")]
|
||||
[Description("Select which ROs should be converted.")]
|
||||
public ROUpdateMode WhatROsToConvert
|
||||
{
|
||||
get { return _WhatROsToConvert; }
|
||||
set { _WhatROsToConvert = value; }
|
||||
}
|
||||
private int _SelectedROFst = -1;
|
||||
[Category("RO Update")]
|
||||
[DisplayName("Selected ROFst")]
|
||||
[Description("Enter which ROFstID is the basis for the original text (-1 = None).")]
|
||||
public int SelectedROFst
|
||||
{
|
||||
get { return _SelectedROFst; }
|
||||
set { _SelectedROFst = value; }
|
||||
}
|
||||
private bool _AnnotateWhenConvertingToText;
|
||||
[Category("RO Update")]
|
||||
[DisplayName("Annotate When Converting To Text")]
|
||||
[Description("Should the step have annotation when the ro data has been converted to text.")]
|
||||
public bool AnnotateWhenConvertingToText
|
||||
{
|
||||
get { return _AnnotateWhenConvertingToText; }
|
||||
set { _AnnotateWhenConvertingToText = value; }
|
||||
}
|
||||
private bool _AnnotateWhenShowingMissingRO;
|
||||
[Category("RO Update")]
|
||||
[DisplayName("Annotate When Showing Missing RO")]
|
||||
[Description("Should the step have annotation when the ro data is missing and is being displayed as a question mark.")]
|
||||
public bool AnnotateWhenShowingMissingRO
|
||||
{
|
||||
get { return _AnnotateWhenShowingMissingRO; }
|
||||
set { _AnnotateWhenShowingMissingRO = value; }
|
||||
}
|
||||
private bool _AnnotateWhenShowingDifferentRO;
|
||||
[Category("RO Update")]
|
||||
[DisplayName("Annotate When Showing Different RO")]
|
||||
[Description("Should the step have annotation when the ro data is different.")]
|
||||
public bool AnnotateWhenShowingDifferentRO
|
||||
{
|
||||
get { return _AnnotateWhenShowingDifferentRO; }
|
||||
set { _AnnotateWhenShowingDifferentRO = value; }
|
||||
}
|
||||
#endregion
|
||||
[Browsable(false)]
|
||||
public string ValidityCheck
|
||||
{
|
||||
get
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string ErrorPrefix = "Settings are not valid\r\n";
|
||||
// VEPromsPath = has to be non-blank
|
||||
if ((VEPromsPath ?? "") == "" || !Directory.Exists(VEPromsPath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "VEProms Exe Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// VESamFile = has to be non-blank
|
||||
if ((VESamFile ?? "") == "" || !File.Exists(VESamFile))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "VEProms Security File must point to an existing file\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// ProcedureSetPath = If OnlyThisSet is checked, then has to be non-blank
|
||||
if (OnlyThisSet)
|
||||
{
|
||||
if ((ProcedureSetPath ?? "") == "" || !Directory.Exists(ProcedureSetPath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Procedure Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!InDataPaths(ProcedureSetPath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + string.Format("Procedure Folder not in DataPath from Config File '{0}' \r\n", DataLoaderSettings._MyDataPaths[0]));
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
else if (!File.Exists(ProcedureSetPath + @"\set.dbf"))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Procedure Folder must point to an existing procedure data folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ProcedureSetPath ?? "") == "" || !Directory.Exists(ProcedureSetPath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Procedure Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!InDataPaths(ProcedureSetPath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + string.Format("Procedure Folder not in DataPath from Config File '{0}' \r\n", DataLoaderSettings._MyDataPaths[0]));
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
//added by jcb 20121127
|
||||
//check is ProcedureSetPath contains ProcessOnlyInLocation
|
||||
if (ProcedureSetPath != null && ProcedureSetPath.StartsWith(ProcessOnlyInLocation ?? "") == false)
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Check Process Only In Location value is pointing to similar directory as Procedure Set Path\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
//end added by jcb 20121127
|
||||
// BackupFileName = Has to be non-blank
|
||||
if ((BackupFileName ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Backup File Name must not be blank\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
if ((Phase1Suffix ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Phase 1 Suffix must not be blank\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
if ((Phase2Suffix ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Phase 2 Suffix must not be blank\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
if ((Phase3Suffix ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Phase 3 Suffix must not be blank\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// BackupFolder = Has to be non-blank
|
||||
if (OnlyThisSet && (BackupFolder ?? "") == "" || !Directory.Exists(BackupFolder))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Backup Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// FormatFolder = Has to be non-blank
|
||||
if (OnlyThisSet && (FormatFolder ?? "") == "" || !Directory.Exists(FormatFolder))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Format Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// GenMacFolder = Has to be non-blank
|
||||
if (OnlyThisSet && (GenMacFolder ?? "") == "" || !Directory.Exists(GenMacFolder))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "GenMac Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// LogFilePath = Has to be non-blank
|
||||
if (OnlyThisSet && (LogFilePath ?? "") == "" || !Directory.Exists(LogFilePath))
|
||||
{
|
||||
sb.Append(ErrorPrefix + "Log File Folder must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// ConnectionString = Has to be non-blank
|
||||
if ((ConnectionString ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Validate ConnectionString
|
||||
string checkConnectionString = ValidateConnectionString("Master");
|
||||
if (checkConnectionString != "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
|
||||
sb.Append(checkConnectionString);
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
}
|
||||
// DBName = Has to be non-blank
|
||||
if ((DBName ?? "") == "")
|
||||
{
|
||||
sb.Append(ErrorPrefix + "SQL Database Name must be a valid database name\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
// DBPath = if null check to see if DBName DB has Path, if it does then set DBPath
|
||||
if ((DBPath ?? "") == "" || !Directory.Exists(DBPath))
|
||||
{
|
||||
string filePath = GetDBFileName();
|
||||
if (filePath != null)
|
||||
{
|
||||
FileInfo fi = new FileInfo(filePath);
|
||||
DBPath = fi.DirectoryName;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(ErrorPrefix + "SQL Database Path must point to an existing folder\r\n");
|
||||
ErrorPrefix = "";
|
||||
}
|
||||
}
|
||||
// PDFFolder = if not set, then don't set PDFFolder in DocVersion.Config
|
||||
//if (ExecutionMode == ExecutionMode.Debug && ((PDFFolder ?? "") == "" || !Directory.Exists(PDFFolder)))
|
||||
//{
|
||||
// sb.Append(ErrorPrefix + "PDF Folder must point to an existing folder in debug mode\r\n");
|
||||
// ErrorPrefix = "";
|
||||
//}
|
||||
// Skip = Any NUmber
|
||||
// PurgeExistingData = N/A
|
||||
// OnlyThisSet = N/A
|
||||
// CheckRTF = N/A
|
||||
// ConvertTo = N/A
|
||||
// RedPDFs = N/A
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
private bool InDataPaths(string ProcedureSetPath)
|
||||
{
|
||||
foreach (string dp in _MyDataPaths)
|
||||
if (ProcedureSetPath.ToUpper().StartsWith(dp.ToUpper())) return true;
|
||||
return false;
|
||||
}
|
||||
private string ValidateConnectionString(string dbName)
|
||||
{
|
||||
if(!ConnectionString.Contains("{DBName}"))
|
||||
return " Needs to have a {DBName} token for the Initial Catalog";
|
||||
string cnstr = ConnectionString.Replace("{DBName}", dbName);
|
||||
try
|
||||
{
|
||||
SqlConnection cn = new SqlConnection(cnstr);
|
||||
cn.Open();
|
||||
cn.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (ex != null)
|
||||
{
|
||||
sb.Append(string.Format(" {0}-{1}",ex.GetType().Name,ex.Message));
|
||||
ex = ex.InnerException;
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private string GetDBFileName()
|
||||
{
|
||||
string filename = null;
|
||||
SqlConnection cn = new SqlConnection(ConnectionString.Replace("{DBName}","Master"));
|
||||
cn.Open();
|
||||
string cmd = string.Format("Select FileName from sysdatabases where Name = '{0}'",DBName);
|
||||
SqlDataAdapter da = new SqlDataAdapter(cmd,cn);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
if (ds.Tables.Count == 1 && ds.Tables[0].Rows.Count == 1)
|
||||
filename = ds.Tables[0].Rows[0][0].ToString();
|
||||
cn.Close();
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
public enum AccPageConversion : int
|
||||
{
|
||||
[Description("Don't Convert")] DoNotConvert=0,
|
||||
[Description("MS Word")] MSWord = 1,
|
||||
[Description("Rich Text Format")] RichTextFormat = 2
|
||||
}
|
||||
public enum ExecutionMode : int
|
||||
{
|
||||
[Description("Debug")] Debug = 0,
|
||||
[Description("Production")] Production = 1,
|
||||
}
|
||||
public enum ROUpdateMode : int
|
||||
{
|
||||
[Description("None")]
|
||||
None = 0,
|
||||
[Description("Missing")]
|
||||
Missing = 1,
|
||||
[Description("All")]
|
||||
All = 2,
|
||||
}
|
||||
|
||||
public class EnumDescConverter : System.ComponentModel.EnumConverter
|
||||
{
|
||||
protected System.Type myVal;
|
||||
|
||||
/// <summary>
|
||||
/// Gets Enum Value's Description Attribute
|
||||
/// </summary>
|
||||
/// <param name="value">The value you want the description attribute for</param>
|
||||
/// <returns>The description, if any, else it's .ToString()</returns>
|
||||
public static string GetEnumDescription(Enum value)
|
||||
{
|
||||
//Console.WriteLine("{0}", value);
|
||||
FieldInfo fi = value.GetType().GetField(value.ToString());
|
||||
DescriptionAttribute[] attributes =
|
||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
typeof(DescriptionAttribute), false);
|
||||
//Console.WriteLine("{0},{1},{2}", value.ToString(), attributes.Length, (attributes.Length > 0) ? attributes[0].Description : value.ToString());
|
||||
return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description for certaing named value in an Enumeration
|
||||
/// </summary>
|
||||
/// <param name="value">The type of the Enumeration</param>
|
||||
/// <param name="name">The name of the Enumeration value</param>
|
||||
/// <returns>The description, if any, else the passed name</returns>
|
||||
public static string GetEnumDescription(System.Type value, string name)
|
||||
{
|
||||
FieldInfo fi = value.GetField(name);
|
||||
DescriptionAttribute[] attributes =
|
||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
typeof(DescriptionAttribute), false);
|
||||
return (attributes.Length > 0) ? attributes[0].Description : name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of an Enum, based on it's Description Attribute or named value
|
||||
/// </summary>
|
||||
/// <param name="value">The Enum type</param>
|
||||
/// <param name="description">The description or name of the element</param>
|
||||
/// <returns>The value, or the passed in description, if it was not found</returns>
|
||||
public static object GetEnumValue(System.Type value, string description)
|
||||
{
|
||||
FieldInfo[] fis = value.GetFields();
|
||||
foreach (FieldInfo fi in fis)
|
||||
{
|
||||
DescriptionAttribute[] attributes =
|
||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
typeof(DescriptionAttribute), false);
|
||||
if (attributes.Length > 0)
|
||||
{
|
||||
if (attributes[0].Description == description)
|
||||
{
|
||||
return fi.GetValue(fi.Name);
|
||||
}
|
||||
}
|
||||
if (fi.Name == description)
|
||||
{
|
||||
return fi.GetValue(fi.Name);
|
||||
}
|
||||
}
|
||||
return description;
|
||||
}
|
||||
|
||||
public EnumDescConverter(System.Type type)
|
||||
: base(type.GetType())
|
||||
{
|
||||
myVal = type;
|
||||
}
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (value is Enum && destinationType == typeof(string))
|
||||
{
|
||||
return EnumDescConverter.GetEnumDescription((Enum)value);
|
||||
}
|
||||
if (value is string && destinationType == typeof(string))
|
||||
{
|
||||
return EnumDescConverter.GetEnumDescription(myVal, (string)value);
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
if (value is string)
|
||||
{
|
||||
return EnumDescConverter.GetEnumValue(myVal, (string)value);
|
||||
}
|
||||
if (value is Enum)
|
||||
{
|
||||
return EnumDescConverter.GetEnumDescription((Enum)value);
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
ArrayList values = new ArrayList();
|
||||
FieldInfo[] fis = myVal.GetFields();
|
||||
foreach (FieldInfo fi in fis)
|
||||
{
|
||||
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
typeof(DescriptionAttribute), false);
|
||||
//if (attributes.Length > 0)
|
||||
if (fi.Name != "value__")
|
||||
values.Add(fi.GetValue(fi.Name));
|
||||
}
|
||||
return new TypeConverter.StandardValuesCollection(values);
|
||||
}
|
||||
public static string GetEnumKeyDescription(Enum value)
|
||||
{
|
||||
FieldInfo fi = value.GetType().GetField(value.ToString());
|
||||
DescriptionAttribute[] attributes =
|
||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
typeof(DescriptionAttribute), false);
|
||||
return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
|
||||
}
|
||||
|
||||
public static DataTable GetEnumAsDataTable(System.Type EnumType)
|
||||
{
|
||||
DataTable DTEnum = new DataTable();
|
||||
DTEnum.Columns.Add(new DataColumn("EnumID", typeof(Int32)));
|
||||
DTEnum.Columns.Add(new DataColumn("Enum", typeof(string)));
|
||||
DTEnum.Columns.Add(new DataColumn("Description", typeof(string)));
|
||||
foreach (int i in Enum.GetValues(EnumType))
|
||||
{
|
||||
System.Enum fooItem = (System.Enum)Enum.ToObject(EnumType, i);
|
||||
DTEnum.Rows.Add(new object[] { i, fooItem.ToString(), GetEnumKeyDescription(fooItem) });
|
||||
}
|
||||
return DTEnum;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public TimeSpan MigrateDocVersion(DocVersion docver)
|
||||
{
|
||||
return MigrateDocVersion(docver, true);
|
||||
}
|
||||
|
||||
private OutsideTransition _OutTran;
|
||||
public int MultiUnitCount = 0;
|
||||
public Dictionary<int, int> Old2NewApple;
|
||||
public Dictionary<int, int> New2OldApple;
|
||||
|
||||
public TimeSpan MigrateDocVersion(DocVersion docver, bool convertProcedures)
|
||||
{
|
||||
long lTime = DateTime.Now.Ticks;
|
||||
string pth = docver.Title;
|
||||
// if the Title is empty, return because this docversion has already been migrated.
|
||||
bool appending = false;
|
||||
if (frmMain.Automatic && !frmMain.PurgeExistingData)
|
||||
{
|
||||
pth = frmMain.ProcedureSetPath;
|
||||
appending = true;
|
||||
}
|
||||
if (pth == null || pth == "" || pth == "Title") return TimeSpan.FromTicks(0);
|
||||
MultiUnitCount = docver.DocVersionConfig.Unit_Count;
|
||||
if (MultiUnitCount > 0)
|
||||
{
|
||||
Old2NewApple = new Dictionary<int, int>();
|
||||
New2OldApple = new Dictionary<int, int>();
|
||||
for (int i = 1; i <= MultiUnitCount; i++)
|
||||
{
|
||||
docver.DocVersionConfig.SelectedSlave = i;
|
||||
int oldindex = int.Parse(docver.DocVersionConfig.Old_Index);
|
||||
Old2NewApple.Add(oldindex, i);
|
||||
New2OldApple.Add(i, oldindex);
|
||||
}
|
||||
}
|
||||
if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return TimeSpan.FromTicks(0);
|
||||
// Open connection
|
||||
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
|
||||
if (convertProcedures)
|
||||
{
|
||||
// JSJ 02/10/2010 - Remove all the .INF files before proceeding to convert.
|
||||
// The INF files contain a path to a corresponding NDX file - had data with bat NDX path
|
||||
DeleteINFFiles(pth);
|
||||
_OutTran = new OutsideTransition(cn);
|
||||
frmMain.AddInfo("Before MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
//if(!appending)
|
||||
MigrateROFST(pth, docver);
|
||||
GC.Collect();
|
||||
frmMain.AddInfo("After MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
// Migrate library documents
|
||||
//if(!appending)
|
||||
MigrateLibDocs(cn, pth, appending);
|
||||
|
||||
// if migrating bge, save the 'unit' number. This unit number is used in pagelist items and is
|
||||
// based on the path/directory name of the procedure set.
|
||||
if (true) // somehow check for BGE
|
||||
{
|
||||
SetDocVersionUnitConfig(pth, docver);
|
||||
}
|
||||
|
||||
|
||||
// Initialize Dictionaries
|
||||
dicTrans_ItemDone = new Dictionary<string, Item>();
|
||||
dicTrans_ItemIds = new Dictionary<string, Item>();
|
||||
dicTrans_MigrationErrors = new Dictionary<string, List<Item>>();
|
||||
|
||||
// Create a 'dummy' content record. This will be used for any transitions 'to'
|
||||
// that don't exist when dbf is processed. At end, use this to see if there
|
||||
// are missing transitions.
|
||||
TransDummyCont = Content.MakeContent(null, "DUMMY CONTENT FOR TRANSITION MIGRATION", null, null, null);
|
||||
}
|
||||
// Process Procedures
|
||||
Item itm = null;
|
||||
if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved)
|
||||
{
|
||||
ResetApplesToOranges();
|
||||
itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat);
|
||||
}
|
||||
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
|
||||
lTime = DateTime.Now.Ticks - lTime;
|
||||
if (convertProcedures)
|
||||
{
|
||||
ShowMissingTransitions(docver);
|
||||
//frmMain.Status = string.Format("{0}\r\nConversion completed in {1} seconds.", pth, TimeSpan.FromTicks(lTime).TotalSeconds);
|
||||
TimeSpan ts = TimeSpan.FromTicks(lTime);
|
||||
frmMain.Status = string.Format("{0}\r\nConversion completion time: {1:D2}:{2:D2}:{3:D2}.{4} ({5} Total Seconds)", pth, ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds, ts.TotalSeconds);
|
||||
log.InfoFormat("Completed Migration of {0}", pth);
|
||||
|
||||
//MessageBox.Show("Completed Migration of " + pth); //jsj commented out to let it run through
|
||||
if (rofstinfo != null) rofstinfo.GetROFSTLookup(DocVersionInfo.Get(docver.VersionID)).Close();
|
||||
dicTrans_ItemDone.Clear();
|
||||
dicTrans_ItemDone = null;
|
||||
}
|
||||
else
|
||||
frmMain.Status = string.Format("{0}\r\nDone.", pth);
|
||||
cn.Close();
|
||||
if (itm != null)
|
||||
{
|
||||
docver.MyItem = itm;
|
||||
if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
|
||||
if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
|
||||
//if(frmMain.MySettings.ExecutionMode == ExecutionMode.Debug)
|
||||
// docver.DocVersionConfig.Print_PDFLocation = frmMain.MySettings.PDFFolder;
|
||||
docver.Save();
|
||||
}
|
||||
return TimeSpan.FromTicks(lTime);
|
||||
}
|
||||
|
||||
private void SetDocVersionUnitConfig(string pth, DocVersion docver)
|
||||
{
|
||||
// the following 'rules' were taken from 16bit code, in pagelist.c, to define the unit number.
|
||||
|
||||
string unitNum = "0";
|
||||
string testPath = pth.ToUpper();
|
||||
|
||||
// back up further if this is a tmpchg or approved directory.
|
||||
int lastPart = pth.LastIndexOf(@"\");
|
||||
if (lastPart != -1)
|
||||
{
|
||||
testPath = testPath.Substring(testPath.LastIndexOf(@"\"));
|
||||
if (testPath.Contains("TMPCHG") || testPath.Contains("APPROVED"))
|
||||
testPath = testPath.Substring(testPath.LastIndexOf(@"\", lastPart));
|
||||
}
|
||||
if (testPath.IndexOf("PROCS2") > -1 || testPath.IndexOf("2.PRC") > -1)
|
||||
unitNum = "2";
|
||||
else if (testPath.IndexOf("PROCS") > -1 || testPath.IndexOf("1.PRC") > -1)
|
||||
unitNum = "1";
|
||||
else if (testPath.IndexOf("3.PRC") > -1)
|
||||
unitNum = "3";
|
||||
else if (testPath.IndexOf("4.PRC") > -1)
|
||||
unitNum = "4";
|
||||
|
||||
docver.DocVersionConfig.Print_UnitNumberForPageList = unitNum;
|
||||
docver.Save();
|
||||
}
|
||||
private void DeleteINFFiles(string pth)
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(pth);
|
||||
FileInfo [] myFiles = di.GetFiles("*.INF");
|
||||
foreach (FileInfo myFile in myFiles)
|
||||
myFile.Delete();
|
||||
}
|
||||
private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
|
||||
{
|
||||
if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
|
||||
if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
|
||||
if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
|
||||
return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public TimeSpan MigrateDocVersion(DocVersion docver)
|
||||
{
|
||||
return MigrateDocVersion(docver, true);
|
||||
}
|
||||
|
||||
private OutsideTransition _OutTran;
|
||||
public int MultiUnitCount = 0;
|
||||
public Dictionary<int, int> Old2NewApple;
|
||||
public Dictionary<int, int> New2OldApple;
|
||||
|
||||
public TimeSpan MigrateDocVersion(DocVersion docver, bool convertProcedures)
|
||||
{
|
||||
long lTime = DateTime.Now.Ticks;
|
||||
string pth = docver.Title;
|
||||
MultiUnitCount = docver.DocVersionConfig.Unit_Count;
|
||||
if (MultiUnitCount > 0)
|
||||
{
|
||||
Old2NewApple = new Dictionary<int, int>();
|
||||
New2OldApple = new Dictionary<int, int>();
|
||||
for (int i = 1; i <= MultiUnitCount; i++)
|
||||
{
|
||||
docver.DocVersionConfig.SelectedSlave = i;
|
||||
int oldindex = int.Parse(docver.DocVersionConfig.Old_Index);
|
||||
Old2NewApple.Add(oldindex, i);
|
||||
New2OldApple.Add(i, oldindex);
|
||||
}
|
||||
}
|
||||
if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return new TimeSpan(); // Open connection
|
||||
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
|
||||
if (convertProcedures)
|
||||
{
|
||||
// JSJ 02/10/2010 - Remove all the .INF files before proceeding to convert.
|
||||
// The INF files contain a path to a corresponding NDX file - had data with bat NDX path
|
||||
DeleteINFFiles(pth);
|
||||
_OutTran = new OutsideTransition(cn);
|
||||
frmMain.AddInfo("Before MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
MigrateROFST(pth, docver);
|
||||
GC.Collect();
|
||||
frmMain.AddInfo("After MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
// Migrate library documents
|
||||
MigrateLibDocs(cn, pth);
|
||||
// Initialize Dictionaries
|
||||
dicTrans_ItemDone = new Dictionary<string, Item>();
|
||||
dicTrans_ItemIds = new Dictionary<string, Item>();
|
||||
dicTrans_MigrationErrors = new Dictionary<string, List<Item>>();
|
||||
|
||||
// Create a 'dummy' content record. This will be used for any transitions 'to'
|
||||
// that don't exist when dbf is processed. At end, use this to see if there
|
||||
// are missing transitions.
|
||||
TransDummyCont = Content.MakeContent(null, "DUMMY CONTENT FOR TRANSITION MIGRATION", null, null, null);
|
||||
}
|
||||
// Process Procedures
|
||||
Item itm = null;
|
||||
if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved)
|
||||
itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat);
|
||||
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
|
||||
lTime = DateTime.Now.Ticks - lTime;
|
||||
if (convertProcedures)
|
||||
{
|
||||
ShowMissingTransitions(docver);
|
||||
//frmMain.Status = string.Format("{0}\r\nConversion completed in {1} seconds.", pth, TimeSpan.FromTicks(lTime).TotalSeconds);
|
||||
TimeSpan ts = TimeSpan.FromTicks(lTime);
|
||||
frmMain.Status = string.Format("{0}\r\nConversion completion time: {1:D2}:{2:D2}:{3:D2}.{4} ({5} Total Seconds)", pth, ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds, ts.TotalSeconds);
|
||||
log.InfoFormat("Completed Migration of {0}", pth);
|
||||
|
||||
//MessageBox.Show("Completed Migration of " + pth); //jsj commented out to let it run through
|
||||
if (rofstinfo != null) rofstinfo.ROFSTLookup.Close();
|
||||
dicTrans_ItemDone.Clear();
|
||||
dicTrans_ItemDone = null;
|
||||
}
|
||||
else
|
||||
frmMain.Status = string.Format("{0}\r\nDone.", pth);
|
||||
cn.Close();
|
||||
if (itm != null)
|
||||
{
|
||||
docver.MyItem = itm;
|
||||
if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
|
||||
if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
|
||||
if(frmMain.MySettings.ExecutionMode == ExecutionMode.Debug)
|
||||
docver.DocVersionConfig.Print_PDFLocation = frmMain.MySettings.PDFFolder;
|
||||
docver.Save();
|
||||
}
|
||||
return TimeSpan.FromTicks(lTime);
|
||||
}
|
||||
private void DeleteINFFiles(string pth)
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(pth);
|
||||
FileInfo [] myFiles = di.GetFiles("*.INF");
|
||||
foreach (FileInfo myFile in myFiles)
|
||||
myFile.Delete();
|
||||
}
|
||||
private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
|
||||
{
|
||||
if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;
|
||||
if (s.EndsWith("chgsht")) return VEPROMS.CSLA.Library.VersionTypeEnum.Revision;
|
||||
if (s.EndsWith("tmpchg")) return VEPROMS.CSLA.Library.VersionTypeEnum.Temporary;
|
||||
return VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,368 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.MSWord;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Threading;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private void SaveSectionDocument(string fname, string stpseq, string stype, ref int cid, string sectName, bool isLandscape)
|
||||
{
|
||||
int docid = SaveWordDoc(fname, stype, sectName, isLandscape);
|
||||
switch (docid)
|
||||
{
|
||||
case 0:
|
||||
// could add the following back in - but many of these may be put out in the log, and
|
||||
// don't supply any pertinent info.
|
||||
//log.InfoFormat("Timing problem for save of word document, will retry. oldstepsequence = {0}", stpseq);
|
||||
break;
|
||||
case -1:
|
||||
log.ErrorFormat("Could not complete save of word document, oldstepsequence = {0}", stpseq);
|
||||
break;
|
||||
default:
|
||||
cid = docid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private int SaveWordDoc(string fname, string title, string stype, bool isLandscape, ConfigInfo ci, string sectName, DateTime dtsutc)
|
||||
{
|
||||
int docid = 0;
|
||||
if (System.IO.File.Exists(fname))
|
||||
{
|
||||
FileInfo myFile = new FileInfo(fname);
|
||||
GC.Collect();
|
||||
frmMain.AddInfo("Processing {0} {1}", fname, GC.GetTotalMemory(true));
|
||||
//string tmpName = @"C:\Temp\DataLoader\" + myFile.Name.Replace(".", "_") + ".RTF";
|
||||
string tmpName = Path.GetTempFileName();
|
||||
string temppath = Path.GetTempFileName();
|
||||
if (frmMain.MySettings.ExecutionMode == ExecutionMode.Production ||
|
||||
frmMain.MySettings.ConvertTo == AccPageConversion.MSWord)
|
||||
{
|
||||
FileInfo tmpFile = new FileInfo(tmpName);
|
||||
if (tmpFile.Exists)
|
||||
tmpFile.Delete();
|
||||
myFile.CopyTo(tmpName);
|
||||
LoadAndSaveRichTextBox41(tmpName);
|
||||
WordDocument wd = new WordDocument(tmpName, stype, temppath, isLandscape);
|
||||
Thread myThread = new Thread(wd.GetAsciiFromWord);
|
||||
myThread.Start();
|
||||
myThread.Join(30000); // Wait 30 seconds to time-out
|
||||
if (myThread.ThreadState == System.Threading.ThreadState.Running)
|
||||
{
|
||||
WordDoc.KillWordApps();
|
||||
Thread.Sleep(1000);// Give the process a second to shutdown
|
||||
frmMain.AddError("Could not open file '{0}'", fname);
|
||||
docid = SaveDoc(fname, title, ci, "", dtsutc); // Save the original file
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Printing", "Length", string.Format("{0:0.0000}", wd.DocLen));
|
||||
docid = SaveDoc(temppath, title, ci, wd.ASCII, dtsutc);
|
||||
DeleteFile(temppath);
|
||||
DeleteFile(tmpName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (frmMain.MySettings.ConvertTo == AccPageConversion.RichTextFormat)
|
||||
docid = SaveDoc(fname, title, ci, "", dtsutc); // Need to get Ascii Text from RTF
|
||||
}
|
||||
}
|
||||
else
|
||||
frmMain.AddError("Missing rtf file: {0}", fname);
|
||||
return docid;
|
||||
}
|
||||
private RichTextBox _MyRichTextBox = null;
|
||||
public RichTextBox MyRichTextBox
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyRichTextBox == null)
|
||||
_MyRichTextBox = new RichTextBox();
|
||||
return _MyRichTextBox;
|
||||
}
|
||||
}
|
||||
private void LoadAndSaveRichTextBox(string tmpName)
|
||||
{
|
||||
string rtf = LoadFileRaw(tmpName);
|
||||
// Parse for margins because the RTB will remove them
|
||||
rtf = rtf.Replace("\x95", @"\bullet ");
|
||||
Match match = Regex.Match(rtf, @"((\\marg[^\\]+)+)", RegexOptions.Singleline);
|
||||
//rtf = rtf.Replace("\\sectd", "");
|
||||
//rtf = rtf.Replace("\\sbkpage", "");
|
||||
//rtf = rtf.Replace("\\sect", "\\page");
|
||||
rtf = Regex.Replace(rtf, @"\\ri[0-9]*(?=[ \\{])", "");
|
||||
rtf = Regex.Replace(rtf, @"\\sectd(?=[ \\{])", "");
|
||||
rtf = Regex.Replace(rtf, @"\\sbkpage(?=[ \\{])", "");
|
||||
rtf = Regex.Replace(rtf, @"\\sect(?=[ \\{])", @"\page");
|
||||
rtf = Regex.Replace(rtf, @"\\par(?=[ \\{])", @" <<par>>\par");
|
||||
MyRichTextBox.Rtf = rtf; // Allow the RichTextBox to parse the RTF
|
||||
rtf = MyRichTextBox.Rtf; // Get the RTF back from the RichTextBox
|
||||
// Add the margins to the RTB output
|
||||
rtf = Regex.Replace(rtf, @"( |\r\n)<<par>>\\par(?=[\r \\{])", @"\par");
|
||||
rtf = Regex.Replace(rtf, @" <<par>>\\f. \\", @"\par\");
|
||||
rtf = Regex.Replace(rtf, @" <<par>>", @"\par");
|
||||
rtf = Regex.Replace(rtf, @"\\ansi(?=[ \\{])", @"\ansi" + match.Value);
|
||||
//rtf = rtf.Replace(@"\ansi\", @"\ansi\" + match.Value);
|
||||
// Save the modified rtf to the temporary file
|
||||
SaveFile(rtf, tmpName);
|
||||
}
|
||||
private RichTextBox41 _MyRichTextBox41 = null;
|
||||
public RichTextBox41 MyRichTextBox41
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyRichTextBox41 == null)
|
||||
_MyRichTextBox41 = new RichTextBox41();
|
||||
return _MyRichTextBox41;
|
||||
}
|
||||
}
|
||||
//private void LoadAndSaveRichTextBox41(string tmpName)
|
||||
//{
|
||||
// string rtf = LoadFileRaw(tmpName);
|
||||
// // Parse for margins because the RTB will remove them
|
||||
// rtf = rtf.Replace("\x95", @"\bullet ");
|
||||
// Match match = Regex.Match(rtf, @"((\\marg[^\\]+)+)", RegexOptions.Singleline);
|
||||
// rtf = Regex.Replace(rtf, @"(?<!\\[^ \\\r\n]*)\\sectd ", "");
|
||||
// rtf = Regex.Replace(rtf, @"(?<!\\[^ \\\r\n]*)\\sbkpage ", "");
|
||||
// rtf = Regex.Replace(rtf, @"\\sectd(?=[\\{])", "");
|
||||
// rtf = Regex.Replace(rtf, @"\\sbkpage(?=[\\{])", "");
|
||||
// rtf = Regex.Replace(rtf, @"\\sect(?=[ \\{])", @"\page");
|
||||
// MyRichTextBox41.Rtf = rtf; // Allow the RichTextBox to parse the RTF
|
||||
// rtf = MyRichTextBox41.Rtf; // Get the RTF back from the RichTextBox
|
||||
// // Add the margins to the RTB output
|
||||
// rtf = Regex.Replace(rtf, @"\\ansi(?=[ \\{])", @"\ansi" + match.Value);
|
||||
// // Save the modified rtf to the temporary file
|
||||
// SaveFile(rtf, tmpName);
|
||||
//}
|
||||
private void LoadAndSaveRichTextBox41(string tmpName)
|
||||
{
|
||||
string rtf = LoadFileRaw(tmpName);
|
||||
if (rtf.StartsWith(@"{\rtf"))
|
||||
{
|
||||
rtf = StripTokensFromFontTable(rtf);
|
||||
// Parse for margins because the RTB will remove them
|
||||
rtf = rtf.Replace("\x95", @"\bullet ");// Bullet
|
||||
rtf = rtf.Replace("\x93", @"\'93");// Left Double Quote
|
||||
rtf = rtf.Replace("\x94", @"\'94");// Right Double Quote
|
||||
rtf = rtf.Replace("\x96", @"\u8211?");//
|
||||
rtf = rtf.Replace("\x89", @"\u8240?");//
|
||||
rtf = rtf.Replace("\x92", @"\u8217?");//
|
||||
rtf = rtf.Replace("\x84", @"\u8222?");//
|
||||
rtf = rtf.Replace("\x85", @"\u8230?");//
|
||||
rtf = rtf.Replace("\x97", @"\u8212?");//
|
||||
rtf = rtf.Replace("\x9C", @"\u339?");//
|
||||
rtf = rtf.Replace("\x98", @"\u732?");//
|
||||
rtf = rtf.Replace("`", @"\'B0");// Degree
|
||||
Match match = Regex.Match(rtf, @"((\\marg[^\\]+)+)", RegexOptions.Singleline);
|
||||
rtf = Regex.Replace(rtf, @"(?<!\\[^ \\\r\n]*)\\sectd ", "");
|
||||
rtf = Regex.Replace(rtf, @"(?<!\\[^ \\\r\n]*)\\sbkpage ", "");
|
||||
rtf = Regex.Replace(rtf, @"\\ri[0-9]*(?=[ \\{])", "");// Remove Right Indents
|
||||
rtf = Regex.Replace(rtf, @"\\sectd(?=[\\{])", "");
|
||||
rtf = Regex.Replace(rtf, @"\\sbkpage(?=[\\{])", "");
|
||||
rtf = Regex.Replace(rtf, @"\\sect(?=[ \\{\r])", @"\page");
|
||||
MyRichTextBox41.Rtf = rtf; // Allow the RichTextBox to parse the RTF
|
||||
rtf = MyRichTextBox41.Rtf; // Get the RTF back from the RichTextBox
|
||||
// Add the margins to the RTB output
|
||||
rtf = Regex.Replace(rtf, @"\\ansi(?=[ \\{])", @"\ansi" + match.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyRichTextBox41.Text = rtf;
|
||||
rtf = MyRichTextBox41.Rtf;
|
||||
}
|
||||
SaveFile(rtf, tmpName);
|
||||
}
|
||||
private string _Prefix;
|
||||
private string FixFontTableEntry(Match m)
|
||||
{
|
||||
string tableEntry = m.ToString();
|
||||
if (tableEntry.Contains(@"\page "))
|
||||
{
|
||||
tableEntry = tableEntry.Replace(@"\page ", "");
|
||||
_Prefix += "\x0C";
|
||||
}
|
||||
if (tableEntry.Contains(@"\column "))
|
||||
{
|
||||
tableEntry = tableEntry.Replace(@"\column ", "");
|
||||
_Prefix += "\x0E";
|
||||
}
|
||||
if (tableEntry.Contains(@"\tab "))
|
||||
{
|
||||
tableEntry = tableEntry.Replace(@"\tab ", "");
|
||||
_Prefix += "\x09";
|
||||
}
|
||||
return tableEntry;
|
||||
}
|
||||
private string StripTokensFromFontTable(string rtf)
|
||||
{
|
||||
_Prefix = "";
|
||||
string rtfout = Regex.Replace(rtf, @"{\\f[0-9]+[^}]*}", new MatchEvaluator(FixFontTableEntry), RegexOptions.Singleline);
|
||||
return rtfout;
|
||||
}
|
||||
private static void TryToShowMSWord(WordDoc myWordDoc)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MessageBox.Show("Word is having problems processing this file.\r\n\r\nDo you want to see?", "MS Word Failure", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
WordDoc.MyWordApp.Visible = true;
|
||||
MessageBox.Show("Click on OK when you are done with MS Word", "Wait until done with MS Word", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CloseMSWord(WordDoc myWordDoc)
|
||||
{
|
||||
try
|
||||
{
|
||||
// RHM 20100628 - All of a sudden, this was null and would not work.
|
||||
// I added the else clause so that the WinWord process would be terminated.
|
||||
if (myWordDoc != null)
|
||||
{
|
||||
WordDoc.CloseApp();
|
||||
Application.DoEvents();
|
||||
while (WordDoc.WordProcesses.Length > 0)
|
||||
Application.DoEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
WordDoc.KillWordApps();
|
||||
Application.DoEvents();
|
||||
while (WordDoc.WordProcesses.Length > 0)
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
private static void DeleteFile(string fName)
|
||||
{
|
||||
if (File.Exists(fName))
|
||||
File.Delete(fName);
|
||||
}
|
||||
private string LoadFileRaw(string fName)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileInfo file = new FileInfo(fName);
|
||||
byte[] myBytes = new byte[file.Length];
|
||||
using (FileStream fs = file.OpenRead())
|
||||
{
|
||||
fs.Read(myBytes, 0, (int)file.Length);
|
||||
fs.Close();
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (byte byt in myBytes)
|
||||
{
|
||||
int iByte = (int)byt;
|
||||
sb.Append((char)byt);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
Application.DoEvents();
|
||||
return LoadFileRaw(fName);
|
||||
}
|
||||
}
|
||||
private void SaveFile(string str, string fName)
|
||||
{
|
||||
FileInfo file = new FileInfo(fName);
|
||||
using (StreamWriter sw = file.CreateText())
|
||||
{
|
||||
sw.Write(str);
|
||||
sw.Close();
|
||||
}
|
||||
}
|
||||
private int SaveWordDoc(string temppath, string stype, string sectName, bool isLandscape)
|
||||
{
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
ci.AddItem("Edit", "Initialized", "true");
|
||||
FileInfo myFile = new FileInfo(temppath);
|
||||
ci.AddItem("History", "OriginalFileName", myFile.Name);
|
||||
return SaveWordDoc(temppath, String.Empty, stype, isLandscape, ci, sectName, myFile.LastWriteTimeUtc);
|
||||
}
|
||||
private int SaveTheDoc(string temppath, string title, ConfigInfo ci, string ascii, DateTime dtsutc)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileStream fs = File.Open(temppath, FileMode.Open, FileAccess.Read, FileShare.None);
|
||||
long len = fs.Length + 1;
|
||||
byte[] ByteArray = new byte[len];
|
||||
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
|
||||
fs.Close();
|
||||
string t1 = (title == null || title == "") ? null : title;
|
||||
using (Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), dtsutc, "Migration", ".Doc"))
|
||||
{
|
||||
FileInfo tmpFile = new FileInfo(temppath);
|
||||
string docfile = temppath.Substring(0, temppath.LastIndexOf(".")) + @".doc";
|
||||
if (File.Exists(docfile)) File.Delete(docfile);
|
||||
FileInfo doctmpFile = tmpFile.CopyTo(docfile);
|
||||
doc.DocAscii = ascii;
|
||||
doc.Save();
|
||||
File.Delete(docfile);
|
||||
return doc.DocID;
|
||||
}
|
||||
}
|
||||
// for an io exception, keep trying
|
||||
catch (IOException exio)
|
||||
{
|
||||
Console.WriteLine("IO: {0} - {1}", exio.GetType().Name, exio.Message);
|
||||
frmMain.AddError(exio, "SaveTheDoc('{0}','{1}')", temppath, title);
|
||||
Wait(2);
|
||||
return 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Save Word Doc");
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
frmMain.AddError(ex, "SaveTheDoc('{0}','{1}')", temppath, title);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
private int SaveDoc(string temppath, string title, ConfigInfo ci, string ascii, DateTime dtsutc)
|
||||
{
|
||||
int done = 0;
|
||||
int ntry = 0;
|
||||
while (done == 0 && ntry < 4)
|
||||
{
|
||||
ntry++;
|
||||
done = SaveTheDoc(temppath, title, ci, ascii, dtsutc);
|
||||
}
|
||||
return done;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Csla.Validation;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public static class ErrorRpt
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public static void ErrorReport(IVEHasBrokenRules mybr)
|
||||
{
|
||||
string smess = mybr.GetType().Name;
|
||||
IVEHasBrokenRules hbr = mybr.HasBrokenRules;
|
||||
if (hbr == null) smess += "\n Unknown Error";
|
||||
else
|
||||
{
|
||||
smess += "\n In object" + hbr.GetType().Name;
|
||||
foreach (BrokenRule br in hbr.BrokenRules)
|
||||
{
|
||||
smess += "\n" + br.Property + " - " + br.Description;
|
||||
}
|
||||
}
|
||||
//MessageBox.Show(smess);
|
||||
_MyLog.Error(smess);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public class FixItems : List<FixItem>
|
||||
{
|
||||
public FixItems(FileInfo myFile):base()
|
||||
{
|
||||
if (!myFile.Exists)
|
||||
return;
|
||||
FileStream fs = myFile.OpenRead();
|
||||
int len = (int) myFile.Length;
|
||||
byte [] buffer = new byte[len];
|
||||
fs.Read(buffer, 0, len);
|
||||
int offset = 0;
|
||||
while(offset < len)
|
||||
{
|
||||
int lFixItem = (int)(buffer[offset]);
|
||||
Add(new FixItem(buffer,offset));
|
||||
offset += lFixItem + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class FixItem
|
||||
{
|
||||
public FixItem(byte[] buffer, int offset)
|
||||
{
|
||||
int lFixItem = (int)(buffer[offset]);
|
||||
_Section = (char)(buffer[offset + 1]);
|
||||
_Step = (int)(buffer[offset + 2]);
|
||||
string str = System.Text.Encoding.GetEncoding(1251).GetString(buffer, offset + 3, lFixItem - 2);
|
||||
if (str.Contains(" "))
|
||||
{
|
||||
int index = str.IndexOf(" ");
|
||||
_Sequence = str.Substring(0, index);
|
||||
_Rev = str.Substring(index + 1);
|
||||
}
|
||||
else
|
||||
_Sequence = str;
|
||||
}
|
||||
private char _Section;
|
||||
public char Section
|
||||
{
|
||||
get { return _Section; }
|
||||
set { _Section = value; }
|
||||
}
|
||||
private int _Step;
|
||||
public int Step
|
||||
{
|
||||
get { return _Step; }
|
||||
set { _Step = value; }
|
||||
}
|
||||
private string _Sequence;
|
||||
public string Sequence
|
||||
{
|
||||
get { return _Sequence; }
|
||||
set { _Sequence = value; }
|
||||
}
|
||||
private string _Rev;
|
||||
public string Rev
|
||||
{
|
||||
get { return _Rev; }
|
||||
set { _Rev = value; }
|
||||
}
|
||||
private string _RevDate;
|
||||
public string RevDate
|
||||
{
|
||||
get { return _RevDate; }
|
||||
set { _RevDate = value; }
|
||||
}
|
||||
private string _ReviewDate;
|
||||
public string ReviewDate
|
||||
{
|
||||
get { return _ReviewDate; }
|
||||
set { _ReviewDate = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Csla;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public class FolderTreeNode : TreeNode
|
||||
{
|
||||
FolderTreeNode(string s) : base(s)
|
||||
{
|
||||
this.Name="ID:" + s;
|
||||
}
|
||||
FolderTreeNode(FolderInfo folderinfo)
|
||||
: base(folderinfo.Name)
|
||||
{
|
||||
_folderinfo = folderinfo;
|
||||
this.Name = "ID:" + folderinfo.FolderID.ToString();
|
||||
}
|
||||
private FolderInfo _folderinfo;
|
||||
public FolderInfo FolderInfo
|
||||
{
|
||||
get { return _folderinfo; }
|
||||
set
|
||||
{
|
||||
_folderinfo = value;
|
||||
}
|
||||
}
|
||||
private Dictionary<int, FolderTreeNode> _findTree = null;
|
||||
private Dictionary<int, FolderTreeNode> FindTree
|
||||
{
|
||||
get { return _findTree; }
|
||||
set { _findTree = value; }
|
||||
}
|
||||
public FolderTreeNode FindTreeNode(int folderID)
|
||||
{
|
||||
if (_findTree != null) return _findTree[folderID];
|
||||
return null;
|
||||
}
|
||||
public static FolderTreeNode BuildTreeList()
|
||||
{
|
||||
FolderTreeNode root = null;
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
Dictionary<int, FolderTreeNode> dicMissing = new Dictionary<int, FolderTreeNode>();
|
||||
Dictionary<int, FolderTreeNode> dicExists = new Dictionary<int, FolderTreeNode>();
|
||||
foreach (FolderInfo fi in fil)
|
||||
{
|
||||
FolderTreeNode ftp = null;
|
||||
if (dicExists.ContainsKey(fi.ParentID))
|
||||
{
|
||||
ftp = dicExists[fi.ParentID];
|
||||
// dicNeedToLoad.Remove(ftp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fi.ParentID != 0)
|
||||
{
|
||||
ftp = new FolderTreeNode(fi.ParentID.ToString());
|
||||
dicMissing.Add(fi.ParentID, ftp);
|
||||
dicExists.Add(fi.ParentID, ftp);
|
||||
if (fi.FolderDocVersionCount > 0)
|
||||
{
|
||||
TreeNode tn = new TreeNode("dummy");
|
||||
tn.Tag = "dummy";
|
||||
ftp.Nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
}
|
||||
FolderTreeNode ft = null;
|
||||
if (dicMissing.ContainsKey(fi.FolderID))
|
||||
{
|
||||
ft = dicMissing[fi.FolderID];
|
||||
ft.FolderInfo = fi;
|
||||
dicMissing.Remove(fi.FolderID);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft = new FolderTreeNode(fi);
|
||||
if (fi.FolderDocVersionCount > 0)
|
||||
{
|
||||
TreeNode tn = new TreeNode("dummy");
|
||||
tn.Tag = "dummy";
|
||||
ft.Nodes.Add(tn);
|
||||
}
|
||||
dicExists.Add(fi.FolderID, ft);
|
||||
//dicNeedToLoad.Add(ft);
|
||||
}
|
||||
ft.Tag = fi;
|
||||
if (fi.ParentID == 0)
|
||||
root = ft;
|
||||
else
|
||||
ftp.Nodes.Add(ft);
|
||||
}
|
||||
root.FindTree = dicExists;
|
||||
return root;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
//public string _FmtAllPath;
|
||||
//public string _GenmacAllPath;
|
||||
//private FormatInfoList _AllFormats;
|
||||
|
||||
//public FormatInfoList AllFormats
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_AllFormats == null)
|
||||
// _AllFormats = FormatInfoList.Get();
|
||||
// return _AllFormats;
|
||||
// }
|
||||
//}
|
||||
//private Dictionary<string, int> _LookupFormats;
|
||||
//public Dictionary<string, int> LookupFormats
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_LookupFormats == null)
|
||||
// {
|
||||
// _LookupFormats = new Dictionary<string, int>();
|
||||
// foreach (FormatInfo myFormat in AllFormats)
|
||||
// {
|
||||
// _LookupFormats.Add(myFormat.Name, myFormat.FormatID);
|
||||
// }
|
||||
// }
|
||||
// return _LookupFormats;
|
||||
// }
|
||||
//}
|
||||
//private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
|
||||
//{
|
||||
// string fmtdata = null;
|
||||
// string genmacdata = null;
|
||||
// XmlDocument xd = null;
|
||||
|
||||
// //string path = "c:\\development\\fmtall\\" + format + "all.xml";
|
||||
// string path = _FmtAllPath + "\\" + format + "all.xml";
|
||||
// if (File.Exists(path))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// StreamReader srf = new StreamReader(path);
|
||||
// xd = new XmlDocument();
|
||||
// xd.Load(srf);
|
||||
// //xd.Load(path);
|
||||
// fmtdata = xd.OuterXml;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Do we need genmac - only if non-subformat
|
||||
// if (!issub)
|
||||
// {
|
||||
// //path = "c:\\development\\genmacall\\" + format + ".svg";
|
||||
// path = _GenmacAllPath + "\\" + format + ".svg";
|
||||
// if (File.Exists(path))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// StreamReader sr = new StreamReader(path);
|
||||
// XmlDocument xdg = new XmlDocument();
|
||||
// xdg.Load(sr);
|
||||
// //xdg.Load(path);
|
||||
// genmacdata = xdg.OuterXml;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // Get the name & then create the record.
|
||||
// if (Userid == null || Userid == "") Userid = "Migration";
|
||||
|
||||
// string nmattr = "Default";
|
||||
|
||||
// // use xpath to get name.
|
||||
// if (parent != null)
|
||||
// {
|
||||
// XmlNode nmnode = xd.SelectSingleNode("//FormatData");
|
||||
// if (nmnode is XmlElement)
|
||||
// {
|
||||
// XmlElement xm = (XmlElement)nmnode;
|
||||
// nmattr = xm.GetAttribute("Name");
|
||||
// }
|
||||
// }
|
||||
// // use the format name if base or non sub. If it's a sub, remove the "_".
|
||||
// string fname = issub ? format.Replace("_", "") : format;
|
||||
// Format rec = null;
|
||||
// try
|
||||
// {
|
||||
// if (!LookupFormats.ContainsKey(fname))
|
||||
// {
|
||||
// rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rec = Format.Get(LookupFormats[fname]);
|
||||
// rec.Data = fmtdata;
|
||||
// rec.GenMac = genmacdata;
|
||||
// rec = rec.Save();
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
||||
// }
|
||||
// return rec;
|
||||
//}
|
||||
//public void LoadAllFormats()
|
||||
//{
|
||||
// Format basefmt = null;
|
||||
// Format parent = null;
|
||||
|
||||
|
||||
// // Load base format.
|
||||
// basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
|
||||
// if (basefmt == null) return;
|
||||
// // now loop through all files... If there is an _ in the name, it's a subformat
|
||||
// // (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
|
||||
// DirectoryInfo di = new DirectoryInfo(_FmtAllPath); //(@"c:\development\fmtall");
|
||||
// FileInfo[] fis = di.GetFiles("*.xml");
|
||||
|
||||
// foreach (FileInfo fi in fis)
|
||||
// {
|
||||
// //if (fi.Name.ToUpper() == "WCN2ALL.XML"|| fi.Name.ToUpper() == "OHLPALL.XML")
|
||||
// //{
|
||||
// bool issub = (fi.Name.IndexOf("_") > 0) ? true : false;
|
||||
// if (!issub && fi.Name.ToLower() != "baseall.xml")
|
||||
// {
|
||||
// string fmtname = fi.Name.Substring(0, fi.Name.Length - 7);
|
||||
// // remove the all.xml part of the filename.
|
||||
// try
|
||||
// {
|
||||
// parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration");
|
||||
// if (parent != null)
|
||||
// {
|
||||
// // now see if there are any subformats associated with this, if so
|
||||
// // add them here...
|
||||
// DirectoryInfo sdi = new DirectoryInfo(_FmtAllPath); //("c:\\development\\fmtall");
|
||||
// FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
|
||||
// foreach (FileInfo sfi in sfis)
|
||||
// {
|
||||
// string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
|
||||
// //Console.WriteLine("Processing {0}", sfi.Name);
|
||||
// frmMain.Status = string.Format("Processing Format {0}", sfi.Name);
|
||||
// try
|
||||
// {
|
||||
// AddFormatToDB(parent, nm, true, DateTime.Now, "Migration");
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// frmMain.AddError(ex, "LoadAllFormats() '{0}'", sfi.Name);
|
||||
// //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// frmMain.AddError(ex, "LoadAllFormats() '{0}'", fi.Name);
|
||||
// //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
// }
|
||||
// }
|
||||
// //}
|
||||
// }
|
||||
//}
|
||||
public FormatInfo GetFormat(string format)
|
||||
{
|
||||
Format parent = null;
|
||||
Format rec = null;
|
||||
|
||||
// get base
|
||||
Format baseparent = Format.Get(1);
|
||||
|
||||
// if there is no format - what should be done? maybe nothing.
|
||||
if (format == null || format == "") return null;
|
||||
|
||||
try
|
||||
{
|
||||
if (format.IndexOf(' ') > -1) // will have spaces if it's a user format
|
||||
{
|
||||
string part1 = format.Substring(0, format.IndexOf(' '));
|
||||
string part2 = null;
|
||||
try
|
||||
{
|
||||
part2 = format.Substring(format.LastIndexOf(' ') + 1, 2);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
format = part1 + part2;
|
||||
|
||||
// get the parent format's id (for example, AEP for AEP00).
|
||||
parent = Format.GetByParentID_Name(baseparent.FormatID, part1);
|
||||
}
|
||||
else
|
||||
parent = baseparent;
|
||||
|
||||
// see if the format has been added, if not go get it.
|
||||
rec = Format.GetByParentID_Name(parent.FormatID, format);
|
||||
// JSJ - 02/04/10 this fixes cases where a subformat is no longer available,
|
||||
// default to the parent format
|
||||
if (rec == null)
|
||||
rec = parent;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error getting xml version of format {0}", ex.Message);
|
||||
frmMain.AddError(ex, "GetFormat('{0}')", format);
|
||||
}
|
||||
FormatInfo recInfo = FormatInfo.Get(rec.FormatID);
|
||||
return recInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
|
||||
private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
|
||||
{
|
||||
string fmtdata = null;
|
||||
string genmacdata = null;
|
||||
XmlDocument xd = null;
|
||||
|
||||
string path = "c:\\development\\fmtall\\" + format + "all.xml";
|
||||
if (File.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader srf = new StreamReader(path);
|
||||
xd = new XmlDocument();
|
||||
xd.Load(srf);
|
||||
//xd.Load(path);
|
||||
fmtdata = xd.OuterXml;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Do we need genmac - only if non-subformat
|
||||
if (!issub)
|
||||
{
|
||||
path = "c:\\development\\genmacall\\" + format + ".svg";
|
||||
if (File.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(path);
|
||||
XmlDocument xdg = new XmlDocument();
|
||||
xdg.Load(sr);
|
||||
//xdg.Load(path);
|
||||
genmacdata = xdg.OuterXml;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddFormatToDB('{0}','{1}')", parent.Name, path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Get the name & then create the record.
|
||||
if (Userid == null || Userid == "") Userid = "Migration";
|
||||
|
||||
string nmattr = "Default";
|
||||
|
||||
// use xpath to get name.
|
||||
if (parent != null)
|
||||
{
|
||||
XmlNode nmnode = xd.SelectSingleNode("//FormatData");
|
||||
if (nmnode is XmlElement)
|
||||
{
|
||||
XmlElement xm = (XmlElement)nmnode;
|
||||
nmattr = xm.GetAttribute("Name");
|
||||
}
|
||||
}
|
||||
// use the format name if base or non sub. If it's a sub, remove the "_".
|
||||
string fname = issub ? format.Replace("_", "") : format;
|
||||
Format rec = null;
|
||||
try
|
||||
{
|
||||
rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
public void LoadAllFormats()
|
||||
{
|
||||
Format basefmt = null;
|
||||
Format parent = null;
|
||||
|
||||
// Load base format.
|
||||
basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
|
||||
if (basefmt == null) return;
|
||||
// now loop through all files... If there is an _ in the name, it's a subformat
|
||||
// (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
|
||||
DirectoryInfo di = new DirectoryInfo(@"c:\development\fmtall");
|
||||
FileInfo[] fis = di.GetFiles("*.xml");
|
||||
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
bool issub = (fi.Name.IndexOf("_") > 0) ? true : false;
|
||||
if (!issub && fi.Name.ToLower() != "baseall.xml")
|
||||
{
|
||||
string fmtname = fi.Name.Substring(0, fi.Name.Length - 7);
|
||||
// remove the all.xml part of the filename.
|
||||
try
|
||||
{
|
||||
parent = AddFormatToDB(basefmt, fmtname, issub, DateTime.Now, "Migration");
|
||||
if (parent != null)
|
||||
{
|
||||
// now see if there are any subformats associated with this, if so
|
||||
// add them here...
|
||||
DirectoryInfo sdi = new DirectoryInfo("c:\\development\\fmtall");
|
||||
FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
|
||||
foreach (FileInfo sfi in sfis)
|
||||
{
|
||||
string nm = sfi.Name.Substring(0, sfi.Name.Length - 7);
|
||||
//Console.WriteLine("Processing {0}", sfi.Name);
|
||||
frmMain.Status = string.Format("Processing Format {0}", sfi.Name);
|
||||
try
|
||||
{
|
||||
AddFormatToDB(parent, nm, true, DateTime.Now, "Migration");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "LoadAllFormats() '{0}'", sfi.Name);
|
||||
//Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "LoadAllFormats() '{0}'", fi.Name);
|
||||
//Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public FormatInfo GetFormat(string format)
|
||||
{
|
||||
Format parent = null;
|
||||
Format rec = null;
|
||||
|
||||
// get base
|
||||
Format baseparent = Format.Get(1);
|
||||
|
||||
// if there is no format - what should be done? maybe nothing.
|
||||
if (format == null || format == "") return null;
|
||||
|
||||
try
|
||||
{
|
||||
if (format.IndexOf(' ') > -1) // will have spaces if it's a user format
|
||||
{
|
||||
string part1 = format.Substring(0, format.IndexOf(' '));
|
||||
string part2 = format.Substring(format.LastIndexOf(' ') + 1, 2);
|
||||
format = part1 + part2;
|
||||
|
||||
// get the parent format's id (for example, AEP for AEP00).
|
||||
parent = Format.GetByParentID_Name(baseparent.FormatID, part1);
|
||||
}
|
||||
else
|
||||
parent = baseparent;
|
||||
|
||||
// see if the format has been added, if not go get it.
|
||||
rec = Format.GetByParentID_Name(parent.FormatID, format);
|
||||
// JSJ - 02/04/10 this fixes cases where a subformat is no longer available,
|
||||
// default to the parent format
|
||||
if (rec == null)
|
||||
rec = parent;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error getting xml version of format {0}", ex.Message);
|
||||
frmMain.AddError(ex, "GetFormat('{0}')", format);
|
||||
}
|
||||
FormatInfo recInfo = FormatInfo.Get(rec.FormatID);
|
||||
return recInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Generated
-110
@@ -1,110 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class GroupProp
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.lbGroups = new System.Windows.Forms.ListBox();
|
||||
this.pg = new System.Windows.Forms.PropertyGrid();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.lbGroups);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.pg);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.btnSave);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(629, 290);
|
||||
this.splitContainer1.SplitterDistance = 209;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// lbGroups
|
||||
//
|
||||
this.lbGroups.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbGroups.FormattingEnabled = true;
|
||||
this.lbGroups.Location = new System.Drawing.Point(0, 0);
|
||||
this.lbGroups.Name = "lbGroups";
|
||||
this.lbGroups.Size = new System.Drawing.Size(209, 290);
|
||||
this.lbGroups.TabIndex = 0;
|
||||
this.lbGroups.Click += new System.EventHandler(this.lbGroups_Click);
|
||||
//
|
||||
// pg
|
||||
//
|
||||
this.pg.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pg.Location = new System.Drawing.Point(0, 23);
|
||||
this.pg.Name = "pg";
|
||||
this.pg.Size = new System.Drawing.Size(416, 267);
|
||||
this.pg.TabIndex = 0;
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.btnSave.Location = new System.Drawing.Point(0, 0);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(416, 23);
|
||||
this.btnSave.TabIndex = 1;
|
||||
this.btnSave.Text = "Save";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
//
|
||||
// GroupProp
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(629, 290);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "GroupProp";
|
||||
this.Text = "GroupProp";
|
||||
this.Load += new System.EventHandler(this.GroupProp_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.ListBox lbGroups;
|
||||
private System.Windows.Forms.PropertyGrid pg;
|
||||
private System.Windows.Forms.Button btnSave;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Csla;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class GroupProp : Form
|
||||
{
|
||||
GroupInfoList glst;
|
||||
Group grp;
|
||||
public GroupProp()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void GroupProp_Load(object sender, EventArgs e)
|
||||
{
|
||||
lbGroups.Dock = DockStyle.Fill;
|
||||
glst = GroupInfoList.Get();
|
||||
lbGroups.DataSource = glst;
|
||||
lbGroups.DisplayMember = "GroupName";
|
||||
lbGroups.ValueMember = "GID";
|
||||
SetGroup();
|
||||
}
|
||||
private void lbGroups_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetGroup();
|
||||
Console.WriteLine("Group ID = {0}", lbGroups.SelectedValue);
|
||||
}
|
||||
private void SetGroup()
|
||||
{
|
||||
grp = glst[lbGroups.SelectedIndex].Get();
|
||||
pg.SelectedObject = grp;
|
||||
}
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||
grp.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Volian.MSWord;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using Org.Mentalis.Files;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
|
||||
private void MigrateLibDocs(OleDbConnection cn, string pth, bool appending)
|
||||
{
|
||||
// MessageBox.Show("Before LibDocs");
|
||||
frmMain.AddInfo("Before MigrateLibDocs{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
// Get all of the library documents - the first list has the entire list of files
|
||||
// found within the rtffiles folder, the second list contains usages from the 'tran'
|
||||
// file. During processing for procedures/sections occurs, the used library documents
|
||||
// will be migrated. After that, any remaining library documents will be added to
|
||||
// the section table without a reference from the structuretbl.
|
||||
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
||||
VEPROMS.CSLA.Library.DocumentInfoList docList = VEPROMS.CSLA.Library.DocumentInfoList.Get();
|
||||
frmMain.UpdateLabelsLibDocs(0, 0);
|
||||
if (Directory.Exists(pth + "\\rtffiles"))
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
|
||||
FileInfo[] fis = di.GetFiles("DOC_*.LIB");
|
||||
frmMain.UpdateLabelsSetProc(fis.Length);
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
string fName = fi.Name.Substring(0, 8).ToUpper();
|
||||
frmMain.UpdateLabelsLibDocs(1, 0);
|
||||
if (appending)
|
||||
{
|
||||
foreach (VEPROMS.CSLA.Library.DocumentInfo docInfo in docList)
|
||||
{
|
||||
if(docInfo.Config.Contains(string.Format("\"{0}.LIB\"", fName)))
|
||||
dicLibDocSect[fName] = docInfo.DocID;
|
||||
}
|
||||
}
|
||||
else
|
||||
dicLibDocSect[fName] = MigrateLibDoc(fi);
|
||||
}
|
||||
}
|
||||
dicLibDocRef = new Dictionary<string, int>();
|
||||
OleDbDataAdapter da_doc = new OleDbDataAdapter("select [FROMNUMBER], [FROMSEQUEN], [TONUMBER] from [tran] where [TONUMBER] LIKE 'doc_%' or [TONUMBER] like 'DOC_%'", cn);
|
||||
DataSet ds_doc = new DataSet();
|
||||
da_doc.Fill(ds_doc);
|
||||
frmMain.UpdateLabelsSetSect(ds_doc.Tables[0].Rows.Count);
|
||||
foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
|
||||
{
|
||||
frmMain.UpdateLabelsLibDocs(0, 1);
|
||||
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + TextConvert.ConvertSeq(dr_doc["FROMSEQUEN"].ToString()).PadRight(10);
|
||||
if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
|
||||
log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
|
||||
else
|
||||
dicLibDocRef[key] = dicLibDocSect[dr_doc["TONUMBER"].ToString().ToUpper()];
|
||||
}
|
||||
da_doc.Dispose();
|
||||
frmMain.AddInfo("After MigrateLibDocs{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
// MessageBox.Show("After LibDocs");
|
||||
}
|
||||
private int MigrateLibDoc(FileInfo fi)
|
||||
{
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
string title = null; // for docname, remove the '.lib', i.e. substring(0,8)
|
||||
ci.AddItem("Edit", "Initialized", "true");
|
||||
ci.AddItem("History", "OriginalFileName", fi.Name);
|
||||
string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
|
||||
int Docid = SaveWordDoc(tmpRtfFileName, title, null, false, ci, string.Empty,fi.LastWriteTimeUtc);
|
||||
File.Delete(tmpRtfFileName);
|
||||
return Docid;
|
||||
}
|
||||
private string LoadFromLib(BinaryReader br)
|
||||
{
|
||||
int nchar = br.ReadInt16();
|
||||
if (nchar > 0)
|
||||
{
|
||||
string tmp = new string(br.ReadChars(nchar));
|
||||
return tmp.Substring(0, tmp.Length - 1); // remove null at end.
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private string GetLibDocData(FileInfo fi, ConfigInfo ci, ref string title)
|
||||
{
|
||||
title = null;
|
||||
// get the number, title, etc from the file.
|
||||
// use the path to open the file & read the title & comment
|
||||
DateTime dts = fi.LastWriteTimeUtc;
|
||||
FileStream fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
BinaryReader br = new BinaryReader(fs, System.Text.ASCIIEncoding.ASCII);
|
||||
string tmpRtfFileName = Path.GetTempFileName();
|
||||
FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create);
|
||||
BinaryWriter bw = new BinaryWriter(tmpfile, System.Text.Encoding.ASCII);
|
||||
int cntPage = br.ReadInt16();
|
||||
if (cntPage != -1)
|
||||
{ // Not End of File
|
||||
ci.AddItem("Section", "NumPages", cntPage.ToString());
|
||||
string ldtitle = LoadFromLib(br);
|
||||
if (ldtitle != null && ldtitle != "") title = ldtitle;
|
||||
ci.AddItem("LibDoc", "Comment", LoadFromLib(br));
|
||||
long l = br.BaseStream.Length - br.BaseStream.Position;
|
||||
byte[] buf = new byte[l];
|
||||
br.Read(buf, 0, (int)l);
|
||||
bw.Write(buf, 0, (int)l);
|
||||
br.Close();
|
||||
fs.Close();
|
||||
bw.Close();
|
||||
tmpfile.Close();
|
||||
WaitMS(wms); // give it some time to close the tempfile before adding section
|
||||
File.SetLastWriteTimeUtc(tmpRtfFileName, dts);
|
||||
}
|
||||
return tmpRtfFileName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Volian.MSWord;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using Org.Mentalis.Files;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
|
||||
private void MigrateLibDocs(OleDbConnection cn, string pth)
|
||||
{
|
||||
// Get all of the library documents - the first list has the entire list of files
|
||||
// found within the rtffiles folder, the second list contains usages from the 'tran'
|
||||
// file. During processing for procedures/sections occurs, the used library documents
|
||||
// will be migrated. After that, any remaining library documents will be added to
|
||||
// the section table without a reference from the structuretbl.
|
||||
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
||||
frmMain.UpdateLabelsLibDocs(0, 0);
|
||||
if (Directory.Exists(pth + "\\rtffiles"))
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(pth + "\\RTFFILES");
|
||||
FileInfo[] fis = di.GetFiles("DOC_*.LIB");
|
||||
frmMain.UpdateLabelsSetProc(fis.Length);
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
frmMain.UpdateLabelsLibDocs(1, 0);
|
||||
dicLibDocSect[fi.Name.Substring(0, 8).ToUpper()] = MigrateLibDoc(fi);
|
||||
}
|
||||
}
|
||||
dicLibDocRef = new Dictionary<string, int>();
|
||||
OleDbDataAdapter da_doc = new OleDbDataAdapter("select [FROMNUMBER], [FROMSEQUEN], [TONUMBER] from [tran] where [TONUMBER] LIKE 'doc_%' or [TONUMBER] like 'DOC_%'", cn);
|
||||
DataSet ds_doc = new DataSet();
|
||||
da_doc.Fill(ds_doc);
|
||||
frmMain.UpdateLabelsSetSect(ds_doc.Tables[0].Rows.Count);
|
||||
foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
|
||||
{
|
||||
frmMain.UpdateLabelsLibDocs(0, 1);
|
||||
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + dr_doc["FROMSEQUEN"].ToString().PadRight(10);
|
||||
if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
|
||||
log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
|
||||
else
|
||||
dicLibDocRef[key] = dicLibDocSect[dr_doc["TONUMBER"].ToString().ToUpper()];
|
||||
}
|
||||
da_doc.Dispose();
|
||||
}
|
||||
private int MigrateLibDoc(FileInfo fi)
|
||||
{
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
string title = null; // for docname, remove the '.lib', i.e. substring(0,8)
|
||||
DateTime dts = DateTime.Now;
|
||||
ci.AddItem("Edit", "Initialized", "true");
|
||||
string tmpRtfFileName = GetLibDocData(fi, ci, ref title);
|
||||
int Docid = SaveWordDoc(tmpRtfFileName, title, null, ci, string.Empty);
|
||||
File.Delete(tmpRtfFileName);
|
||||
return Docid;
|
||||
}
|
||||
private string LoadFromLib(BinaryReader br)
|
||||
{
|
||||
int nchar = br.ReadInt16();
|
||||
if (nchar > 0)
|
||||
{
|
||||
string tmp = new string(br.ReadChars(nchar));
|
||||
return tmp.Substring(0, tmp.Length - 1); // remove null at end.
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private string GetLibDocData(FileInfo fi, ConfigInfo ci, ref string title)
|
||||
{
|
||||
title = null;
|
||||
// get the number, title, etc from the file.
|
||||
// use the path to open the file & read the title & comment
|
||||
DateTime dts = fi.LastWriteTimeUtc;
|
||||
FileStream fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
BinaryReader br = new BinaryReader(fs, System.Text.ASCIIEncoding.ASCII);
|
||||
string tmpRtfFileName = Path.GetTempFileName();
|
||||
FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create);
|
||||
BinaryWriter bw = new BinaryWriter(tmpfile, System.Text.Encoding.ASCII);
|
||||
int cntPage = br.ReadInt16();
|
||||
if (cntPage != -1)
|
||||
{ // Not End of File
|
||||
ci.AddItem("Section", "NumPages", cntPage.ToString());
|
||||
string ldtitle = LoadFromLib(br);
|
||||
if (ldtitle != null && ldtitle != "") title = ldtitle;
|
||||
ci.AddItem("LibDoc", "Comment", LoadFromLib(br));
|
||||
long l = br.BaseStream.Length - br.BaseStream.Position;
|
||||
byte[] buf = new byte[l];
|
||||
br.Read(buf, 0, (int)l);
|
||||
bw.Write(buf, 0, (int)l);
|
||||
br.Close();
|
||||
fs.Close();
|
||||
bw.Close();
|
||||
tmpfile.Close();
|
||||
WaitMS(wms); // give it some time to close the tempfile before adding section
|
||||
File.SetLastWriteTimeUtc(tmpRtfFileName, dts);
|
||||
}
|
||||
return tmpRtfFileName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,243 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
public class ConfigFile
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
#region MigrateStrings
|
||||
// the following lists are used for storing the element and attribute names
|
||||
// for migrating of ini & cfg files. The names stored in these lists are
|
||||
// those that should be migrated. If not in this list, the data (either element
|
||||
// or attribute name) is prefaced with a 'z'. At some point in the future, those
|
||||
// names with a 'z' will be removed.
|
||||
public List<string> listIni_EleName = new List<string>();
|
||||
public List<string> listIni_AttrName = new List<string>();
|
||||
private void SetIniEleName()
|
||||
{
|
||||
// veproms.ini
|
||||
listIni_EleName.Add("graphics");
|
||||
listIni_EleName.Add("color");
|
||||
listIni_EleName.Add("print");
|
||||
listIni_EleName.Add("startup");
|
||||
listIni_EleName.Add("data integrity");
|
||||
listIni_EleName.Add("wordprocessor");
|
||||
listIni_EleName.Add("procedurelisttabstops");
|
||||
|
||||
// proc.ini
|
||||
listIni_EleName.Add("rodefaults");
|
||||
listIni_EleName.Add("display");
|
||||
listIni_EleName.Add("backgrounddefaults");
|
||||
listIni_EleName.Add("unit");
|
||||
listIni_EleName.Add("applicability");
|
||||
listIni_EleName.Add("procedureset");
|
||||
|
||||
// roapp.ini
|
||||
listIni_EleName.Add("roapp");
|
||||
|
||||
// <user>.cfg
|
||||
listIni_EleName.Add("spelldictionary");
|
||||
// listIni_EleName.Add("wordprocessor"); - already in here.
|
||||
}
|
||||
|
||||
private void SetIniAttrName()
|
||||
{
|
||||
//veproms.ini
|
||||
listIni_AttrName.Add("defaultext");
|
||||
listIni_AttrName.Add("ro");
|
||||
listIni_AttrName.Add("editbackground");
|
||||
listIni_AttrName.Add("black");
|
||||
listIni_AttrName.Add("blue");
|
||||
listIni_AttrName.Add("green");
|
||||
listIni_AttrName.Add("cyan");
|
||||
listIni_AttrName.Add("red");
|
||||
listIni_AttrName.Add("magenta");
|
||||
listIni_AttrName.Add("brown");
|
||||
listIni_AttrName.Add("lightgray");
|
||||
listIni_AttrName.Add("darkgray");
|
||||
listIni_AttrName.Add("ligthblue");
|
||||
listIni_AttrName.Add("lightgreen");
|
||||
listIni_AttrName.Add("lightcyan");
|
||||
listIni_AttrName.Add("lightred");
|
||||
listIni_AttrName.Add("lightmagenta");
|
||||
listIni_AttrName.Add("yellow");
|
||||
listIni_AttrName.Add("white");
|
||||
listIni_AttrName.Add("underlinewidth");
|
||||
listIni_AttrName.Add("verticalOffset");
|
||||
listIni_AttrName.Add("strokewidth");
|
||||
listIni_AttrName.Add("strokewidthbold");
|
||||
listIni_AttrName.Add("messageboxtitle");
|
||||
listIni_AttrName.Add("messagefile");
|
||||
listIni_AttrName.Add("enableindexcheck");
|
||||
listIni_AttrName.Add("wordwrap");
|
||||
listIni_AttrName.Add("procedurenumbertab");
|
||||
listIni_AttrName.Add("proceduretitletab");
|
||||
|
||||
// proc.ini
|
||||
listIni_AttrName.Add("setpoint");
|
||||
listIni_AttrName.Add("graphics");
|
||||
listIni_AttrName.Add("ropath");
|
||||
listIni_AttrName.Add("display");
|
||||
listIni_AttrName.Add("sectiontitle");
|
||||
listIni_AttrName.Add("sectionnumber");
|
||||
listIni_AttrName.Add("number");
|
||||
listIni_AttrName.Add("othernumber");
|
||||
listIni_AttrName.Add("name");
|
||||
listIni_AttrName.Add("othername");
|
||||
listIni_AttrName.Add("text");
|
||||
listIni_AttrName.Add("othertext");
|
||||
listIni_AttrName.Add("id");
|
||||
listIni_AttrName.Add("otherid");
|
||||
listIni_AttrName.Add("procedurenumber");
|
||||
listIni_AttrName.Add("masterdir");
|
||||
|
||||
|
||||
// roapp.ini
|
||||
listIni_AttrName.Add("extention"); // NOTE MIS-SPELLING was in 16-bit program!
|
||||
|
||||
// <user>.cfg
|
||||
listIni_AttrName.Add("custom");
|
||||
listIni_AttrName.Add("page");
|
||||
listIni_AttrName.Add("toolbar");
|
||||
listIni_AttrName.Add("paragraph");
|
||||
listIni_AttrName.Add("ruler");
|
||||
listIni_AttrName.Add("userphone1");
|
||||
listIni_AttrName.Add("userphone2");
|
||||
listIni_AttrName.Add("userloc1");
|
||||
listIni_AttrName.Add("userloc2");
|
||||
}
|
||||
#endregion
|
||||
#region LoadDataCode
|
||||
public ConfigFile()
|
||||
{
|
||||
}
|
||||
public void LoadUsrCfg(User user, string vepromspath)
|
||||
{
|
||||
string cfgpath = vepromspath + "\\config";
|
||||
if (!Directory.Exists(cfgpath))
|
||||
{
|
||||
log.Info("No user cfgs found in config directory - did not migrate any user cfgs");
|
||||
return;
|
||||
}
|
||||
DirectoryInfo di = new DirectoryInfo(cfgpath);
|
||||
FileInfo[] fis = di.GetFiles("*.cfg");
|
||||
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
string cfgname = fi.Name.Substring(0, fi.Name.IndexOf("."));
|
||||
if (cfgname.ToUpper() == user.UserID.ToUpper())
|
||||
{
|
||||
// Get Users table fields by reading the cfg file into a buffer & looking
|
||||
// for the UserNetworkId and UserName fields.
|
||||
StreamReader myReader = new StreamReader(fi.FullName);
|
||||
string sLine;
|
||||
string UserLogin = null;
|
||||
string UserName = null;
|
||||
int indx = -1;
|
||||
while ((sLine = myReader.ReadLine()) != null && (UserLogin == null || UserName == null))
|
||||
{
|
||||
if (sLine.Length > 0 && sLine.Substring(0, 1) != ";")
|
||||
{
|
||||
if ((indx = sLine.ToLower().IndexOf("usernetworkid")) >= 0)
|
||||
{
|
||||
indx = sLine.IndexOf("=", indx + 13);
|
||||
UserLogin = sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim();
|
||||
}
|
||||
else if ((indx = sLine.ToLower().IndexOf("username")) >= 0)
|
||||
{
|
||||
indx = sLine.IndexOf("=", indx + 8);
|
||||
UserName = sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
myReader.Close();
|
||||
|
||||
// get the xml to set the config field
|
||||
XmlDocument d = IniToXml(fi.FullName);
|
||||
user.Config = d == null ? null : d.InnerXml;
|
||||
user.UserLogin = UserLogin;
|
||||
user.UserName = UserName;
|
||||
user.CFGName = cfgname;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public XmlDocument LoadSystemIni(string vepromspath)
|
||||
{
|
||||
string inipath = vepromspath + "\\veproms.ini";
|
||||
if (!File.Exists(inipath))
|
||||
{
|
||||
log.InfoFormat("Did not migrate {0} - file not found", inipath);
|
||||
return null;
|
||||
}
|
||||
XmlDocument d = IniToXml(inipath);
|
||||
// see if default image file extension was set, if not make it TIF
|
||||
XmlNode gr = d.SelectSingleNode("//Graphics");
|
||||
XmlNode ext = null;
|
||||
if (gr != null) ext = gr.SelectSingleNode("@defaultext");
|
||||
if (ext == null)
|
||||
{
|
||||
// if the graphics node doesn't exist, make it.
|
||||
if (gr == null)
|
||||
{
|
||||
gr = d.CreateElement("Graphics");
|
||||
d.DocumentElement.AppendChild(gr);
|
||||
}
|
||||
XmlAttribute xa = d.CreateAttribute("defaultext");
|
||||
xa.Value = "TIF";
|
||||
gr.Attributes.Append(xa);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
public XmlDocument LoadRoAppIni(string ropath)
|
||||
{
|
||||
string inipath = ropath + "\\roapp.ini";
|
||||
// not an error if it does not exist - just return null.
|
||||
if (!File.Exists(inipath)) return null;
|
||||
|
||||
XmlDocument d = IniToXml(inipath);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
public XmlDocument IniToXml(string path)
|
||||
{
|
||||
FileInfo fi = new FileInfo(path);
|
||||
if (fi.Exists)
|
||||
{
|
||||
PrivateProfile ppCfg;
|
||||
if (listIni_AttrName == null || listIni_AttrName.Count == 0) SetIniAttrName();
|
||||
if (listIni_EleName == null || listIni_EleName.Count == 0) SetIniEleName();
|
||||
ppCfg = new PrivateProfile(path, listIni_EleName, listIni_AttrName);
|
||||
return ppCfg.XML();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,392 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using Org.Mentalis.Files;
|
||||
using Config;
|
||||
using Utils;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private static List<string> _DataPaths = null;
|
||||
public static List<string> DataPaths
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DataPaths == null)
|
||||
{
|
||||
_DataPaths = new List<string>();
|
||||
string sCfg = Environment.GetEnvironmentVariable("veconfig");
|
||||
IniReader cfg = new IniReader(sCfg);
|
||||
// Get DataPath
|
||||
string sDP = cfg.ReadString("menu", "DataPath");
|
||||
// Split DataPath into directories
|
||||
// Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
|
||||
// make it. It was done this way because there was no way to get the Folder given a name/Title.
|
||||
foreach (string s1 in sDP.Split(";".ToCharArray()))
|
||||
{
|
||||
if (s1.Length > 0)
|
||||
{
|
||||
string[] s2 = s1.Split(",".ToCharArray());
|
||||
_DataPaths.Add( s2[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Loader._DataPaths;
|
||||
}
|
||||
}
|
||||
public List<Folder> vlnDataPathFolders() // was vlnDataPath
|
||||
{
|
||||
List<Folder> dpf = new List<Folder>();
|
||||
// Get path to config file
|
||||
string sCfg = Environment.GetEnvironmentVariable("veconfig");
|
||||
IniReader cfg = new IniReader(sCfg);
|
||||
// Get DataPath
|
||||
string sDP = cfg.ReadString("menu", "DataPath");
|
||||
// Split DataPath into directories
|
||||
|
||||
// Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
|
||||
// make it. It was done this way because there was no way to get the Folder given a name/Title.
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
|
||||
foreach (string s1 in sDP.Split(";".ToCharArray()))
|
||||
{
|
||||
if (s1.Length > 0)
|
||||
{
|
||||
string[] s2 = s1.Split(",".ToCharArray());
|
||||
Folder fld = GetFolderFromName(s2[1], s2[0], fil);
|
||||
if (fld == null)
|
||||
fld = Folder.MakeFolder(sysFolder, dbConn, s2[1], s2[0], FolderName(s2[0]), null, null, DateTime.Now, "Migration");
|
||||
dpf.Add(fld);
|
||||
}
|
||||
}
|
||||
return dpf;
|
||||
}
|
||||
private Folder GetFolderFromName(string name, string title, FolderInfoList fil)
|
||||
{
|
||||
Folder fld = null;
|
||||
foreach (FolderInfo fi in fil)
|
||||
{
|
||||
string fi_Title = fi.Title.TrimEnd('\\');
|
||||
//if (fi.Name.ToUpper() == name.ToUpper() && fi.Title.ToUpper() == title.ToUpper())
|
||||
if (fi.Name.ToUpper() == name.ToUpper() && fi_Title.ToUpper() == title.ToUpper())
|
||||
{
|
||||
fld = Folder.Get(fi.FolderID);
|
||||
return fld;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private string FolderName(string Path)
|
||||
{
|
||||
int ind = Path.LastIndexOf("\\");
|
||||
if (ind == Path.Length-1 || ind < 0) return Path;
|
||||
return Path.Substring(ind + 1);
|
||||
}
|
||||
private DocVersion GetDocVersionFromName(Folder fld, string f)
|
||||
{
|
||||
DocVersion dv = null;
|
||||
DocVersionInfoList dvil = DocVersionInfoList.GetByFolderID(fld.FolderID);
|
||||
foreach (DocVersionInfo dvi in dvil)
|
||||
{
|
||||
if (dvi.Name.ToUpper() == f.ToUpper())
|
||||
{
|
||||
dv = DocVersion.Get(dvi.VersionID);
|
||||
return dv;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private object cslaObject(vlnObject vb, Connection dbConn, Object parfld, TreeNode tn)
|
||||
{
|
||||
switch (vb.Type)
|
||||
{
|
||||
case "plant":
|
||||
case "set":
|
||||
// if folder exists... get the Folder object, otherwise create it.
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
Folder fld = GetFolderFromName(vb.Title, vb.Path, fil);
|
||||
if (fld==null) fld = Folder.MakeFolder((Folder)parfld, dbConn, vb.Title, vb.Path, FolderName(vb.Path), null, null, DateTime.Now, "Migration");
|
||||
tn.Tag = fld;
|
||||
return (object) fld;
|
||||
case "version":
|
||||
// see if version exists for the input folder, parfld.
|
||||
DocVersion v = GetDocVersionFromName((Folder)parfld, vb.Title);
|
||||
if (v == null)
|
||||
{
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
|
||||
XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
|
||||
AddSlaveUnits(d, vb.Path);
|
||||
if (frmMain.ProcessFailed)
|
||||
return null;
|
||||
//DocVersionConfig fld_cfg = new DocVersionConfig(d == null ? "" : d.InnerXml);
|
||||
FolderConfig fld_cfg = (d==null)?null:new FolderConfig(d.InnerXml);
|
||||
// translate curset.dat into xml & add to d (somehow).
|
||||
string csfile = string.Format("{0}\\curset.dat",vb.Path);
|
||||
string defPlantFmt = null;
|
||||
if (File.Exists(csfile))
|
||||
{
|
||||
CurSet cs = new CurSet(csfile);
|
||||
try
|
||||
{
|
||||
if (fld_cfg == null) fld_cfg = new FolderConfig();
|
||||
fld_cfg = cs.Convert(fld_cfg);
|
||||
defPlantFmt = cs.GetDefFmt();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("error in convert curset.dat, ex = {0}", ex.Message);
|
||||
frmMain.AddError(ex, "error in convert curset.dat");
|
||||
}
|
||||
}
|
||||
// *** RHM 20120613 - Fix
|
||||
// *** This was naming the DocVersion to the folder name
|
||||
//string titlepath = vb.Path + "\\" + "Title";
|
||||
//FileInfo fi = new FileInfo(titlepath);
|
||||
//string thetitle = vb.Title;
|
||||
//if (File.Exists(titlepath))
|
||||
//{
|
||||
// StreamReader myReader = new StreamReader(titlepath);
|
||||
// thetitle = myReader.ReadLine();
|
||||
// myReader.Close();
|
||||
//}
|
||||
Folder tmpfld = (Folder)parfld;
|
||||
FormatInfo format = null;
|
||||
if (defPlantFmt != null && defPlantFmt != "")
|
||||
{
|
||||
format = GetFormat(defPlantFmt);
|
||||
}
|
||||
else
|
||||
format = FormatInfo.Get(1);
|
||||
|
||||
using(Format fmt = format.Get())
|
||||
v = DocVersion.MakeDocVersion(tmpfld, (int)DocVersionType(vb.Path.ToLower()), vb.Title, vb.Path.ToLower(), null, fmt, fld_cfg == null ? null : fld_cfg.ToString(), DateTime.Now, "Migration");
|
||||
}
|
||||
tn.Tag = v;
|
||||
MigrateDocVersion(v, false);
|
||||
return (object)v;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void AddSlaveUnits(XmlDocument d, string path)
|
||||
{
|
||||
string masterDir = GetMasterDir(d);
|
||||
if (masterDir == null)
|
||||
{
|
||||
//not a master slave procedure set
|
||||
return;
|
||||
}
|
||||
DirectoryInfo master = new DirectoryInfo(path);
|
||||
if (master.Name.ToUpper() != masterDir.ToUpper()) return;
|
||||
List<string> names = GetUnitNames(d);
|
||||
if (names == null)
|
||||
{
|
||||
frmMain.ProcessFailed = true;
|
||||
MessageBox.Show("Could not find Unit names in slave proc.ini files");
|
||||
frmMain.MyError = "Could not find Unit names in slave proc.ini files";
|
||||
return;
|
||||
}
|
||||
DirectoryInfo[] slaves = master.Parent.GetDirectories(masterDir.ToUpper().Replace(".PRC",".SL*"));
|
||||
XmlDocument units = new XmlDocument();
|
||||
units.LoadXml("<Slaves/>");
|
||||
int idx = 0;
|
||||
foreach (DirectoryInfo slave in slaves)
|
||||
{
|
||||
FileInfo[] inis = slave.GetFiles("proc.ini");
|
||||
if (inis.Length > 0)
|
||||
{
|
||||
FileInfo ini = inis[0];
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
XmlDocument xSlave = cfg.IniToXml(ini.FullName);
|
||||
xSlave.LoadXml(xSlave.OuterXml.Replace("<Unit", "<Slave"));
|
||||
string slaveDir = GetMasterDir(xSlave);
|
||||
if (slaveDir == null)
|
||||
{
|
||||
frmMain.ProcessFailed = true;
|
||||
MessageBox.Show("Could not find MasterDir in slave proc.ini files");
|
||||
frmMain.MyError = "Could not find MasterDir in slave proc.ini files";
|
||||
return;
|
||||
}
|
||||
if (slaveDir.ToUpper() == masterDir.ToUpper())
|
||||
{
|
||||
XmlNode unit = xSlave.SelectSingleNode("Config/Slave");
|
||||
XmlAttribute oldindex = xSlave.CreateAttribute("oldindex");
|
||||
for (int x = 0; x < names.Count; x++)
|
||||
{
|
||||
if (unit.Attributes.GetNamedItem("Name").InnerText == names[x])
|
||||
{
|
||||
oldindex.InnerText = (x + 1).ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(oldindex.InnerText == "")
|
||||
oldindex.InnerText = slave.Extension.ToUpper().Replace(".SL", "");
|
||||
unit.Attributes.SetNamedItem(oldindex);
|
||||
XmlAttribute index = xSlave.CreateAttribute("index");
|
||||
idx++;
|
||||
index.InnerText = idx.ToString();
|
||||
unit.Attributes.SetNamedItem(index);
|
||||
if (names.Count == slaves.Length)
|
||||
oldindex.InnerText = index.InnerText;
|
||||
if (xSlave.SelectSingleNode("Config/ProcedureSet") != null)
|
||||
{
|
||||
XmlAttribute setName = xSlave.CreateAttribute("SetName");
|
||||
if(xSlave.SelectSingleNode("Config/ProcedureSet/@Name") != null)
|
||||
setName.InnerText = xSlave.SelectSingleNode("Config/ProcedureSet/@Name").InnerText;
|
||||
unit.Attributes.SetNamedItem(setName);
|
||||
XmlAttribute setID = xSlave.CreateAttribute("SetID");
|
||||
if(xSlave.SelectSingleNode("Config/ProcedureSet/@ID") != null)
|
||||
setID.InnerText = xSlave.SelectSingleNode("Config/ProcedureSet/@ID").InnerText;
|
||||
unit.Attributes.SetNamedItem(setID);
|
||||
}
|
||||
units.DocumentElement.AppendChild(units.ImportNode(unit, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
d.DocumentElement.AppendChild(d.ImportNode(units.DocumentElement, true));
|
||||
//d.DocumentElement.RemoveChild(d.SelectSingleNode("Config/Unit"));
|
||||
Console.WriteLine(d.OuterXml);
|
||||
}
|
||||
private static XmlNode GetXMLNode(XmlDocument d, string nodeName)
|
||||
{
|
||||
return GetXMLNode(d.DocumentElement, nodeName);
|
||||
}
|
||||
private static XmlNode GetXMLNode(XmlNode nd, string nodeName)
|
||||
{
|
||||
XmlNodeList xl = nd.SelectNodes(string.Format("//{0}", nodeName));
|
||||
if (xl.Count == 0 && System.Text.RegularExpressions.Regex.IsMatch(nodeName, "^[A-Za-z0-9]+$"))
|
||||
xl = nd.SelectNodes(
|
||||
string.Format("//*[translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{0}']", nodeName.ToLower()));
|
||||
switch (xl.Count)
|
||||
{
|
||||
case 0: // No nodes found
|
||||
return null;
|
||||
case 1: // Found the node
|
||||
XmlNode xn = xl[0];
|
||||
if (xn.GetType() == typeof(XmlElement)) return xn;
|
||||
throw new Exception(string.Format("Retrieved {0} while looking for XmlElement //{1}", xn.GetType().ToString(), nodeName));
|
||||
default: // Found more than 1 node
|
||||
throw new Exception(string.Format("Found more than one node //{0}", nodeName));
|
||||
}
|
||||
}
|
||||
private static XmlAttribute GetXMLAttribute(XmlNode xx, string item)
|
||||
{
|
||||
//XmlNodeList xl = xx.SelectNodes(string.Format("@{0}", item));
|
||||
XmlNodeList xl = xx.SelectNodes(
|
||||
string.Format("@*[translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{0}']", item.ToLower()));
|
||||
switch (xl.Count)
|
||||
{
|
||||
case 0: // No nodes found
|
||||
return null;
|
||||
case 1: // Found the node
|
||||
XmlNode xn = xl[0];
|
||||
if (xn.GetType() == typeof(XmlAttribute)) return (XmlAttribute)xn;
|
||||
throw new Exception(string.Format("Retrieved {0} while looking for XmlAttribute @{1}", xn.GetType().ToString(), item));
|
||||
default: // Found more than 1 node
|
||||
throw new Exception(string.Format("Found more than one node @{0}", item));
|
||||
}
|
||||
}
|
||||
private List<string> GetUnitNames(XmlDocument d)
|
||||
{
|
||||
XmlNode zapp = GetXMLNode(d, "Unit");// d.SelectSingleNode("//Unit");
|
||||
if (zapp == null) return null;
|
||||
XmlNode zmstr = GetXMLAttribute(zapp, "Name");// zapp.Attributes.GetNamedItem("Name");
|
||||
if (zmstr == null) return null;
|
||||
string[] names = zmstr.InnerText.Split(",".ToCharArray());
|
||||
return new List<string>(names);
|
||||
}
|
||||
|
||||
private static string GetMasterDir(XmlDocument d)
|
||||
{
|
||||
XmlNode zapp = GetXMLNode(d, "Applicability");// d.SelectSingleNode("//Applicability");
|
||||
if (zapp == null) return null;
|
||||
XmlNode zmstr = GetXMLAttribute(zapp, "MasterDir");// zapp.Attributes.GetNamedItem("MasterDir");
|
||||
if (zmstr == null) return null;
|
||||
return zmstr.InnerText;
|
||||
}
|
||||
private string _OnlyThisFolder;
|
||||
public string OnlyThisFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_OnlyThisFolder == null)
|
||||
{
|
||||
if (frmMain.MySettings.OnlyThisSet || frmMain.Automatic)
|
||||
{
|
||||
DirectoryInfo dir = new DirectoryInfo(frmMain.ProcedureSetPath);
|
||||
if (frmMain.Automatic)
|
||||
_OnlyThisFolder = dir.FullName.ToUpper();
|
||||
else
|
||||
_OnlyThisFolder = dir.Parent.FullName.ToUpper();
|
||||
}
|
||||
else if ((frmMain.MySettings.ProcessOnlyInLocation ?? "") != "")
|
||||
_OnlyThisFolder = frmMain.MySettings.ProcessOnlyInLocation.ToUpper();
|
||||
else
|
||||
_OnlyThisFolder = "";
|
||||
}
|
||||
return _OnlyThisFolder;
|
||||
}
|
||||
}
|
||||
private bool IsInSelectedPlantData(Object parent)
|
||||
{
|
||||
if (OnlyThisFolder == "")
|
||||
return true;
|
||||
Folder fld = parent as Folder;
|
||||
if (fld == null)
|
||||
return true;
|
||||
if (fld.MyParent.MyParent != null)
|
||||
return true;
|
||||
if (fld.Title.ToUpper() == OnlyThisFolder)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
private void MigrateChildren(vlnObject vb, vlnServer vs, Connection dbConn, Object parent, TreeNode tn)
|
||||
{
|
||||
if (vb.Type != "version")
|
||||
{
|
||||
vb.LoadChildren(vs.GetChildren(vb.ToString()));
|
||||
List<vlnObject> lv = vb.Children;
|
||||
if (vb.Children.Count == 0)
|
||||
frmMain.AddError("No children found for {0}", vb.Path);
|
||||
foreach (vlnObject vbc in lv)
|
||||
{
|
||||
if (vbc.Path.ToUpper().StartsWith(OnlyThisFolder) || OnlyThisFolder.StartsWith(vbc.Path.ToUpper()))
|
||||
{
|
||||
TreeNode tnc = tn.Nodes.Add(vbc.Title);
|
||||
object idc = cslaObject(vbc, dbConn, parent, tnc);
|
||||
if (frmMain.ProcessFailed)
|
||||
return;
|
||||
frmMain.Status = "Loading " + vbc.Title;
|
||||
MigrateChildren(vbc, vs, dbConn, idc, tnc);
|
||||
frmMain.ChildrenProcessed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
frmMain.Status = " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,284 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using Org.Mentalis.Files;
|
||||
using Config;
|
||||
using Utils;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private List<Folder> vlnDataPathFolders() // was vlnDataPath
|
||||
{
|
||||
List<Folder> dpf = new List<Folder>();
|
||||
// Get path to config file
|
||||
string sCfg = Environment.GetEnvironmentVariable("veconfig");
|
||||
IniReader cfg = new IniReader(sCfg);
|
||||
// Get DataPath
|
||||
string sDP = cfg.ReadString("menu", "DataPath");
|
||||
// Split DataPath into directories
|
||||
|
||||
// Get the current list of folders so that if it already exists, just get the 'Folder', otherwise
|
||||
// make it. It was done this way because there was no way to get the Folder given a name/Title.
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
|
||||
foreach (string s1 in sDP.Split(";".ToCharArray()))
|
||||
{
|
||||
if (s1.Length > 0)
|
||||
{
|
||||
string[] s2 = s1.Split(",".ToCharArray());
|
||||
Folder fld = GetFolderFromName(s2[1], s2[0], fil);
|
||||
if (fld == null)
|
||||
fld = Folder.MakeFolder(sysFolder, dbConn, s2[1], s2[0], FolderName(s2[0]), null, null, DateTime.Now, "Migration");
|
||||
dpf.Add(fld);
|
||||
}
|
||||
}
|
||||
return dpf;
|
||||
}
|
||||
private Folder GetFolderFromName(string name, string title, FolderInfoList fil)
|
||||
{
|
||||
Folder fld = null;
|
||||
foreach (FolderInfo fi in fil)
|
||||
{
|
||||
if (fi.Name.ToUpper() == name.ToUpper() && fi.Title.ToUpper() == title.ToUpper())
|
||||
{
|
||||
fld = Folder.Get(fi.FolderID);
|
||||
return fld;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private string FolderName(string Path)
|
||||
{
|
||||
int ind = Path.LastIndexOf("\\");
|
||||
if (ind == Path.Length-1 || ind < 0) return Path;
|
||||
return Path.Substring(ind + 1);
|
||||
}
|
||||
private DocVersion GetDocVersionFromName(Folder fld, string f)
|
||||
{
|
||||
DocVersion dv = null;
|
||||
DocVersionInfoList dvil = DocVersionInfoList.GetByFolderID(fld.FolderID);
|
||||
foreach (DocVersionInfo dvi in dvil)
|
||||
{
|
||||
if (dvi.Name.ToUpper() == f.ToUpper())
|
||||
{
|
||||
dv = DocVersion.Get(dvi.VersionID);
|
||||
return dv;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private object cslaObject(vlnObject vb, Connection dbConn, Object parfld, TreeNode tn)
|
||||
{
|
||||
switch (vb.Type)
|
||||
{
|
||||
case "plant":
|
||||
case "set":
|
||||
// if folder exists... get the Folder object, otherwise create it.
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
Folder fld = GetFolderFromName(vb.Title, vb.Path, fil);
|
||||
if (fld==null) fld = Folder.MakeFolder((Folder)parfld, dbConn, vb.Title, vb.Path, FolderName(vb.Path), null, null, DateTime.Now, "Migration");
|
||||
tn.Tag = fld;
|
||||
return (object) fld;
|
||||
case "version":
|
||||
// see if version exists for the input folder, parfld.
|
||||
DocVersion v = GetDocVersionFromName((Folder)parfld, vb.Title);
|
||||
if (v == null)
|
||||
{
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
|
||||
XmlDocument d = cfg.IniToXml(vb.Path + "\\proc.ini");
|
||||
AddSlaveUnits(d, vb.Path);
|
||||
//DocVersionConfig fld_cfg = new DocVersionConfig(d == null ? "" : d.InnerXml);
|
||||
FolderConfig fld_cfg = (d==null)?null:new FolderConfig(d.InnerXml);
|
||||
// translate curset.dat into xml & add to d (somehow).
|
||||
string csfile = string.Format("{0}\\curset.dat",vb.Path);
|
||||
string defPlantFmt = null;
|
||||
if (File.Exists(csfile))
|
||||
{
|
||||
CurSet cs = new CurSet(csfile);
|
||||
try
|
||||
{
|
||||
if (fld_cfg == null) fld_cfg = new FolderConfig();
|
||||
fld_cfg = cs.Convert(fld_cfg);
|
||||
defPlantFmt = cs.GetDefFmt();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("error in convert curset.dat, ex = {0}", ex.Message);
|
||||
frmMain.AddError(ex, "error in convert curset.dat");
|
||||
}
|
||||
}
|
||||
// *** RHM 20120613 - Fix
|
||||
// *** This was naming the DocVersion to the folder name
|
||||
//string titlepath = vb.Path + "\\" + "Title";
|
||||
//FileInfo fi = new FileInfo(titlepath);
|
||||
//string thetitle = vb.Title;
|
||||
//if (File.Exists(titlepath))
|
||||
//{
|
||||
// StreamReader myReader = new StreamReader(titlepath);
|
||||
// thetitle = myReader.ReadLine();
|
||||
// myReader.Close();
|
||||
//}
|
||||
Folder tmpfld = (Folder)parfld;
|
||||
FormatInfo format = null;
|
||||
if (defPlantFmt != null && defPlantFmt != "")
|
||||
{
|
||||
format = GetFormat(defPlantFmt);
|
||||
}
|
||||
else
|
||||
format = FormatInfo.Get(1);
|
||||
|
||||
using(Format fmt = format.Get())
|
||||
v = DocVersion.MakeDocVersion(tmpfld, (int)DocVersionType(vb.Path.ToLower()), vb.Title, vb.Path.ToLower(), null, fmt, fld_cfg == null ? null : fld_cfg.ToString(), DateTime.Now, "Migration");
|
||||
}
|
||||
tn.Tag = v;
|
||||
MigrateDocVersion(v, false);
|
||||
return (object)v;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void AddSlaveUnits(XmlDocument d, string path)
|
||||
{
|
||||
string masterDir = GetMasterDir(d);
|
||||
if (masterDir == null) return;
|
||||
DirectoryInfo master = new DirectoryInfo(path);
|
||||
if (master.Name.ToUpper() != masterDir.ToUpper()) return;
|
||||
List<string> names = GetUnitNames(d);
|
||||
DirectoryInfo[] slaves = master.Parent.GetDirectories(masterDir.ToUpper().Replace(".PRC",".SL*"));
|
||||
XmlDocument units = new XmlDocument();
|
||||
units.LoadXml("<Slaves/>");
|
||||
int idx = 0;
|
||||
foreach (DirectoryInfo slave in slaves)
|
||||
{
|
||||
FileInfo[] inis = slave.GetFiles("proc.ini");
|
||||
if (inis.Length > 0)
|
||||
{
|
||||
FileInfo ini = inis[0];
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
XmlDocument xSlave = cfg.IniToXml(ini.FullName);
|
||||
xSlave.LoadXml(xSlave.OuterXml.Replace("<Unit", "<Slave"));
|
||||
string slaveDir = GetMasterDir(xSlave);
|
||||
if (slaveDir.ToUpper() == masterDir.ToUpper())
|
||||
{
|
||||
XmlNode unit = xSlave.SelectSingleNode("Config/Slave");
|
||||
XmlAttribute oldindex = xSlave.CreateAttribute("oldindex");
|
||||
oldindex.InnerText = slave.Extension.Replace(".SL", "");
|
||||
unit.Attributes.SetNamedItem(oldindex);
|
||||
XmlAttribute index = xSlave.CreateAttribute("index");
|
||||
idx++;
|
||||
index.InnerText = idx.ToString();
|
||||
unit.Attributes.SetNamedItem(index);
|
||||
if (names.Count == slaves.Length)
|
||||
oldindex.InnerText = index.InnerText;
|
||||
if (xSlave.SelectSingleNode("Config/ProcedureSet") != null)
|
||||
{
|
||||
XmlAttribute setName = xSlave.CreateAttribute("SetName");
|
||||
setName.InnerText = xSlave.SelectSingleNode("Config/ProcedureSet/@Name").InnerText;
|
||||
unit.Attributes.SetNamedItem(setName);
|
||||
XmlAttribute setID = xSlave.CreateAttribute("SetID");
|
||||
setID.InnerText = xSlave.SelectSingleNode("Config/ProcedureSet/@ID").InnerText;
|
||||
unit.Attributes.SetNamedItem(setID);
|
||||
}
|
||||
units.DocumentElement.AppendChild(units.ImportNode(unit, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
d.DocumentElement.AppendChild(d.ImportNode(units.DocumentElement, true));
|
||||
//d.DocumentElement.RemoveChild(d.SelectSingleNode("Config/Unit"));
|
||||
Console.WriteLine(d.OuterXml);
|
||||
}
|
||||
|
||||
private List<string> GetUnitNames(XmlDocument d)
|
||||
{
|
||||
XmlNode zapp = d.SelectSingleNode("//Unit");
|
||||
if (zapp == null) return null;
|
||||
XmlNode zmstr = zapp.Attributes.GetNamedItem("Name");
|
||||
if (zmstr == null) return null;
|
||||
string[] names = zmstr.InnerText.Split(",".ToCharArray());
|
||||
return new List<string>(names);
|
||||
}
|
||||
|
||||
private static string GetMasterDir(XmlDocument d)
|
||||
{
|
||||
XmlNode zapp = d.SelectSingleNode("//Applicability");
|
||||
if (zapp == null) return null;
|
||||
XmlNode zmstr = zapp.Attributes.GetNamedItem("MasterDir");
|
||||
if (zmstr == null) return null;
|
||||
return zmstr.InnerText;
|
||||
}
|
||||
private string _OnlyThisFolder;
|
||||
public string OnlyThisFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_OnlyThisFolder == null)
|
||||
{
|
||||
if (frmMain.MySettings.OnlyThisSet)
|
||||
{
|
||||
DirectoryInfo dir = new DirectoryInfo(frmMain.MySettings.ProcedureSetPath);
|
||||
_OnlyThisFolder = dir.Parent.FullName.ToUpper();
|
||||
}
|
||||
else
|
||||
_OnlyThisFolder = "";
|
||||
}
|
||||
return _OnlyThisFolder;
|
||||
}
|
||||
}
|
||||
private bool IsInSelectedPlantData(Object parent)
|
||||
{
|
||||
if (OnlyThisFolder == "")
|
||||
return true;
|
||||
Folder fld = parent as Folder;
|
||||
if (fld == null)
|
||||
return true;
|
||||
if (fld.MyParent.MyParent != null)
|
||||
return true;
|
||||
if (fld.Title.ToUpper() == OnlyThisFolder)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
private void MigrateChildren(vlnObject vb, vlnServer vs, Connection dbConn, Object parent, TreeNode tn)
|
||||
{
|
||||
if (vb.Type != "version")
|
||||
{
|
||||
vb.LoadChildren(vs.GetChildren(vb.ToString()));
|
||||
List<vlnObject> lv = vb.Children;
|
||||
foreach (vlnObject vbc in lv)
|
||||
{
|
||||
if (vbc.Path.ToUpper().StartsWith(OnlyThisFolder) || OnlyThisFolder.StartsWith(vbc.Path.ToUpper()))
|
||||
{
|
||||
TreeNode tnc = tn.Nodes.Add(vbc.Title);
|
||||
object idc = cslaObject(vbc, dbConn, parent, tnc);
|
||||
frmMain.Status = "Loading " + vbc.Title;
|
||||
MigrateChildren(vbc, vs, dbConn, idc, tnc);
|
||||
}
|
||||
}
|
||||
}
|
||||
frmMain.Status = " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public bool LoadChildren(FolderInfo fld, TreeNode tn)
|
||||
{
|
||||
tn.Nodes.Clear();
|
||||
bool bLoaded = true;
|
||||
foreach (DocVersionInfo fdv in fld.FolderDocVersions)
|
||||
{
|
||||
TreeNode tnc = tn.Nodes.Add(fdv.Title);
|
||||
tnc.Tag = fdv;
|
||||
tnc.Checked = fdv.ItemID != 0;
|
||||
bLoaded &= tnc.Checked;
|
||||
}
|
||||
return bLoaded;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Volian.MSWord;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Config;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
#region ClassProperties
|
||||
private int wms = 500;
|
||||
private static int EDDATA = 0x01;
|
||||
private static int PH = 0x02;
|
||||
private static int TOC = 0x04;
|
||||
private static int AUTOIND = 0x08;
|
||||
private static int PLACEKEEPER = 0x40;
|
||||
private static int PHONELIST = 0x10;
|
||||
|
||||
private static int STP_MULT_CHGID = 1;
|
||||
private static int STP_LNK_SEQ = 2;
|
||||
private static int STP_OVR_TAB = 3;
|
||||
|
||||
private string ProcFileName;
|
||||
private string ProcNumber;
|
||||
private ROFstInfo rofstinfo;
|
||||
private RODb rodb;
|
||||
private int EditSectId;
|
||||
private Dictionary<string, int> dicLibDocRef;
|
||||
|
||||
// have a few variables for storing the database id record & the system record.
|
||||
public Connection dbConn;
|
||||
public Folder sysFolder;
|
||||
public AnnotationType CommentType; // this holds the annotationtype of comment for future use
|
||||
public AnnotationType MigrationErrorType; // this holds the annotationtype of Migration Error for future use
|
||||
public AnnotationType VerificationRequiredType; // Using this to flag table to grid conversions
|
||||
public Document MissingDocument = null; // make a document if there is a missing rtf file
|
||||
// any missing will use this.
|
||||
private Content TransDummyCont;
|
||||
// the following two dictionaries are used to handle migration of the
|
||||
// transitions... dicTrans_ItemDone gets an entry for procnumber, sequence
|
||||
// number and the new item id as a step or section is created (transitions
|
||||
// can go to steps or sections). When a transition is encountered, check this
|
||||
// dictionary to see if the step or section was migrated & use the item
|
||||
// for the step or section if it was migrated. When a transition is migrated where
|
||||
// the 'to' has not been migrated yet, check if an entry exists in dicTrans_ItemIds,
|
||||
// if so, use the item listed here. If no entry exists in dicTrans_ItemIds, create
|
||||
// an item table record and use the id as part of the 'to', and add an entry to
|
||||
// dicTrans_ItemIds to flag that the record was already created. As migrating sections
|
||||
// and steps, check this dicTrans_ItemIds to see if the item record has already
|
||||
// been create, if so use it and remove it from the dicTrans_ItemIds dictionary,
|
||||
// otherwise, create a new item record.
|
||||
private Dictionary<string, Item> dicTrans_ItemDone;
|
||||
private Dictionary<string, Item> dicTrans_ItemIds;
|
||||
private Dictionary<string, List<Item>> dicTrans_MigrationErrors;
|
||||
private Dictionary<object, string> dicOldStepSequence;
|
||||
private Dictionary<TreeNode, TreeNode> dicNeedToLoad;
|
||||
private Dictionary<string, string> dicSetfileEntries;
|
||||
|
||||
private log4net.ILog log;
|
||||
#endregion
|
||||
private frmLoader frmMain;
|
||||
public Loader(log4net.ILog lg, frmLoader fm)
|
||||
{
|
||||
dicNeedToLoad = new Dictionary<TreeNode, TreeNode>();
|
||||
log = lg;
|
||||
frmMain = fm;
|
||||
}
|
||||
public bool LoadFolders(string vepromspath)
|
||||
{
|
||||
try
|
||||
{
|
||||
//_FmtAllPath = frmMain.MySettings.FormatFolder;
|
||||
//_GenmacAllPath = frmMain.MySettings.GenMacFolder;
|
||||
vlnServer.XMLControlPath = Application.StartupPath + "\\vlncontrol.xml";
|
||||
frmMain.Status = "Make Connection";
|
||||
// make the initial database connection record, annotation types & top
|
||||
// system folder.
|
||||
dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.DBName), 1, null, DateTime.Now, "Migration");
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
|
||||
frmMain.Status = "Add AnnotationTypes";
|
||||
CommentType = AnnotationType.MakeAnnotationType("Comment", null);
|
||||
MigrationErrorType = AnnotationType.MakeAnnotationType("Migration Error", null);
|
||||
|
||||
AnnotationType at = AnnotationType.MakeAnnotationType("Reference", null);
|
||||
at = AnnotationType.MakeAnnotationType("Action Items", null);
|
||||
//at = AnnotationType.MakeAnnotationType("Verification Required", null);
|
||||
VerificationRequiredType = AnnotationType.MakeAnnotationType("Verification Required", null);
|
||||
at = AnnotationType.MakeAnnotationType("Volian Comment", null);
|
||||
|
||||
frmMain.Status = "Load veproms.ini";
|
||||
XmlDocument d = cfg.LoadSystemIni(vepromspath);
|
||||
|
||||
frmMain.Status = "Load All Formats";
|
||||
//LoadAllFormats();
|
||||
//Format.UpdateFormats(_FmtAllPath, _GenmacAllPath);
|
||||
|
||||
Format.UpdateFormats(frmMain.MySettings.FormatFolder, frmMain.MySettings.GenMacFolder);
|
||||
|
||||
//Format baseFormat = Format.Get(1);
|
||||
//sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration");
|
||||
using (Format baseFormat = Format.Get(1))
|
||||
{
|
||||
sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration");
|
||||
}
|
||||
|
||||
// This is to test the vln Libraries
|
||||
List<Folder> lfldr = vlnDataPathFolders();
|
||||
|
||||
List<vlnObject> dp2 = new List<vlnObject>();
|
||||
if (frmMain.createEmptyPROMS) return true;
|
||||
foreach (Folder fldr in lfldr)
|
||||
{
|
||||
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||
tn.Tag = fldr;
|
||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||
dp2.Add(vb);
|
||||
vlnServer vs = new vlnServer();
|
||||
frmMain.Status = "Loading " + fldr.Name;
|
||||
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||
if (frmMain.ProcessFailed)
|
||||
return false;
|
||||
tn.Expand();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in LoadFolders", ex);
|
||||
// log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||
//return false;
|
||||
throw new Exception("Error in LoadFolders", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool LoadFoldersIntoExisting(string s)
|
||||
{
|
||||
try
|
||||
{
|
||||
frmMain.Status = "Getting Connection";
|
||||
// get the connection and annotations from the existing database.
|
||||
dbConn = Connection.GetByName("Default");
|
||||
//dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.DBName), 1, null, DateTime.Now, "Migration");
|
||||
|
||||
frmMain.Status = "Getting AnnotationTypes";
|
||||
CommentType = AnnotationType.GetByName("Comment"); // .MakeAnnotationType("Comment", null);
|
||||
MigrationErrorType = AnnotationType.GetByName("Migration Error");
|
||||
if(MigrationErrorType == null)
|
||||
MigrationErrorType = AnnotationType.MakeAnnotationType("Migration Error", null);
|
||||
VerificationRequiredType = AnnotationType.GetByName("Verification Required");
|
||||
|
||||
List<Folder> lfldr = vlnDataPathFolders(); // get plant level list.
|
||||
|
||||
List<vlnObject> dp2 = new List<vlnObject>();
|
||||
foreach (Folder fldr in lfldr)
|
||||
{
|
||||
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||
tn.Tag = fldr;
|
||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||
dp2.Add(vb);
|
||||
vlnServer vs = new vlnServer();
|
||||
frmMain.Status = "Loading " + fldr.Name;
|
||||
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||
if (frmMain.ProcessFailed)
|
||||
return false;
|
||||
tn.Expand();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||
//return false;
|
||||
throw new Exception("Error in LoadFolders", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void ClearData()
|
||||
{
|
||||
int ra = PurgeDataCommand.Execute();
|
||||
//Database.PurgeData();
|
||||
}
|
||||
public static string MakeDate(string src)
|
||||
{
|
||||
if (src.Trim() == "") return null;
|
||||
int[] DateOffset ={ 4, 5, 47, 6, 7, 47, 0, 1, 2, 3 }; // 47 = '/'
|
||||
StringBuilder datebuff = new StringBuilder(10);
|
||||
for (int i = 0; i < DateOffset.Length; i++)
|
||||
{
|
||||
if (DateOffset[i] < 9)
|
||||
datebuff.Append(src[DateOffset[i]]);
|
||||
else
|
||||
datebuff.Append(System.Convert.ToChar(DateOffset[i]));
|
||||
}
|
||||
return datebuff.ToString();
|
||||
}
|
||||
public DateTime GetDTS(string date, string time)
|
||||
{
|
||||
// Set the date/time stamp. If there is no 'date', set the date
|
||||
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
||||
// set the time to 0:0:0 (midnight).
|
||||
|
||||
DateTime dts = DateTime.Now;
|
||||
string month = "01";
|
||||
string day = "01";
|
||||
string year = "2000";
|
||||
string hour = "";
|
||||
string minute = "";
|
||||
try
|
||||
{
|
||||
if (date != null && date != "")
|
||||
{
|
||||
int indx1 = date.IndexOf("/");
|
||||
month = date.Substring(0, indx1);
|
||||
int indx2 = date.IndexOf("/", indx1 + 1);
|
||||
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
||||
year = date.Substring(indx2 + 1, 4);
|
||||
}
|
||||
if (time == null || time == "")
|
||||
{
|
||||
hour = "0";
|
||||
minute = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
hour = time.Substring(0, 2);
|
||||
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
||||
if (indxc == time.Length - 1)
|
||||
minute = time.Substring(2, 2);
|
||||
else
|
||||
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
||||
}
|
||||
dts = new DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
||||
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Bad Date/Time {0} {1}. Set to NOW.", date, time);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
|
||||
//log.ErrorFormat(ex.StackTrace);
|
||||
return dts;
|
||||
}
|
||||
return dts;
|
||||
}
|
||||
|
||||
public bool LoadSecurity(string VeSamPath, string VePromsPath)
|
||||
{
|
||||
Security sec = new Security(VeSamPath, VePromsPath);
|
||||
return sec.Migrate();
|
||||
}
|
||||
private static void WaitMS(int n)
|
||||
{
|
||||
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
||||
while (DateTime.Now < dtw)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
private static void Wait(int n)
|
||||
{
|
||||
DateTime dtw = DateTime.Now.AddSeconds(n);
|
||||
while (DateTime.Now < dtw)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,280 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Volian.MSWord;
|
||||
using vlnObjectLibrary;
|
||||
using vlnServerLibrary;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Config;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
#region ClassProperties
|
||||
private int wms = 500;
|
||||
private static int EDDATA = 0x01;
|
||||
private static int PH = 0x02;
|
||||
private static int TOC = 0x04;
|
||||
private static int AUTOIND = 0x08;
|
||||
private static int AUTOGEN = 0x40;
|
||||
|
||||
private static int STP_MULT_CHGID = 1;
|
||||
private static int STP_LNK_SEQ = 2;
|
||||
private static int STP_OVR_TAB = 3;
|
||||
|
||||
private string ProcFileName;
|
||||
private string ProcNumber;
|
||||
private ROFstInfo rofstinfo;
|
||||
private RODb rodb;
|
||||
private int EditSectId;
|
||||
private Dictionary<string, int> dicLibDocRef;
|
||||
|
||||
// have a few variables for storing the database id record & the system record.
|
||||
public Connection dbConn;
|
||||
public Folder sysFolder;
|
||||
public AnnotationType CommentType; // this holds the annotationtype of comment for future use
|
||||
public AnnotationType MigrationErrorType; // this holds the annotationtype of Migration Error for future use
|
||||
public AnnotationType VerificationRequiredType; // Using this to flag table to grid conversions
|
||||
public Document MissingDocument = null; // make a document if there is a missing rtf file
|
||||
// any missing will use this.
|
||||
private Content TransDummyCont;
|
||||
// the following two dictionaries are used to handle migration of the
|
||||
// transitions... dicTrans_ItemDone gets an entry for procnumber, sequence
|
||||
// number and the new item id as a step or section is created (transitions
|
||||
// can go to steps or sections). When a transition is encountered, check this
|
||||
// dictionary to see if the step or section was migrated & use the item
|
||||
// for the step or section if it was migrated. When a transition is migrated where
|
||||
// the 'to' has not been migrated yet, check if an entry exists in dicTrans_ItemIds,
|
||||
// if so, use the item listed here. If no entry exists in dicTrans_ItemIds, create
|
||||
// an item table record and use the id as part of the 'to', and add an entry to
|
||||
// dicTrans_ItemIds to flag that the record was already created. As migrating sections
|
||||
// and steps, check this dicTrans_ItemIds to see if the item record has already
|
||||
// been create, if so use it and remove it from the dicTrans_ItemIds dictionary,
|
||||
// otherwise, create a new item record.
|
||||
private Dictionary<string, Item> dicTrans_ItemDone;
|
||||
private Dictionary<string, Item> dicTrans_ItemIds;
|
||||
private Dictionary<string, List<Item>> dicTrans_MigrationErrors;
|
||||
private Dictionary<object, string> dicOldStepSequence;
|
||||
private Dictionary<TreeNode, TreeNode> dicNeedToLoad;
|
||||
private Dictionary<string, string> dicSetfileEntries;
|
||||
|
||||
private log4net.ILog log;
|
||||
#endregion
|
||||
private frmLoader frmMain;
|
||||
public Loader(log4net.ILog lg, frmLoader fm)
|
||||
{
|
||||
dicNeedToLoad = new Dictionary<TreeNode, TreeNode>();
|
||||
log = lg;
|
||||
frmMain = fm;
|
||||
}
|
||||
public bool LoadFolders(string vepromspath)
|
||||
{
|
||||
try
|
||||
{
|
||||
//_FmtAllPath = frmMain.MySettings.FormatFolder;
|
||||
//_GenmacAllPath = frmMain.MySettings.GenMacFolder;
|
||||
frmMain.Status = "Make Connection";
|
||||
// make the initial database connection record, annotation types & top
|
||||
// system folder.
|
||||
dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.MySettings.DBName), 1, null, DateTime.Now, "Migration");
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
|
||||
frmMain.Status = "Add AnnotationTypes";
|
||||
CommentType = AnnotationType.MakeAnnotationType("Comment", null);
|
||||
MigrationErrorType = AnnotationType.MakeAnnotationType("Migration Error", null);
|
||||
|
||||
AnnotationType at = AnnotationType.MakeAnnotationType("Reference", null);
|
||||
at = AnnotationType.MakeAnnotationType("Action Items", null);
|
||||
//at = AnnotationType.MakeAnnotationType("Verification Required", null);
|
||||
VerificationRequiredType = AnnotationType.MakeAnnotationType("Verification Required", null);
|
||||
at = AnnotationType.MakeAnnotationType("Volian Comment", null);
|
||||
|
||||
frmMain.Status = "Load veproms.ini";
|
||||
XmlDocument d = cfg.LoadSystemIni(vepromspath);
|
||||
|
||||
frmMain.Status = "Load All Formats";
|
||||
//LoadAllFormats();
|
||||
//Format.UpdateFormats(_FmtAllPath, _GenmacAllPath);
|
||||
|
||||
Format.UpdateFormats(frmMain.MySettings.FormatFolder, frmMain.MySettings.GenMacFolder);
|
||||
|
||||
//Format baseFormat = Format.Get(1);
|
||||
//sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration");
|
||||
using (Format baseFormat = Format.Get(1))
|
||||
{
|
||||
sysFolder = Folder.MakeFolder(null, dbConn, "VEPROMS", "VEPROMS", "VEPROMS", baseFormat, d.InnerXml, DateTime.Now, "Migration");
|
||||
}
|
||||
|
||||
// This is to test the vln Libraries
|
||||
List<Folder> lfldr = vlnDataPathFolders();
|
||||
|
||||
List<vlnObject> dp2 = new List<vlnObject>();
|
||||
if (frmMain.createEmptyPROMS) return true;
|
||||
foreach (Folder fldr in lfldr)
|
||||
{
|
||||
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||
tn.Tag = fldr;
|
||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||
dp2.Add(vb);
|
||||
vlnServer vs = new vlnServer();
|
||||
frmMain.Status = "Loading " + fldr.Name;
|
||||
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||
if (frmMain.ProcessFailed)
|
||||
return false;
|
||||
tn.Expand();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Error in LoadFolders", ex);
|
||||
// log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||
//return false;
|
||||
throw new Exception("Error in LoadFolders", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool LoadFoldersIntoExisting(string s)
|
||||
{
|
||||
try
|
||||
{
|
||||
frmMain.Status = "Getting Connection";
|
||||
// get the connection and annotations from the existing database.
|
||||
dbConn = Connection.GetByName("Default");
|
||||
//dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.MySettings.DBName), 1, null, DateTime.Now, "Migration");
|
||||
|
||||
frmMain.Status = "Getting AnnotationTypes";
|
||||
CommentType = AnnotationType.GetByName("Comment"); // .MakeAnnotationType("Comment", null);
|
||||
MigrationErrorType = AnnotationType.GetByName("Migration Error");
|
||||
if(MigrationErrorType == null)
|
||||
MigrationErrorType = AnnotationType.MakeAnnotationType("Migration Error", null);
|
||||
VerificationRequiredType = AnnotationType.GetByName("Verification Required");
|
||||
|
||||
List<Folder> lfldr = vlnDataPathFolders(); // get plant level list.
|
||||
|
||||
List<vlnObject> dp2 = new List<vlnObject>();
|
||||
foreach (Folder fldr in lfldr)
|
||||
{
|
||||
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||
tn.Tag = fldr;
|
||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||
dp2.Add(vb);
|
||||
vlnServer vs = new vlnServer();
|
||||
frmMain.Status = "Loading " + fldr.Name;
|
||||
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||
if (frmMain.ProcessFailed)
|
||||
return false;
|
||||
tn.Expand();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||
//return false;
|
||||
throw new Exception("Error in LoadFolders", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void ClearData()
|
||||
{
|
||||
int ra = PurgeDataCommand.Execute();
|
||||
//Database.PurgeData();
|
||||
}
|
||||
public static string MakeDate(string src)
|
||||
{
|
||||
if (src.Trim() == "") return null;
|
||||
int[] DateOffset ={ 4, 5, 47, 6, 7, 47, 0, 1, 2, 3 }; // 47 = '/'
|
||||
StringBuilder datebuff = new StringBuilder(10);
|
||||
for (int i = 0; i < DateOffset.Length; i++)
|
||||
{
|
||||
if (DateOffset[i] < 9)
|
||||
datebuff.Append(src[DateOffset[i]]);
|
||||
else
|
||||
datebuff.Append(System.Convert.ToChar(DateOffset[i]));
|
||||
}
|
||||
return datebuff.ToString();
|
||||
}
|
||||
public DateTime GetDTS(string date, string time)
|
||||
{
|
||||
// Set the date/time stamp. If there is no 'date', set the date
|
||||
// to 1/1/2000 (this can be changed!). If there is not 'time',
|
||||
// set the time to 0:0:0 (midnight).
|
||||
|
||||
DateTime dts = DateTime.Now;
|
||||
string month = "01";
|
||||
string day = "01";
|
||||
string year = "2000";
|
||||
string hour = "";
|
||||
string minute = "";
|
||||
try
|
||||
{
|
||||
if (date != null && date != "")
|
||||
{
|
||||
int indx1 = date.IndexOf("/");
|
||||
month = date.Substring(0, indx1);
|
||||
int indx2 = date.IndexOf("/", indx1 + 1);
|
||||
day = date.Substring(indx1 + 1, indx2 - indx1 - 1);
|
||||
year = date.Substring(indx2 + 1, 4);
|
||||
}
|
||||
if (time == null || time == "")
|
||||
{
|
||||
hour = "0";
|
||||
minute = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
hour = time.Substring(0, 2);
|
||||
int indxc = time.IndexOfAny(":A-".ToCharArray());
|
||||
if (indxc == time.Length - 1)
|
||||
minute = time.Substring(2, 2);
|
||||
else
|
||||
minute = time.Substring(indxc + 1, time.Length - indxc - 1);
|
||||
}
|
||||
dts = new DateTime(System.Convert.ToInt32(year), System.Convert.ToInt32(month), System.Convert.ToInt32(day),
|
||||
System.Convert.ToInt32(hour), System.Convert.ToInt32(minute), 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Bad Date/Time {0} {1}. Set to NOW.", date, time);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
frmMain.AddError(ex, "Bad Date/Time {0} {1}", date, time);
|
||||
//log.ErrorFormat(ex.StackTrace);
|
||||
return dts;
|
||||
}
|
||||
return dts;
|
||||
}
|
||||
|
||||
public bool LoadSecurity(string VeSamPath, string VePromsPath)
|
||||
{
|
||||
Security sec = new Security(VeSamPath, VePromsPath);
|
||||
return sec.Migrate();
|
||||
}
|
||||
private static void WaitMS(int n)
|
||||
{
|
||||
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
||||
while (DateTime.Now < dtw)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
private static void Wait(int n)
|
||||
{
|
||||
DateTime dtw = DateTime.Now.AddSeconds(n);
|
||||
while (DateTime.Now < dtw)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,327 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
//using System.Collections.Specialized;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Xml;
|
||||
//using System.IO;
|
||||
//using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
class OutsideTransition
|
||||
{
|
||||
private OleDbConnection _DbConnect;
|
||||
|
||||
public OleDbConnection DbConnect
|
||||
{
|
||||
get { return _DbConnect; }
|
||||
set { _DbConnect = value; }
|
||||
}
|
||||
|
||||
private Dictionary <string,ItemInfo> _TranLookup;
|
||||
|
||||
public OutsideTransition(OleDbConnection cn)
|
||||
{
|
||||
_DbConnect = cn;
|
||||
_TranLookup = new Dictionary<string, ItemInfo>();
|
||||
}
|
||||
|
||||
private List<string> _MigrationErrors;
|
||||
public ItemInfo GetItem(string key, List<string> migrationErrors)
|
||||
{
|
||||
_MigrationErrors = migrationErrors;
|
||||
if (!_TranLookup.ContainsKey(key))
|
||||
_TranLookup.Add(key, Find(key));
|
||||
return _TranLookup[key];
|
||||
}
|
||||
|
||||
private ItemInfo Find(string key)
|
||||
{
|
||||
string setid = key.Substring(0, 8);
|
||||
string procid = key.Substring(8, 8);
|
||||
string path = GetPath(setid);// Get set path from XTSETID
|
||||
string proc = GetProc(setid, procid);// Get procedure number from XTPROCID
|
||||
return Find(path,proc);// Return ItemInfo based upon path and procedure number
|
||||
}
|
||||
|
||||
private ItemInfo Find(string path, string proc)
|
||||
{
|
||||
return OTLookup.Find(path, proc,_MigrationErrors);
|
||||
}
|
||||
|
||||
private string GetProc(string setid, string procid)
|
||||
{
|
||||
string retval = null;
|
||||
string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'";
|
||||
using (OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect))
|
||||
{
|
||||
try
|
||||
{
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
DataTable dt = ds.Tables[0];
|
||||
dt.CaseSensitive = true;
|
||||
DataRow dr = dt.Rows[0]; // there should be only one entry!
|
||||
retval = dr["Procnum"].ToString(); // this should be the procedure number!
|
||||
ds.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "<Procedure Number>";//ex.GetType().Name + " " + ex.Message;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
private string GetPath(string setid)
|
||||
{
|
||||
try
|
||||
{
|
||||
string xtsetcmd = "SELECT * FROM [xtsetid] WHERE [SETID]='" + setid + "'";
|
||||
OleDbDataAdapter da = new OleDbDataAdapter(xtsetcmd, _DbConnect);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
DataTable dt = ds.Tables[0];
|
||||
dt.CaseSensitive = true;
|
||||
DataRow dr = dt.Rows[0]; // there should be only one entry!
|
||||
// if there are more than one entry use the first legitimate entry
|
||||
// for NSP we found multiple "FIRST RECORD"s in numerious XTSETID.DBF files
|
||||
if (dt.Rows.Count > 1)
|
||||
{
|
||||
int irow = 0;
|
||||
while (irow < dt.Rows.Count-1 && dt.Rows[irow]["PLANTTITLE"].ToString() == "FIRST RECORD") irow++;
|
||||
dr = dt.Rows[irow];
|
||||
}
|
||||
string retval = dr["Path"].ToString();
|
||||
da.Dispose();
|
||||
ds.Dispose();
|
||||
return retval; // dr["Path"].ToString(); // this should be the path to the proc set!
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "<Procedure Set Location>";//ex.GetType().Name + " " + ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTitle(string setid, string procid)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'";
|
||||
OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
DataTable dt = ds.Tables[0];
|
||||
dt.CaseSensitive = true;
|
||||
DataRow dr = dt.Rows[0]; // there should be only one entry!
|
||||
string retval = dr["Proctitle"].ToString();
|
||||
da.Dispose();
|
||||
ds.Dispose();
|
||||
return retval; // dr["Proctitle"].ToString(); // this should be the procedure number!
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "<Procedure Title>";//ex.GetType().Name + " " + ex.Message;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetDescription(string key)
|
||||
{
|
||||
string setid = key.Substring(0, 8);
|
||||
string procid = key.Substring(8, 8);
|
||||
string path = GetPath(setid);// Get set path from XTSETID
|
||||
string proc = GetProc(setid, procid);// Get procedure number from XTPROCID
|
||||
string title = GetTitle(setid, procid);// Get procedure title from XTPROCID
|
||||
return string.Format("{0}, {1} in folder {2}",proc,title,path);
|
||||
}
|
||||
public string GetTransitionText(string key)
|
||||
{
|
||||
string setid = key.Substring(0, 8);
|
||||
string procid = key.Substring(8, 8);
|
||||
string proc = GetProc(setid, procid);// Get procedure number from XTPROCID
|
||||
string title = GetTitle(setid, procid);// Get procedure title from XTPROCID
|
||||
proc = proc.Replace("-", @"\u8209?"); // in proc number, replace dash and spaces with
|
||||
proc = proc.Replace(" ", @"\u160?"); // nonbreak unicode dash & hardspace.
|
||||
title = title.Replace("-", @"\u8209?"); // in title, just do the hardspace.
|
||||
return string.Format("{0}, {1}", proc, title);
|
||||
}
|
||||
//private string ProcessOutSideTrans(OleDbConnection cn, string thekey, string pth)
|
||||
//{
|
||||
// string xtransstring = null;
|
||||
// DataTable dt = null;
|
||||
// DataSet ds = null;
|
||||
// OleDbDataAdapter da = null;
|
||||
|
||||
// DataTable dt2 = null;
|
||||
// DataSet ds2 = null;
|
||||
// OleDbDataAdapter da2 = null;
|
||||
|
||||
// string tosetid = thekey.Substring(0, 8);
|
||||
// string toprocid = thekey.Substring(8, 8);
|
||||
|
||||
// /// Get the path to the procedure set from the SETID
|
||||
// string xtsetcmd = "SELECT * FROM [xtsetid] WHERE [SETID]='" + tosetid + "'";
|
||||
// string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + tosetid + "' AND [PROCID]='" + toprocid + "'";
|
||||
|
||||
// da = new OleDbDataAdapter(xtsetcmd, cn);
|
||||
// da2 = new OleDbDataAdapter(xtproccmd, cn);
|
||||
|
||||
// // get xtsetid records.
|
||||
// ds = new DataSet();
|
||||
// try
|
||||
// {
|
||||
// da.Fill(ds);
|
||||
// dt = ds.Tables[0];
|
||||
// dt.CaseSensitive = true;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// log.Error("Error getting XTSETID");
|
||||
// log.ErrorFormat("to number = {0}", thekey);
|
||||
// log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
// //return textm;
|
||||
// }
|
||||
// DataRow dr = dt.Rows[0]; // there should be only one entry!
|
||||
// string setpth = dr["Path"].ToString(); // this should be the path to the proc set!
|
||||
|
||||
// // get xtprocid records
|
||||
// ds2 = new DataSet();
|
||||
// try
|
||||
// {
|
||||
// da2.Fill(ds2);
|
||||
// dt2 = ds2.Tables[0];
|
||||
// dt2.CaseSensitive = true;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// log.Error("Error getting XTPROCID");
|
||||
// log.ErrorFormat("to number = {0}", thekey);
|
||||
// log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
// //return textm;
|
||||
// }
|
||||
// DataRow dr2 = dt2.Rows[0]; // there should be only one entry!
|
||||
// string procnum = dr2["Procnum"].ToString(); // this should be the procedure number!
|
||||
|
||||
// xtransstring = setpth + "\\" + procnum; // ex: VEHLP\PROCS\0POP05-EO00
|
||||
|
||||
// //if (pathsAreEqual(setpth, pth))
|
||||
// //{
|
||||
// // // Outside Transiton is to this procedure set (not really outsde)
|
||||
// // // need to find the item id that references the proc number and title
|
||||
// // // - find the setpth in the doc.version
|
||||
// //}
|
||||
// //else
|
||||
// //return thekey; // is a true outside transition
|
||||
|
||||
// return xtransstring;
|
||||
//}
|
||||
}
|
||||
|
||||
internal static class OTLookup
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static Dictionary<string, ItemInfo> _Lookup = null;
|
||||
static List<string> _MigrationErrors;
|
||||
public static ItemInfo Find(string path, string procnum, List<string> migrationErrors)
|
||||
{
|
||||
_MigrationErrors = migrationErrors;
|
||||
string key = string.Format(@"{0}\{1}",path,procnum);
|
||||
if (_Lookup == null)
|
||||
_Lookup = new Dictionary<string, ItemInfo>();
|
||||
if (!_Lookup.ContainsKey(key))
|
||||
_Lookup.Add(key, FindItem(path, procnum));
|
||||
return _Lookup[key];
|
||||
}
|
||||
|
||||
private static DocVersionInfoList _DocVersions = null;
|
||||
private static ItemInfo FindItem(string path, string procnum)
|
||||
{
|
||||
if (_DocVersions == null)
|
||||
_DocVersions = DocVersionInfoList.Get();
|
||||
DocVersionInfo dvi = ExactMatch(path);
|
||||
if (dvi == null) dvi = PartialMatch(path);
|
||||
if (dvi != null) return FindItem(dvi, procnum);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ItemInfo FindItem(DocVersionInfo dvi, string procnum)
|
||||
{
|
||||
foreach (ItemInfo itm in dvi.Procedures)
|
||||
if (itm.DisplayNumber == procnum)
|
||||
return itm;
|
||||
return null;
|
||||
}
|
||||
|
||||
private static DocVersionInfo PartialMatch(string path)
|
||||
{
|
||||
string partial = GetPartial(path);
|
||||
if (partial != null)
|
||||
{
|
||||
foreach (DocVersionInfo dvi in _DocVersions)
|
||||
{
|
||||
if (dvi.MyFolder.Title.ToUpper().EndsWith(partial.ToUpper()))
|
||||
return dvi;
|
||||
}
|
||||
if (path.ToUpper().EndsWith("ABBYPROC"))
|
||||
return PartialMatch(path + ".prc");
|
||||
}
|
||||
// if we cannot find a match using two folders, simple use one
|
||||
partial = GetPartial2(path);
|
||||
if (partial != null)
|
||||
{
|
||||
DocVersionInfo match = null;
|
||||
foreach (DocVersionInfo dvi in _DocVersions)
|
||||
{
|
||||
if (dvi.MyFolder.Title.ToUpper().EndsWith(partial.ToUpper()))
|
||||
{
|
||||
if (match == null)
|
||||
match = dvi;
|
||||
else
|
||||
{
|
||||
_MyLog.WarnFormat("Duplicate external paths found for path '{0}'", path);
|
||||
_MigrationErrors.Add(string.Format("Duplicate external paths found for path '{0}'", path));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private static string GetPartial(string path)
|
||||
{
|
||||
//Console.WriteLine(string.Format("GetPartial path = {0}",path));
|
||||
if (path.Contains("\\"))
|
||||
{
|
||||
string[] parts = path.Split("\\".ToCharArray());
|
||||
return "\\" + parts[parts.Length - 2] + "\\" + parts[parts.Length - 1];
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
private static string GetPartial2(string path)
|
||||
{
|
||||
//Console.WriteLine(string.Format("GetPartial path = {0}",path));
|
||||
if (path.Contains("\\"))
|
||||
{
|
||||
string[] parts = path.Split("\\".ToCharArray());
|
||||
return "\\" + parts[parts.Length - 1];
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
private static DocVersionInfo ExactMatch(string path)
|
||||
{
|
||||
foreach (DocVersionInfo dvi in _DocVersions)
|
||||
if (dvi.MyFolder.Title.ToUpper().EndsWith(path.ToUpper()))
|
||||
return dvi;
|
||||
if (path.ToUpper().EndsWith("ABBYPROC"))
|
||||
return ExactMatch(path + ".prc");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,285 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// PrivateProfile opens a private profile string and stores it's contents in an xml document.
|
||||
/// </summary>
|
||||
public class PrivateProfile
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
|
||||
private string ppName;
|
||||
private XmlDocument ppXml;
|
||||
private List<string> attr;
|
||||
private List<string> ele;
|
||||
|
||||
private XmlNode AddNode(XmlNode xParent, string sName, string sValue )
|
||||
{
|
||||
XmlNode nd=AddNode(xParent,sName);
|
||||
nd.Value=sValue;
|
||||
return nd;
|
||||
}
|
||||
private XmlNode AddNode(XmlNode xParent, string sName)
|
||||
{
|
||||
XmlNode nd;
|
||||
// Add a node
|
||||
string tsName = sName.Replace(' ', '_').Replace("applicability", "Applicability").Replace("unit", "Unit");
|
||||
nd=xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Element,tsName,"");
|
||||
xParent.AppendChild(nd);
|
||||
return nd;
|
||||
}
|
||||
private void AddAttribute(XmlNode xParent, string sName, string sValue)
|
||||
{
|
||||
XmlNode xa = xParent.Attributes.GetNamedItem(sName);
|
||||
// bug fix. 09/15/03
|
||||
// If there was a space after an equal sign, that space character
|
||||
// was becomming part of the value string (reading the user.CFG file).
|
||||
// This was giving us a "Must have semi-colon" error message.
|
||||
// We now strip spaces before and after any Attribute that is written.
|
||||
sValue = sValue.Trim(' ');
|
||||
sName = sName.Replace(' ', '_');
|
||||
sName = sName.Replace("\\", "_slash_");
|
||||
sName = sName.Replace("/", "_fslash_");
|
||||
|
||||
if (xParent.Name == "color")
|
||||
{
|
||||
string[] parts = sValue.Split(",".ToCharArray());
|
||||
sValue = ColorConfig.FindKnownColor(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2])).ToString();
|
||||
}
|
||||
// Add an attribute
|
||||
if (sValue == "")
|
||||
{
|
||||
if (xa != null)
|
||||
{
|
||||
xParent.Attributes.RemoveNamedItem(sName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xa == null)
|
||||
{
|
||||
xa = xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Attribute, sName, "");
|
||||
xParent.Attributes.SetNamedItem(xa);
|
||||
}
|
||||
xa.Value = sValue;
|
||||
}
|
||||
|
||||
}
|
||||
private XmlNode AddSection(XmlNode xParent, string sSection)
|
||||
{
|
||||
// get the name. If it's not in the 'migrated elements' list, then
|
||||
// preface the name with a 'z'.
|
||||
string elename = sSection.Substring(1, sSection.IndexOf("]") - 1);
|
||||
while(elename.IndexOf(' ')>-1) elename = elename.Remove(elename.IndexOf(' '),1);
|
||||
if (!ele.Contains(elename.ToLower())) elename = 'z' + elename;
|
||||
elename = elename.Replace("\\", "_slash_");
|
||||
// Add a section [name]
|
||||
XmlNode nd = AddNode(xParent, elename);
|
||||
//AddAttribute(nd,"name",sSection.Substring(1,sSection.IndexOf("]")-1));
|
||||
return nd;
|
||||
}
|
||||
private XmlNode AddSection_UC(XmlNode xParent, string sSection )
|
||||
{
|
||||
// Add a section [name]
|
||||
string name_uc = sSection.Substring(1,sSection.IndexOf("]")-1).ToUpper() + "__UC";
|
||||
XmlNode nd =AddNode(xParent,name_uc);
|
||||
// AddAttribute(nd,"name",name_uc);
|
||||
return nd;
|
||||
}
|
||||
private void AddComment(XmlNode xParent, string sComment)
|
||||
{
|
||||
|
||||
if(xParent.ChildNodes.Count > 0)
|
||||
{
|
||||
XmlNode ndlast=xParent.ChildNodes.Item(xParent.ChildNodes.Count-1);
|
||||
if(ndlast.Name=="comment")
|
||||
{
|
||||
XmlNode xa = ndlast.Attributes.GetNamedItem("text");
|
||||
xa.Value=xa.Value + "\r\n" + sComment;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Add a comment text
|
||||
XmlNode nd =AddNode(xParent,"comment");
|
||||
AddAttribute(nd,"text",sComment);
|
||||
}
|
||||
private void AddLine(XmlNode xParent, string sLine)
|
||||
{
|
||||
// Add a comment text
|
||||
XmlNode nd =AddNode(xParent,"line");
|
||||
AddAttribute(nd,"text",sLine);
|
||||
}
|
||||
private void AddParam(XmlNode xParent, string sParam)
|
||||
{
|
||||
int i = sParam.IndexOf("=");
|
||||
// get the name. If it's not in the 'migrated attribute' list, then
|
||||
// preface the name with a 'z'.
|
||||
string attrname = sParam.Substring(0, i);
|
||||
while (attrname.IndexOf(' ') > -1) attrname = attrname.Remove(attrname.IndexOf(' '), 1);
|
||||
if (!attr.Contains(attrname.ToLower())) attrname = 'z' + attrname;
|
||||
string sValue=sParam.Substring(i+1);
|
||||
string sName = attrname.Trim(' ');
|
||||
sName = sName.Replace("id", "ID").Replace("name", "Name").Replace("number", "Number").Replace("text", "Text").Replace("other", "Other").Replace("masterdir","MasterDir");
|
||||
AddAttribute(xParent, sName, sValue);
|
||||
}
|
||||
private void AddParam_UC(XmlNode xParent, string sParam)
|
||||
{
|
||||
int i = sParam.IndexOf("=");
|
||||
// add a param name=value
|
||||
string sName=sParam.Substring(0,i);
|
||||
string sValue=sParam.Substring(i+1);
|
||||
//XmlNode nd =AddNode(xParent,"paramUC");
|
||||
sName = sName.Trim(' ');
|
||||
AddAttribute(xParent, sName, sValue);
|
||||
//AddAttribute(nd,"name",sName.ToUpper()+"__UC");
|
||||
//AddAttribute(nd,"value",sValue);
|
||||
}
|
||||
private void LoadXML()
|
||||
{
|
||||
string sLine;
|
||||
ppXml.LoadXml("<Config/>");// initialize ppXml
|
||||
XmlNode xmlTop=ppXml.DocumentElement;
|
||||
XmlNode xmlNd=ppXml.DocumentElement;
|
||||
//XmlNode xmlNd_UC=ppXml.DocumentElement;
|
||||
StreamReader myReader = new StreamReader(ppName);// Open file
|
||||
while( (sLine = myReader.ReadLine())!= null)// read line-by-line
|
||||
{
|
||||
// add structure
|
||||
try
|
||||
{
|
||||
if (sLine.Length > 0)
|
||||
{
|
||||
switch (sLine.Substring(0, 1))
|
||||
{
|
||||
case "[":
|
||||
xmlNd = AddSection(xmlTop, sLine);
|
||||
//xmlNd_UC=AddSection_UC(xmlTop, sLine);
|
||||
break;
|
||||
case ";":
|
||||
//AddComment(xmlNd, sLine);
|
||||
break;
|
||||
default:
|
||||
if (sLine.IndexOf("=") >= 0)
|
||||
{
|
||||
AddParam(xmlNd, sLine);
|
||||
//AddParam_UC(xmlNd_UC, sLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
//AddLine(xmlNd, sLine);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("error parsing .INI file: {0} - Directory: {1}", ex.Message,ppName);
|
||||
}
|
||||
}
|
||||
myReader.Close();
|
||||
}
|
||||
public PrivateProfile(string sFileName, List<string> listIni_EleName, List<string> listIni_AttrName)
|
||||
{
|
||||
ppName=sFileName;
|
||||
ppXml= new XmlDocument();
|
||||
attr = listIni_AttrName;
|
||||
ele = listIni_EleName;
|
||||
LoadXML();
|
||||
}
|
||||
~PrivateProfile()
|
||||
{
|
||||
// Clean-up
|
||||
//
|
||||
}
|
||||
public string PrettyNode(XmlNode nd,int level)
|
||||
{
|
||||
string retval="";
|
||||
string prefix=new string(' ',level*2);
|
||||
if(nd.ChildNodes.Count > 0)
|
||||
{
|
||||
retval = prefix + "<" + nd.Name;
|
||||
for(int i=0;i<nd.Attributes.Count;i++)
|
||||
{
|
||||
retval=retval + " " + nd.Attributes.Item(i).Name + "='" + nd.Attributes.Item(i).Value + "'";
|
||||
}
|
||||
retval=retval+">";
|
||||
for(int i=0;i<nd.ChildNodes.Count;i++)
|
||||
{
|
||||
retval=retval+"\r\n"+PrettyNode(nd.ChildNodes.Item(i),level+1);
|
||||
}
|
||||
retval=retval+"\r\n" + prefix + "</" + nd.Name + ">";
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = prefix + "<" + nd.Name;
|
||||
for(int i=0;i<nd.Attributes.Count;i++)
|
||||
{
|
||||
retval=retval + " " + nd.Attributes.Item(i).Name + "='" + nd.Attributes.Item(i).Value + "'";
|
||||
}
|
||||
retval=retval+"/>";
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
public string PrettyXML()
|
||||
{
|
||||
return PrettyNode(ppXml.DocumentElement,0);
|
||||
}
|
||||
public XmlDocument XML()
|
||||
{
|
||||
// return XML Document
|
||||
return ppXml;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
// return string
|
||||
return "";
|
||||
}
|
||||
public void Save()
|
||||
{
|
||||
SaveAs(ppName);
|
||||
}
|
||||
public void SaveAs(string sName)
|
||||
{
|
||||
}
|
||||
public string Attr(string sPath)
|
||||
{
|
||||
string retval="";
|
||||
XmlNode xn = ppXml.SelectSingleNode(sPath);
|
||||
if(xn != null)
|
||||
{
|
||||
string quots = xn.Value;
|
||||
if (quots.Substring(0,1)=="\"" && quots.Substring(quots.Length-1,1)=="\"")
|
||||
retval = quots.Substring(1,quots.Length-2);
|
||||
else
|
||||
retval=xn.Value;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
public string Attr(string sSection, string sParameter)
|
||||
{
|
||||
string findstr = "/ini/sectionUC[@name='" + sSection.ToUpper() + "__UC']/paramUC[@name='" + sParameter.ToUpper() + "__UC']/@value";
|
||||
return Attr(findstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,284 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// PrivateProfile opens a private profile string and stores it's contents in an xml document.
|
||||
/// </summary>
|
||||
public class PrivateProfile
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
|
||||
private string ppName;
|
||||
private XmlDocument ppXml;
|
||||
private List<string> attr;
|
||||
private List<string> ele;
|
||||
|
||||
private XmlNode AddNode(XmlNode xParent, string sName, string sValue )
|
||||
{
|
||||
XmlNode nd=AddNode(xParent,sName);
|
||||
nd.Value=sValue;
|
||||
return nd;
|
||||
}
|
||||
private XmlNode AddNode(XmlNode xParent, string sName)
|
||||
{
|
||||
XmlNode nd;
|
||||
// Add a node
|
||||
string tsName = sName.Replace(' ', '_').Replace("applicability", "Applicability").Replace("unit", "Unit");
|
||||
nd=xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Element,tsName,"");
|
||||
xParent.AppendChild(nd);
|
||||
return nd;
|
||||
}
|
||||
private void AddAttribute(XmlNode xParent, string sName, string sValue)
|
||||
{
|
||||
XmlNode xa = xParent.Attributes.GetNamedItem(sName);
|
||||
// bug fix. 09/15/03
|
||||
// If there was a space after an equal sign, that space character
|
||||
// was becomming part of the value string (reading the user.CFG file).
|
||||
// This was giving us a "Must have semi-colon" error message.
|
||||
// We now strip spaces before and after any Attribute that is written.
|
||||
sValue = sValue.Trim(' ');
|
||||
sName = sName.Replace(' ', '_');
|
||||
sName = sName.Replace("\\", "_slash_");
|
||||
sName = sName.Replace("/", "_fslash_");
|
||||
if (xParent.Name == "color")
|
||||
{
|
||||
string[] parts = sValue.Split(",".ToCharArray());
|
||||
sValue = ColorConfig.FindKnownColor(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2])).ToString();
|
||||
}
|
||||
// Add an attribute
|
||||
if (sValue == "")
|
||||
{
|
||||
if (xa != null)
|
||||
{
|
||||
xParent.Attributes.RemoveNamedItem(sName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xa == null)
|
||||
{
|
||||
xa = xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Attribute, sName, "");
|
||||
xParent.Attributes.SetNamedItem(xa);
|
||||
}
|
||||
xa.Value = sValue;
|
||||
}
|
||||
|
||||
}
|
||||
private XmlNode AddSection(XmlNode xParent, string sSection)
|
||||
{
|
||||
// get the name. If it's not in the 'migrated elements' list, then
|
||||
// preface the name with a 'z'.
|
||||
string elename = sSection.Substring(1, sSection.IndexOf("]") - 1);
|
||||
while(elename.IndexOf(' ')>-1) elename = elename.Remove(elename.IndexOf(' '),1);
|
||||
if (!ele.Contains(elename.ToLower())) elename = 'z' + elename;
|
||||
elename = elename.Replace("\\", "_slash_");
|
||||
// Add a section [name]
|
||||
XmlNode nd = AddNode(xParent, elename);
|
||||
//AddAttribute(nd,"name",sSection.Substring(1,sSection.IndexOf("]")-1));
|
||||
return nd;
|
||||
}
|
||||
private XmlNode AddSection_UC(XmlNode xParent, string sSection )
|
||||
{
|
||||
// Add a section [name]
|
||||
string name_uc = sSection.Substring(1,sSection.IndexOf("]")-1).ToUpper() + "__UC";
|
||||
XmlNode nd =AddNode(xParent,name_uc);
|
||||
// AddAttribute(nd,"name",name_uc);
|
||||
return nd;
|
||||
}
|
||||
private void AddComment(XmlNode xParent, string sComment)
|
||||
{
|
||||
|
||||
if(xParent.ChildNodes.Count > 0)
|
||||
{
|
||||
XmlNode ndlast=xParent.ChildNodes.Item(xParent.ChildNodes.Count-1);
|
||||
if(ndlast.Name=="comment")
|
||||
{
|
||||
XmlNode xa = ndlast.Attributes.GetNamedItem("text");
|
||||
xa.Value=xa.Value + "\r\n" + sComment;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Add a comment text
|
||||
XmlNode nd =AddNode(xParent,"comment");
|
||||
AddAttribute(nd,"text",sComment);
|
||||
}
|
||||
private void AddLine(XmlNode xParent, string sLine)
|
||||
{
|
||||
// Add a comment text
|
||||
XmlNode nd =AddNode(xParent,"line");
|
||||
AddAttribute(nd,"text",sLine);
|
||||
}
|
||||
private void AddParam(XmlNode xParent, string sParam)
|
||||
{
|
||||
int i = sParam.IndexOf("=");
|
||||
// get the name. If it's not in the 'migrated attribute' list, then
|
||||
// preface the name with a 'z'.
|
||||
string attrname = sParam.Substring(0, i);
|
||||
while (attrname.IndexOf(' ') > -1) attrname = attrname.Remove(attrname.IndexOf(' '), 1);
|
||||
if (!attr.Contains(attrname.ToLower())) attrname = 'z' + attrname;
|
||||
string sValue=sParam.Substring(i+1);
|
||||
string sName = attrname.Trim(' ');
|
||||
sName = sName.Replace("id", "ID").Replace("name", "Name").Replace("number", "Number").Replace("text", "Text").Replace("other", "Other").Replace("masterdir","MasterDir");
|
||||
AddAttribute(xParent, sName, sValue);
|
||||
}
|
||||
private void AddParam_UC(XmlNode xParent, string sParam)
|
||||
{
|
||||
int i = sParam.IndexOf("=");
|
||||
// add a param name=value
|
||||
string sName=sParam.Substring(0,i);
|
||||
string sValue=sParam.Substring(i+1);
|
||||
//XmlNode nd =AddNode(xParent,"paramUC");
|
||||
sName = sName.Trim(' ');
|
||||
AddAttribute(xParent, sName, sValue);
|
||||
//AddAttribute(nd,"name",sName.ToUpper()+"__UC");
|
||||
//AddAttribute(nd,"value",sValue);
|
||||
}
|
||||
private void LoadXML()
|
||||
{
|
||||
string sLine;
|
||||
ppXml.LoadXml("<Config/>");// initialize ppXml
|
||||
XmlNode xmlTop=ppXml.DocumentElement;
|
||||
XmlNode xmlNd=ppXml.DocumentElement;
|
||||
//XmlNode xmlNd_UC=ppXml.DocumentElement;
|
||||
StreamReader myReader = new StreamReader(ppName);// Open file
|
||||
while( (sLine = myReader.ReadLine())!= null)// read line-by-line
|
||||
{
|
||||
// add structure
|
||||
try
|
||||
{
|
||||
if (sLine.Length > 0)
|
||||
{
|
||||
switch (sLine.Substring(0, 1))
|
||||
{
|
||||
case "[":
|
||||
xmlNd = AddSection(xmlTop, sLine);
|
||||
//xmlNd_UC=AddSection_UC(xmlTop, sLine);
|
||||
break;
|
||||
case ";":
|
||||
//AddComment(xmlNd, sLine);
|
||||
break;
|
||||
default:
|
||||
if (sLine.IndexOf("=") >= 0)
|
||||
{
|
||||
AddParam(xmlNd, sLine);
|
||||
//AddParam_UC(xmlNd_UC, sLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
//AddLine(xmlNd, sLine);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("error parsing .INI file:", ex);
|
||||
}
|
||||
}
|
||||
myReader.Close();
|
||||
}
|
||||
public PrivateProfile(string sFileName, List<string> listIni_EleName, List<string> listIni_AttrName)
|
||||
{
|
||||
ppName=sFileName;
|
||||
ppXml= new XmlDocument();
|
||||
attr = listIni_AttrName;
|
||||
ele = listIni_EleName;
|
||||
LoadXML();
|
||||
}
|
||||
~PrivateProfile()
|
||||
{
|
||||
// Clean-up
|
||||
//
|
||||
}
|
||||
public string PrettyNode(XmlNode nd,int level)
|
||||
{
|
||||
string retval="";
|
||||
string prefix=new string(' ',level*2);
|
||||
if(nd.ChildNodes.Count > 0)
|
||||
{
|
||||
retval = prefix + "<" + nd.Name;
|
||||
for(int i=0;i<nd.Attributes.Count;i++)
|
||||
{
|
||||
retval=retval + " " + nd.Attributes.Item(i).Name + "='" + nd.Attributes.Item(i).Value + "'";
|
||||
}
|
||||
retval=retval+">";
|
||||
for(int i=0;i<nd.ChildNodes.Count;i++)
|
||||
{
|
||||
retval=retval+"\r\n"+PrettyNode(nd.ChildNodes.Item(i),level+1);
|
||||
}
|
||||
retval=retval+"\r\n" + prefix + "</" + nd.Name + ">";
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = prefix + "<" + nd.Name;
|
||||
for(int i=0;i<nd.Attributes.Count;i++)
|
||||
{
|
||||
retval=retval + " " + nd.Attributes.Item(i).Name + "='" + nd.Attributes.Item(i).Value + "'";
|
||||
}
|
||||
retval=retval+"/>";
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
public string PrettyXML()
|
||||
{
|
||||
return PrettyNode(ppXml.DocumentElement,0);
|
||||
}
|
||||
public XmlDocument XML()
|
||||
{
|
||||
// return XML Document
|
||||
return ppXml;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
// return string
|
||||
return "";
|
||||
}
|
||||
public void Save()
|
||||
{
|
||||
SaveAs(ppName);
|
||||
}
|
||||
public void SaveAs(string sName)
|
||||
{
|
||||
}
|
||||
public string Attr(string sPath)
|
||||
{
|
||||
string retval="";
|
||||
XmlNode xn = ppXml.SelectSingleNode(sPath);
|
||||
if(xn != null)
|
||||
{
|
||||
string quots = xn.Value;
|
||||
if (quots.Substring(0,1)=="\"" && quots.Substring(quots.Length-1,1)=="\"")
|
||||
retval = quots.Substring(1,quots.Length-2);
|
||||
else
|
||||
retval=xn.Value;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
public string Attr(string sSection, string sParameter)
|
||||
{
|
||||
string findstr = "/ini/sectionUC[@name='" + sSection.ToUpper() + "__UC']/paramUC[@name='" + sParameter.ToUpper() + "__UC']/@value";
|
||||
return Attr(findstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,605 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
#region Log4Net
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
//public static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
public static int HandleCount
|
||||
{
|
||||
get { return System.Diagnostics.Process.GetCurrentProcess().HandleCount; }
|
||||
}
|
||||
private bool RunWithDB2K = false;
|
||||
private Item MigrateProcedure(OleDbConnection cn, DataRow dr, Item FromItem, string pth, DocVersion docver, bool convertProcedures, FormatInfo activeFormat)
|
||||
{
|
||||
dicOldStepSequence = new Dictionary<object, string>();
|
||||
Stack<int> SubSectLevels = new Stack<int>(); // levels of subsections
|
||||
ProcFileName = dr["Entry"].ToString();
|
||||
ProcNumber = dr["Number"].ToString();
|
||||
frmMain.Status = "Processing Procedure " + ProcNumber + " - " + ProcFileName;
|
||||
GC.Collect();
|
||||
frmMain.AddInfo("Processing Procedure {0} {1}", ProcNumber, GC.GetTotalMemory(true));
|
||||
//frmMain.MyInfo = CSLACache.UsageNotFinalized;
|
||||
|
||||
|
||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||
string userid = dr["initials"].ToString().Trim();
|
||||
if (userid == null || userid == "") userid = "Migration";
|
||||
|
||||
ConfigInfo ci = null;
|
||||
string tstr = dr["Proccode"].ToString();
|
||||
if (tstr != null && tstr != "")
|
||||
{
|
||||
ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "ProcCode", tstr);
|
||||
}
|
||||
//load revdate
|
||||
string tstr2 = dts.ToString("MM/dd/yyyy");
|
||||
if (tstr2 != null && tstr2 != "")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "RevDate", tstr2);
|
||||
}
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("History", "ProcName", ProcFileName.ToUpper());
|
||||
|
||||
// Load in format data, i.e. default number of columns:
|
||||
string tstr1 = dr["Format"].ToString();
|
||||
if (tstr1 != null && tstr1 != "")
|
||||
{
|
||||
switch (tstr1)
|
||||
{
|
||||
case "1":
|
||||
case "2":
|
||||
case "3":
|
||||
case "4":
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Format", "Columns", tstr1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// try to load in fix file data:
|
||||
FileInfo fi = new FileInfo(pth + @"\" + ProcFileName + @".fix");
|
||||
if (fi.Exists)
|
||||
{
|
||||
FixItems fixItems = new FixItems(fi);
|
||||
if (fixItems.Count > 0)
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
if (fixItems[0].Rev != null && fixItems[0].Rev != "") ci.AddItem("Procedure", "Rev", fixItems[0].Rev);
|
||||
if (fixItems[0].RevDate != null && fixItems[0].RevDate != "") ci.AddItem("Procedure", "RevDate", fixItems[0].RevDate);
|
||||
if (fixItems[0].ReviewDate != null && fixItems[0].ReviewDate != "") ci.AddItem("Procedure", "ReviewDate", fixItems[0].ReviewDate);
|
||||
}
|
||||
}
|
||||
fi = new FileInfo(pth + @"\" + ProcFileName + @".apl");
|
||||
if (fi.Exists)
|
||||
{
|
||||
MyProcAPL = GetApple(fi.FullName);
|
||||
}
|
||||
// check that there is a "Series" column, i.e. the 10th column, some datasets
|
||||
// may not have it, for example vetuec\master.sl1
|
||||
if (dr.ItemArray.Length > 10)
|
||||
{
|
||||
tstr = dr["Series"].ToString();
|
||||
if (tstr != null && tstr != "")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "Series", tstr);
|
||||
}
|
||||
}
|
||||
if (docver.DocVersionConfig.Unit_Count > 1)
|
||||
{
|
||||
for (int i = 1; i <= docver.DocVersionConfig.Unit_Count; i++)
|
||||
{
|
||||
ci.AddSlaveNode(i);
|
||||
docver.DocVersionConfig.SelectedSlave = i;
|
||||
string un = ".SL" + docver.DocVersionConfig.Old_Index;
|
||||
|
||||
string mupth = pth.Replace(".prc", un);
|
||||
fi = new FileInfo(mupth + @"\" + ProcFileName + @".fix");
|
||||
if (fi.Exists)
|
||||
{
|
||||
FixItems fixItems = new FixItems(fi);
|
||||
if (fixItems.Count > 0)
|
||||
{
|
||||
if (fixItems[0].Rev != null && fixItems[0].Rev != "")
|
||||
ci.AddSlaveItem(i, "Rev", fixItems[0].Rev);
|
||||
else
|
||||
ci.AddSlaveItem(i, "Rev", "");
|
||||
if (fixItems[0].RevDate != null && fixItems[0].RevDate != "")
|
||||
ci.AddSlaveItem(i, "RevDate", fixItems[0].RevDate);
|
||||
else
|
||||
ci.AddSlaveItem(i, "RevDate", "");
|
||||
if (fixItems[0].ReviewDate != null && fixItems[0].ReviewDate != "")
|
||||
ci.AddSlaveItem(i, "ReviewDate", fixItems[0].ReviewDate);
|
||||
else
|
||||
ci.AddSlaveItem(i, "ReviewDate", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ci.AddSlaveItem(i, "Rev", "");
|
||||
ci.AddSlaveItem(i, "RevDate", "");
|
||||
ci.AddSlaveItem(i, "ReviewDate", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
DataSet ds = new DataSet();
|
||||
DataTable dt = null;
|
||||
|
||||
// check that file exists, i.e. if proc file doesn't exist but has entry in set
|
||||
// file, flag error, but continue.
|
||||
string fname = pth + "\\" + dr["entry"] + ".dbf";
|
||||
if (File.Exists(fname))
|
||||
{
|
||||
// if the dbt is bad, fix it.
|
||||
DbtOk(dr["entry"].ToString(), pth);
|
||||
// See if there is PSI and if so, add it to the xml.
|
||||
OleDbDataAdapter dapsi = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where [STEP] is null", cn);
|
||||
int handleBefore = HandleCount;
|
||||
TryToLoadDataSet(ds, fname, dapsi);
|
||||
int handleAfter = HandleCount;
|
||||
if (!RunWithDB2K && handleAfter - handleBefore > 10)
|
||||
{
|
||||
string msg = "It appears that handles are being created and not cleared.";
|
||||
if (dB2KInstalled())
|
||||
{
|
||||
msg += "\r\n\r\nThis is most likely because dB2K is installed." +
|
||||
"\r\n\r\nUninstall dB2K and run again.";
|
||||
if (MessageBox.Show(msg + "\r\n\r\nDo you want to continue?", "Run with dB2K",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
RunWithDB2K = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg += "\r\n\r\nCall Volian for support.";
|
||||
}
|
||||
if (!RunWithDB2K) throw new Exception(msg);
|
||||
}
|
||||
dt = ds.Tables[0];
|
||||
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
DataRow drpsi = dt.Rows[0];
|
||||
string psistr = drpsi["TEXTM"].ToString();
|
||||
try
|
||||
{
|
||||
if (psistr != null && psistr != "")
|
||||
{
|
||||
StringReader strrd = new StringReader(psistr);
|
||||
|
||||
string sLine;
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
while ((sLine = strrd.ReadLine()) != null)
|
||||
{
|
||||
int indx = sLine.IndexOf(' ');
|
||||
string nm = null;
|
||||
string vl = null;
|
||||
if (indx < 0)
|
||||
nm = sLine;
|
||||
else
|
||||
{
|
||||
nm = sLine.Substring(0, indx);
|
||||
string tmpPsi = sLine.Substring(indx + 1, sLine.Length - indx - 1);
|
||||
if (tmpPsi.Length > 0) tmpPsi = TextConvert.ConvertText(tmpPsi);
|
||||
vl = tmpPsi;
|
||||
}
|
||||
ci.AddItem("PSI", nm, vl == null ? null : vl);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
log.Warn("Failure during PSI", ex);
|
||||
}
|
||||
}
|
||||
dapsi.Dispose();
|
||||
}
|
||||
else // log an error
|
||||
{
|
||||
log.ErrorFormat("Missing DBF: {0}", fname);
|
||||
}
|
||||
|
||||
// Note, for now the data from the format field will be saved. Later, xpath, ??
|
||||
EditSectId = 0;
|
||||
|
||||
// See if no caret convert...
|
||||
//FormatInfo docverFormat = docver.MyDocVersionInfo.ActiveFormat;
|
||||
bool do_cvt = activeFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta;//docverFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta;
|
||||
// pass in a 0 on MakeContent for type of procedure, i.e. procedure = 0 (on type field)
|
||||
|
||||
// can we save itm.ItemID in a dictionary of outside trans? ex: otrans("vehlp\procs\0POP05-EO00",itm.ItemID)?
|
||||
Content cont = null;
|
||||
Item itm = null;
|
||||
string dicNumber = dr["Number"].ToString();
|
||||
string number = TextConvert.ConvertText(dr["Number"].ToString());
|
||||
frmMain.UpdateLabels(1, 0, 0);
|
||||
//Console.WriteLine("number {0}", number);
|
||||
//Console.WriteLine("Item Key {0} List {1}", Item.CacheCountPrimaryKey, Item.CacheCountList);
|
||||
//Console.WriteLine("ItemInfo Key {0} List {1}", ItemInfo.CacheCountPrimaryKey, ItemInfo.CacheCountList);
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
dvi.ResetProcedures(); // need this to clear out Procedures so that they are retrieved (resolves a caching problem)
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
{
|
||||
if (ii.MyContent.Number == number)
|
||||
{
|
||||
//Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!convertProcedures || (docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft && docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved))
|
||||
{
|
||||
// if this procedure already exists for this docversion, just use it.
|
||||
if (itm == null && cont == null)
|
||||
{
|
||||
cont = Content.New(number, TextConvert.ConvertText(dr["Title"].ToString(), do_cvt), 0, null, ci == null ? null : ci.ToString(), dts, userid);
|
||||
itm = Item.MakeItem(FromItem, cont, dts, userid);
|
||||
}
|
||||
}
|
||||
if (convertProcedures /* && number == "001\\u8209?007"/* && number == "0POP05-EO-EC00"*/)
|
||||
{
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where sequence like ' %' and [STEP] is not null", cn);
|
||||
try
|
||||
{
|
||||
dicTrans_ItemDone[dicNumber] = itm; // will be null if only doing procs & no sections, etc.
|
||||
LoadSection(ds, da, dr["entry"].ToString());
|
||||
da.SelectCommand.CommandText = "select * from [" + dr["entry"] + "] where step not like ' ' and sequence not like ' %'";
|
||||
da.Fill(ds, "Steps");
|
||||
dt = ds.Tables["Steps"];
|
||||
dt.CaseSensitive = true;
|
||||
ds.Tables["Steps"].CaseSensitive = true;
|
||||
dt.Columns.Add("CStep", System.Type.GetType("System.String"));
|
||||
dt.Columns.Add("CSequence", System.Type.GetType("System.String"));
|
||||
// set the cstep & csequence - couldn't do it in the add because it needed a sql function
|
||||
foreach (DataRow drw in ds.Tables["Steps"].Rows)
|
||||
{
|
||||
drw["CStep"] = TextConvert.ConvertSeq(drw["Step"].ToString());
|
||||
drw["CSequence"] = TextConvert.ConvertSeq(drw["Sequence"].ToString());
|
||||
}
|
||||
dt.Columns.Add("StepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CStep,2,1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("Level", System.Type.GetType("System.Int32"), "Len(CSequence)");
|
||||
dt.Columns.Add("SubStepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,Len(CSequence),1),'System.Char'),'System.Int32')-48");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.Error(ex.StackTrace);
|
||||
frmMain.AddError(ex, "MigrateProcedure - {0}", ProcFileName);
|
||||
}
|
||||
da.Dispose();
|
||||
// dicSecCount is dictionary to track number of subsections for the parent at a level
|
||||
// dicSecID is the parent at that level
|
||||
Dictionary<int, int> dicSecCount = new Dictionary<int, int>();
|
||||
Dictionary<int, Item> dicSecParentItem = new Dictionary<int, Item>();
|
||||
frmMain.pbSectMaximum = ds.Tables["Sections"].Rows.Count;
|
||||
frmMain.pbSectValue = 0;
|
||||
|
||||
DataTable dtsect = ds.Tables["Sections"];
|
||||
dtsect.CaseSensitive = true;
|
||||
DataView dv = new DataView(dtsect, "", "locb", DataViewRowState.CurrentRows);
|
||||
Item SectItm = null;
|
||||
int level = 0;
|
||||
bool addpart = true;
|
||||
Item parentitem = itm;
|
||||
//if (ProcNumber == "001-002")
|
||||
// Console.WriteLine("proc 001-002");
|
||||
foreach (DataRowView drw in dv)
|
||||
{
|
||||
//if (ProcNumber == "016-001") //"017-001") //"082-002AB")
|
||||
// Console.WriteLine("016-001"); //("017-001"); //"082-002AB");
|
||||
|
||||
// If there is a '~' in step[1] and the sequence number is blank, the this record
|
||||
// is a multiline section title. Skip it from processing the section. This record
|
||||
// will get read in the section code to get the section title.
|
||||
string sequence = drw["CSequence"].ToString().PadRight(10);
|
||||
string step = drw["CStep"].ToString();
|
||||
if (step[1]=='~' && sequence[1]==' ') break;
|
||||
bool hasSubSects = (sequence[5] != ' ' && sequence[5] != '0');
|
||||
SectItm = MigrateSection(parentitem, ProcNumber, cn, drw, ds.Tables["Steps"], SectItm, hasSubSects, pth, docver, activeFormat, addpart ? cont : null);
|
||||
addpart = false;
|
||||
// if no children, add first child (cont)
|
||||
//if (addpart)
|
||||
//{
|
||||
// // ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||
// cont.ContentParts.Add(2, SectItm);
|
||||
// if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
|
||||
// if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
|
||||
// cont.Save();
|
||||
// addpart = false;
|
||||
//}
|
||||
//FrType = 0;
|
||||
//Console.WriteLine("'before',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
dicSecParentItem[level] = SectItm;
|
||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||
if (level > 0)
|
||||
{
|
||||
dicSecCount[level]--; // decrements number of sections to process
|
||||
}
|
||||
if (subSecs > 0)
|
||||
{
|
||||
dicSecCount[++level] = subSecs;
|
||||
cont = SectItm.MyContent;
|
||||
parentitem = SectItm;
|
||||
addpart = true;
|
||||
SectItm = null; // no previous sibling for the first child node.
|
||||
}
|
||||
if (level > 0)
|
||||
{
|
||||
while (level > 0 && dicSecCount[level] == 0)
|
||||
{
|
||||
// shift up a level, i.e. give me the parent for the previous level
|
||||
dicSecCount.Remove(level);
|
||||
SectItm = dicSecParentItem[--level];
|
||||
if (level > 0)
|
||||
parentitem = dicSecParentItem[level - 1];
|
||||
else
|
||||
parentitem = itm;
|
||||
}
|
||||
}
|
||||
//Console.WriteLine("'after',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
}
|
||||
dv.Dispose();
|
||||
//foreach (Item secItm in dicSecParentItem.Values)
|
||||
// secItm.Dispose();
|
||||
// need section start
|
||||
if (EditSectId != 0)
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "SectionStart", string.Format("{0}", EditSectId));
|
||||
itm.MyContent.Config = (ci == null) ? null : ci.ToString();
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
ds.Dispose();
|
||||
|
||||
// if there are any floating foldouts & associated steps, set config on steps for foldout association.
|
||||
// the free the lists for the next procedure:
|
||||
if (FoldoutStpSeq != null && FoldoutStpSeq.Count>0)
|
||||
{
|
||||
string cmd = "SELECT * FROM [tran] WHERE [FROMNUMBER]='" + ProcNumber.Replace("'", "''") + "' AND [TYPE] ='R'";
|
||||
OleDbDataAdapter da = new OleDbDataAdapter(cmd, cn);
|
||||
// get transition records for this step.
|
||||
ds = new DataSet();
|
||||
try
|
||||
{
|
||||
da.Fill(ds);
|
||||
DataTable dtt = ds.Tables[0];
|
||||
dtt.CaseSensitive = true;
|
||||
Dictionary<int, string> stpFoldSeq = new Dictionary<int,string>();
|
||||
foreach (DataRow drt in dtt.Rows)
|
||||
{
|
||||
// get from/to seq, subtract off '0' to get stepnumber.
|
||||
// The 'oldto' field stores which foldout section these steps go
|
||||
// to. However, if reset, the 'oldto' may not contain a reference
|
||||
// to a foldout, i.e. may contain 'junk' data. Only add the
|
||||
// reference to the dictionary if it's a foldout.
|
||||
int fromStep = TextConvert.ConvertSeq(drt["FROMSEQUEN"].ToString())[1] - '0';
|
||||
int toStep = TextConvert.ConvertSeq(drt["TOSEQUENCE"].ToString())[1] - '0';
|
||||
string foldSeq = drt["OLDTO"].ToString().Substring(0, 2);
|
||||
if (foldSeq[1] == 'F')
|
||||
{
|
||||
for (int istp = fromStep; istp <= toStep; istp++)
|
||||
stpFoldSeq.Add(istp, foldSeq);
|
||||
}
|
||||
}
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
// now read in the HLS's and set their config to the appropriate foldout.
|
||||
// stpFoldSeq contains 16 bit step to foldout associations, i.e. an integer step
|
||||
// number (ordinal) and string sequence of foldout.
|
||||
// FloatingFoldoutHLS contains each 16bit ordinal step number (all steps, whether
|
||||
// they have a foldout or not) and the associated itemid in 32bit
|
||||
// FoldoutStpSeq contains all foldouts, i.e. the string representing the sequence
|
||||
// number if 16bit and the resulting 32bit itemid.
|
||||
foreach (KeyValuePair<int, string> kvp in stpFoldSeq)
|
||||
{
|
||||
int hlsItemId = FloatingFoldoutHLS[kvp.Key-1]; // -1 for indexes starting at 0 (not 1)
|
||||
using (Item itmF = Item.Get(hlsItemId))
|
||||
{
|
||||
// be sure that the dictionaries contain the key.
|
||||
// Some data may be 'corrupt' and not have the appropriate linkages
|
||||
// to floating foldouts.
|
||||
if (FoldoutStpSeq.ContainsKey(kvp.Value))
|
||||
{
|
||||
int fldItemId = FoldoutStpSeq[kvp.Value];
|
||||
ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config);
|
||||
ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString());
|
||||
itmF.MyContent.Config = ciFold.ToString();
|
||||
itmF.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "Error resolving Floating Foldout Data '{0}'", ProcNumber);
|
||||
log.Error("Error resolving Floating Foldout Data");
|
||||
log.ErrorFormat("from number = {0}", ProcNumber);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
}
|
||||
}
|
||||
if (FoldoutStpSeq!=null) FoldoutStpSeq.Clear();
|
||||
if (FloatingFoldoutHLS!=null) FloatingFoldoutHLS.Clear();
|
||||
//Console.WriteLine("End MigrateProcedure number {0}", number);
|
||||
//Console.WriteLine("End MigrateProcedure Item Key {0} List {1}", Item.CacheCountPrimaryKey, Item.CacheCountList);
|
||||
//Console.WriteLine("End MigrateProcedure ItemInfo Key {0} List {1}", ItemInfo.CacheCountPrimaryKey, ItemInfo.CacheCountList);
|
||||
return itm;
|
||||
}
|
||||
|
||||
private static void TryToLoadDataSet(DataSet ds, string fname, OleDbDataAdapter dapsi)
|
||||
{
|
||||
try
|
||||
{
|
||||
dapsi.Fill(ds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FileInfo fi;
|
||||
switch (ex.Message)
|
||||
{
|
||||
case "Index file not found.":// then delete inf file
|
||||
fi = new FileInfo(fname.ToLower().Replace(".dbf",".inf"));
|
||||
fi.Delete();
|
||||
TryToLoadDataSet(ds, fname, dapsi); // Try again
|
||||
break;
|
||||
case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
|
||||
fi = new FileInfo(fname.ToLower().Replace(".dbf", ".dbt"));
|
||||
FileStream fs = fi.OpenWrite();
|
||||
fs.Position = fs.Length;
|
||||
byte[] buf = new byte[128];
|
||||
for (int i = 0; i < 128; i++) buf[i] = 0;
|
||||
fs.Write(buf, 0, 128);
|
||||
fs.Close();
|
||||
TryToLoadDataSet(ds, fname, dapsi); // Try again
|
||||
break;
|
||||
default: // Unrecognized error
|
||||
Console.WriteLine(ex.Message);
|
||||
//Application.Exit();
|
||||
throw new Exception("Error in MigrateProcedure: " + fname, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool dB2KInstalled()
|
||||
{
|
||||
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"software\dBase\dB2K");
|
||||
bool retval = key != null;
|
||||
if(key != null)key.Close();
|
||||
return retval;
|
||||
}
|
||||
|
||||
// check for duplicate SET file data - jsj 2/11/10
|
||||
private bool OKtoProcessDBF(DataRow dr, string pth)
|
||||
{
|
||||
string pfn = dr["Entry"].ToString();
|
||||
string pn = dr["Number"].ToString();
|
||||
FileInfo fi = new FileInfo(pth + "\\" + pfn + ".dbf");
|
||||
if (!fi.Exists)
|
||||
{
|
||||
_MyLog.WarnFormat("Data file does not exist {0}", fi.FullName);
|
||||
frmMain.AddError("Data file does not exist {0}", fi.FullName);
|
||||
return false;
|
||||
}
|
||||
if (!dicSetfileEntries.ContainsValue(pfn) && !dicSetfileEntries.ContainsKey(pn))
|
||||
{
|
||||
dicSetfileEntries.Add(pn, pfn);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private Item MigrateProcedures(OleDbConnection cn, string pth, DocVersion docver, bool convertProcedures, FormatInfo activeFormat)
|
||||
{
|
||||
|
||||
Item FirstItm = docver.MyItem;// null;
|
||||
// Loop through Set File for each Procedure
|
||||
try
|
||||
{
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", cn);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
Item FrItm = null;
|
||||
if (FirstItm != null)
|
||||
FrItm = ItemInfo.Get(FirstItm.ItemID).LastSibling.Get();
|
||||
frmMain.pbProcMaximum = ds.Tables[0].Rows.Count;
|
||||
frmMain.UpdateLabels(0, 0, 0);
|
||||
dicSetfileEntries = new Dictionary<string, string>(); // used to check for duplicate SET file info - jsj 2/11/10
|
||||
int i = 0;
|
||||
frmMain.ShowSections = convertProcedures;
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
i++;
|
||||
if (i > frmMain.SkipProcedures && (frmMain.HowManyProcedures == 0|| i <= (frmMain.SkipProcedures + frmMain.HowManyProcedures) ))
|
||||
{
|
||||
if (OKtoProcessDBF(dr, pth)) // look for duplicate SET file info - jsj 2/11/10
|
||||
{
|
||||
List<int> cacheContentInfo = ContentInfo.CacheList;
|
||||
List<int> cacheItemInfo = ItemInfo.CacheList;
|
||||
List<int> cacheEntryInfo = EntryInfo.CacheList;
|
||||
List<int> cachePdfInfo = PdfInfo.CacheList;
|
||||
List<int> cacheDocVersionInfo = DocVersionInfo.CacheList;
|
||||
List<int> cachePartInfo = PartInfo.CacheList;
|
||||
frmMain.pbStepValue = 0;//Reset Step Count
|
||||
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver, convertProcedures, activeFormat);
|
||||
if (FirstItm == null) FirstItm = FrItm;
|
||||
//frmMain.MyInfo = string.Format("Before Restore {0}", GC.GetTotalMemory(true));
|
||||
ContentInfo.RestoreCacheList(cacheContentInfo);
|
||||
PartInfo.RestoreCacheList(cachePartInfo);
|
||||
ItemInfo.RestoreCacheList(cacheItemInfo);
|
||||
EntryInfo.RestoreCacheList(cacheEntryInfo);
|
||||
PdfInfo.RestoreCacheList(cachePdfInfo);
|
||||
DocVersionInfo.RestoreCacheList(cacheDocVersionInfo);
|
||||
//frmMain.MyInfo = string.Format("After Restore {0}", GC.GetTotalMemory(true));
|
||||
}
|
||||
}
|
||||
//GC.Collect();
|
||||
}
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_MyLog.ErrorFormat("MigrateProcedures - {0} - {1}\r\n\r\n{2}", pth,ex.Message, ex.InnerException);
|
||||
//throw new Exception("Error in MigrateProcedures: " + pth, ex);
|
||||
}
|
||||
frmMain.MyInfo = CSLACache.UsageAll;
|
||||
frmMain.AddInfo(Content.MyStack);
|
||||
frmMain.AddInfo(ContentInfo.MyStack);
|
||||
frmMain.AddInfo(DocVersionInfo.MyStack);
|
||||
return FirstItm;
|
||||
}
|
||||
private void DbtOk(string fname, string pth)
|
||||
{
|
||||
string dbtname = pth + "\\" + fname + ".dbt";
|
||||
if (File.Exists(dbtname))
|
||||
{
|
||||
// check if dbt is at least 512, if not append 508 bytes. This is to fix
|
||||
// a problem where dbts were created with only 4 bytes in the 16-bit code.
|
||||
// if only 4 bytes, ado.net gives an "External table not in expected format"
|
||||
// error
|
||||
FileInfo fi = new FileInfo(dbtname);
|
||||
if (fi.Length < 512)
|
||||
{
|
||||
FileStream fs = new FileStream(dbtname, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
|
||||
BinaryWriter bw = new BinaryWriter(fs);
|
||||
bw.Seek(0, SeekOrigin.End);
|
||||
byte[] wrBytes = new byte[512 - fi.Length];
|
||||
for (int i = 0; i < 512 - fi.Length; i++) wrBytes[i] = 0;
|
||||
wrBytes[4] = 0x02;
|
||||
bw.Write(wrBytes);
|
||||
bw.Close();
|
||||
}
|
||||
fi = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,294 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
#region Log4Net
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
//public static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
private Item MigrateProcedure(OleDbConnection cn, DataRow dr, Item FromItem, string pth, DocVersion docver, bool convertProcedures)
|
||||
{
|
||||
dicOldStepSequence = new Dictionary<object, string>();
|
||||
Stack<int> SubSectLevels = new Stack<int>(); // levels of subsections
|
||||
ProcFileName = dr["Entry"].ToString();
|
||||
ProcNumber = dr["Number"].ToString();
|
||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||
string userid = dr["initials"].ToString().Trim();
|
||||
if (userid == null || userid == "") userid = "Migration";
|
||||
|
||||
ConfigInfo ci = null;
|
||||
string tstr = dr["Proccode"].ToString();
|
||||
if (tstr != null && tstr != "")
|
||||
{
|
||||
ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "ProcCode", tstr);
|
||||
}
|
||||
|
||||
// check that there is a "Series" column, i.e. the 10th column, some datasets
|
||||
// may not have it, for example vetuec\master.sl1
|
||||
if (dr.ItemArray.Length > 10)
|
||||
{
|
||||
tstr = dr["Series"].ToString();
|
||||
if (tstr != null && tstr != "")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "Series", tstr);
|
||||
}
|
||||
}
|
||||
|
||||
DataSet ds = new DataSet();
|
||||
DataTable dt = null;
|
||||
|
||||
// check that file exists, i.e. if proc file doesn't exist but has entry in set
|
||||
// file, flag error, but continue.
|
||||
//string fname = frmMain.tbSourceText +"\\"+ dr["entry"] + ".dbf";
|
||||
string fname = pth + "\\" + dr["entry"] + ".dbf";
|
||||
if (File.Exists(fname))
|
||||
{
|
||||
// if the dbt is bad, fix it.
|
||||
DbtOk(dr["entry"].ToString(),pth);
|
||||
// See if there is PSI and if so, add it to the xml.
|
||||
OleDbDataAdapter dapsi = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where [STEP] is null", cn);
|
||||
try
|
||||
{
|
||||
dapsi.Fill(ds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
Application.Exit();
|
||||
}
|
||||
dt = ds.Tables[0];
|
||||
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
DataRow drpsi = dt.Rows[0];
|
||||
string psistr = drpsi["TEXTM"].ToString();
|
||||
if (psistr != null && psistr != "")
|
||||
{
|
||||
StringReader strrd = new StringReader(psistr);
|
||||
|
||||
string sLine;
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
while ((sLine = strrd.ReadLine()) != null)
|
||||
{
|
||||
int indx = sLine.IndexOf(' ');
|
||||
string nm = null;
|
||||
string vl = null;
|
||||
if (indx < 0)
|
||||
nm = sLine;
|
||||
else
|
||||
{
|
||||
nm = sLine.Substring(0, indx);
|
||||
vl = sLine.Substring(indx + 1, sLine.Length - indx - 1);
|
||||
}
|
||||
ci.AddItem("PSI", nm, vl == null ? null : vl);
|
||||
}
|
||||
}
|
||||
}
|
||||
dapsi.Dispose();
|
||||
}
|
||||
else // log an error
|
||||
{
|
||||
log.ErrorFormat("Missing DBF: {0}", fname);
|
||||
}
|
||||
|
||||
// Note, for now the data from the format field will be saved. Later, xpath, ??
|
||||
EditSectId = 0;
|
||||
|
||||
// See if no caret convert...
|
||||
FormatInfo docverFormat = docver.MyDocVersionInfo.ActiveFormat;
|
||||
bool do_cvt = docverFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta;
|
||||
// pass in a 0 on MakeContent for type of procedure, i.e. procedure = 0 (on type field)
|
||||
|
||||
// can we save itm.ItemID in a dictionary of outside trans? ex: otrans("vehlp\procs\0POP05-EO00",itm.ItemID)?
|
||||
Content cont = null;
|
||||
Item itm =null;
|
||||
string number = TextConvert.ConvertText(dr["Number"].ToString());
|
||||
frmMain.UpdateLabels(1, 0, 0);
|
||||
if (!convertProcedures || docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft)
|
||||
{
|
||||
cont = Content.New(number, TextConvert.ConvertText(dr["Title"].ToString(),do_cvt), 0, null, ci == null ? null : ci.ToString(), dts, userid);
|
||||
itm = Item.MakeItem(FromItem, cont, dts, userid);
|
||||
}
|
||||
else
|
||||
{
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
foreach(ItemInfo ii in dvi.Procedures){
|
||||
if (ii.MyContent.Number == number)
|
||||
{
|
||||
Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (convertProcedures /*&& number == "0POP05\\u8209?EO\\u8209?ES32"*/) //0POP05\u8209?EO\u8209?ES32
|
||||
{
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + dr["entry"] + "] where sequence like ' %'", cn);
|
||||
try
|
||||
{
|
||||
LoadSection(ds, da, dr["entry"].ToString());
|
||||
da.SelectCommand.CommandText = "select * from [" + dr["entry"] + "] where step not like ' ' and step not like '%~'";
|
||||
da.Fill(ds, "Steps");
|
||||
dt = ds.Tables["Steps"];
|
||||
dt.CaseSensitive = true;
|
||||
ds.Tables["Steps"].CaseSensitive = true;
|
||||
dt.Columns.Add("CStep", System.Type.GetType("System.String"));
|
||||
dt.Columns.Add("CSequence", System.Type.GetType("System.String"));
|
||||
// set the cstep & csequence - couldn't do it in the add because it needed a sql function
|
||||
foreach (DataRow drw in ds.Tables["Steps"].Rows)
|
||||
{
|
||||
drw["CStep"] = TextConvert.ConvertSeq(drw["Step"].ToString());
|
||||
drw["CSequence"] = TextConvert.ConvertSeq(drw["Sequence"].ToString());
|
||||
}
|
||||
dt.Columns.Add("StepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CStep,2,1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("Level", System.Type.GetType("System.Int32"), "Len(CSequence)");
|
||||
dt.Columns.Add("SubStepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,Len(CSequence),1),'System.Char'),'System.Int32')-48");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.Error(ex.StackTrace);
|
||||
}
|
||||
da.Dispose();
|
||||
|
||||
// dicSecCount is dictionary to track number of subsections for the parent at a level
|
||||
// dicSecID is the parent at that level
|
||||
Dictionary<int, int> dicSecCount = new Dictionary<int, int>();
|
||||
Dictionary<int, Item> dicSecParentItem = new Dictionary<int, Item>();
|
||||
frmMain.pbSectMaximum = ds.Tables["Sections"].Rows.Count;
|
||||
frmMain.pbSectValue = 0;
|
||||
|
||||
DataTable dtsect = ds.Tables["Sections"];
|
||||
dtsect.CaseSensitive = true;
|
||||
DataView dv = new DataView(dtsect, "", "locb", DataViewRowState.CurrentRows);
|
||||
Item SectItm = null;
|
||||
int level = 0;
|
||||
bool addpart = true;
|
||||
Item parentitem = itm;
|
||||
foreach (DataRowView drw in dv)
|
||||
{
|
||||
SectItm = MigrateSection(parentitem, ProcNumber, cn, drw, ds.Tables["Steps"], SectItm, dicSecCount.Count > 0 ? true : false, pth, docver);
|
||||
// if no children, add first child (cont)
|
||||
if (addpart)
|
||||
{
|
||||
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||
cont.ContentParts.Add(2, SectItm);
|
||||
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
|
||||
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
|
||||
cont.Save();
|
||||
addpart = false;
|
||||
}
|
||||
//FrType = 0;
|
||||
dicSecParentItem[level] = SectItm;
|
||||
if (level > 0)
|
||||
{
|
||||
if ((dicSecCount[level]) == 1)
|
||||
// shift up a level, i.e. give me the parent for the previous level
|
||||
SectItm = dicSecParentItem[--level];
|
||||
else
|
||||
dicSecCount[level]--; // decrements number of sections to process
|
||||
}
|
||||
// get number of subsections for this section
|
||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||
if (subSecs > 0)
|
||||
{
|
||||
dicSecCount[++level] = subSecs;
|
||||
cont = SectItm.MyContent;
|
||||
parentitem = SectItm;
|
||||
addpart = true;
|
||||
SectItm = null; // no previous sibling for the first child node.
|
||||
}
|
||||
}
|
||||
// need section start
|
||||
if (EditSectId != 0)
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "SectionStart", string.Format("{0}", EditSectId));
|
||||
itm.MyContent.Config = (ci == null) ? null : ci.ToString();
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
ds.Dispose();
|
||||
return itm;
|
||||
}
|
||||
private Item MigrateProcedures(OleDbConnection cn, string pth, DocVersion docver, bool convertProcedures)
|
||||
{
|
||||
Item FirstItm = null;
|
||||
// Loop through Set File for each Procedure
|
||||
int whereami = 0;
|
||||
try
|
||||
{
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("Select * from [set] where entry is not null", cn);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
Item FrItm = null;
|
||||
frmMain.pbProcMaximum = ds.Tables[0].Rows.Count;
|
||||
frmMain.UpdateLabels(0, 0, 0);
|
||||
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver, convertProcedures);
|
||||
if (FirstItm == null) FirstItm = FrItm;
|
||||
}
|
||||
da.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("End of MigrateProcedures - ex = {0}", ex.Message);
|
||||
_MyLog.ErrorFormat("MigrateProcedures - {0} - {1}\r\n\r\n{2}", pth,ex.Message, ex.InnerException);
|
||||
}
|
||||
return FirstItm;
|
||||
}
|
||||
private void DbtOk(string fname, string pth)
|
||||
{
|
||||
//string dbtname = frmMain.tbSourceText + "\\" + fname + ".dbt";
|
||||
string dbtname = pth + "\\" + fname + ".dbt";
|
||||
if (File.Exists(dbtname))
|
||||
{
|
||||
// check if dbt is at least 512, if not append 508 bytes. This is to fix
|
||||
// a problem where dbts were created with only 4 bytes in the 16-bit code.
|
||||
// if only 4 bytes, ado.net gives an "External table not in expected format"
|
||||
// error
|
||||
FileInfo fi = new FileInfo(dbtname);
|
||||
if (fi.Length < 512)
|
||||
{
|
||||
FileStream fs = new FileStream(dbtname, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
|
||||
BinaryWriter bw = new BinaryWriter(fs);
|
||||
bw.Seek(0, SeekOrigin.End);
|
||||
byte[] wrBytes = new byte[512 - fi.Length];
|
||||
for (int i = 0; i < 512 - fi.Length; i++) wrBytes[i] = 0;
|
||||
wrBytes[4] = 0x02;
|
||||
bw.Write(wrBytes);
|
||||
bw.Close();
|
||||
}
|
||||
fi = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
//<summary>
|
||||
//The main entry point for the application.
|
||||
//</summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new frmLoader());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
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("DataLoader")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Volian Enterprises, Inc.")]
|
||||
[assembly: AssemblyProduct("DataLoader")]
|
||||
[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")]
|
||||
[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("bcf6964e-0a2b-4e99-8dde-2dd62366294c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.832
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataLoader.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataLoader.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-422
@@ -1,422 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.5485
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataLoader.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string VeSamFilename {
|
||||
get {
|
||||
return ((string)(this["VeSamFilename"]));
|
||||
}
|
||||
set {
|
||||
this["VeSamFilename"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DbfPathname {
|
||||
get {
|
||||
return ((string)(this["DbfPathname"]));
|
||||
}
|
||||
set {
|
||||
this["DbfPathname"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState LoadWordDoc {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["LoadWordDoc"]));
|
||||
}
|
||||
set {
|
||||
this["LoadWordDoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Unchecked")]
|
||||
public global::System.Windows.Forms.CheckState LoadRTFDoc {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["LoadRTFDoc"]));
|
||||
}
|
||||
set {
|
||||
this["LoadRTFDoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState PurgeData {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["PurgeData"]));
|
||||
}
|
||||
set {
|
||||
this["PurgeData"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string VePromsFilename {
|
||||
get {
|
||||
return ((string)(this["VePromsFilename"]));
|
||||
}
|
||||
set {
|
||||
this["VePromsFilename"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string LogFileLoc {
|
||||
get {
|
||||
return ((string)(this["LogFileLoc"]));
|
||||
}
|
||||
set {
|
||||
this["LogFileLoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string BackupFileName {
|
||||
get {
|
||||
return ((string)(this["BackupFileName"]));
|
||||
}
|
||||
set {
|
||||
this["BackupFileName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string BackupFolder {
|
||||
get {
|
||||
return ((string)(this["BackupFolder"]));
|
||||
}
|
||||
set {
|
||||
this["BackupFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True")]
|
||||
public string ConnectionString {
|
||||
get {
|
||||
return ((string)(this["ConnectionString"]));
|
||||
}
|
||||
set {
|
||||
this["ConnectionString"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("VEPROMS")]
|
||||
public string DBName {
|
||||
get {
|
||||
return ((string)(this["DBName"]));
|
||||
}
|
||||
set {
|
||||
this["DBName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DBPath {
|
||||
get {
|
||||
return ((string)(this["DBPath"]));
|
||||
}
|
||||
set {
|
||||
this["DBPath"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string PDFFolder {
|
||||
get {
|
||||
return ((string)(this["PDFFolder"]));
|
||||
}
|
||||
set {
|
||||
this["PDFFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Unchecked")]
|
||||
public global::System.Windows.Forms.CheckState CheckRTF {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["CheckRTF"]));
|
||||
}
|
||||
set {
|
||||
this["CheckRTF"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int Skip {
|
||||
get {
|
||||
return ((int)(this["Skip"]));
|
||||
}
|
||||
set {
|
||||
this["Skip"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("1")]
|
||||
public int ConvertTo {
|
||||
get {
|
||||
return ((int)(this["ConvertTo"]));
|
||||
}
|
||||
set {
|
||||
this["ConvertTo"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState RedPDFs {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["RedPDFs"]));
|
||||
}
|
||||
set {
|
||||
this["RedPDFs"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState OnlyThisSet {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["OnlyThisSet"]));
|
||||
}
|
||||
set {
|
||||
this["OnlyThisSet"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int ExecutionMode {
|
||||
get {
|
||||
return ((int)(this["ExecutionMode"]));
|
||||
}
|
||||
set {
|
||||
this["ExecutionMode"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase1")]
|
||||
public string Phase1 {
|
||||
get {
|
||||
return ((string)(this["Phase1"]));
|
||||
}
|
||||
set {
|
||||
this["Phase1"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase2")]
|
||||
public string Phase2 {
|
||||
get {
|
||||
return ((string)(this["Phase2"]));
|
||||
}
|
||||
set {
|
||||
this["Phase2"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase3")]
|
||||
public string Phase3 {
|
||||
get {
|
||||
return ((string)(this["Phase3"]));
|
||||
}
|
||||
set {
|
||||
this["Phase3"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\fmtall")]
|
||||
public string FormatFolder {
|
||||
get {
|
||||
return ((string)(this["FormatFolder"]));
|
||||
}
|
||||
set {
|
||||
this["FormatFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\genmacall")]
|
||||
public string GenMacFolder {
|
||||
get {
|
||||
return ((string)(this["GenMacFolder"]));
|
||||
}
|
||||
set {
|
||||
this["GenMacFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool LoadApproved {
|
||||
get {
|
||||
return ((bool)(this["LoadApproved"]));
|
||||
}
|
||||
set {
|
||||
this["LoadApproved"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase4")]
|
||||
public string Phase4 {
|
||||
get {
|
||||
return ((string)(this["Phase4"]));
|
||||
}
|
||||
set {
|
||||
this["Phase4"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string ProcessOnlyInLocation {
|
||||
get {
|
||||
return ((string)(this["ProcessOnlyInLocation"]));
|
||||
}
|
||||
set {
|
||||
this["ProcessOnlyInLocation"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int WhatROsToConvert {
|
||||
get {
|
||||
return ((int)(this["WhatROsToConvert"]));
|
||||
}
|
||||
set {
|
||||
this["WhatROsToConvert"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||
public int SelectedROFst {
|
||||
get {
|
||||
return ((int)(this["SelectedROFst"]));
|
||||
}
|
||||
set {
|
||||
this["SelectedROFst"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool AnnotateWhenConvertingToText {
|
||||
get {
|
||||
return ((bool)(this["AnnotateWhenConvertingToText"]));
|
||||
}
|
||||
set {
|
||||
this["AnnotateWhenConvertingToText"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool AnnotateWhenShowingMissingRO {
|
||||
get {
|
||||
return ((bool)(this["AnnotateWhenShowingMissingRO"]));
|
||||
}
|
||||
set {
|
||||
this["AnnotateWhenShowingMissingRO"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool AnnotateWhenShowingDifferentRO {
|
||||
get {
|
||||
return ((bool)(this["AnnotateWhenShowingDifferentRO"]));
|
||||
}
|
||||
set {
|
||||
this["AnnotateWhenShowingDifferentRO"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int HowMany {
|
||||
get {
|
||||
return ((int)(this["HowMany"]));
|
||||
}
|
||||
set {
|
||||
this["HowMany"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,314 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4216
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataLoader.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string VeSamFilename {
|
||||
get {
|
||||
return ((string)(this["VeSamFilename"]));
|
||||
}
|
||||
set {
|
||||
this["VeSamFilename"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DbfPathname {
|
||||
get {
|
||||
return ((string)(this["DbfPathname"]));
|
||||
}
|
||||
set {
|
||||
this["DbfPathname"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState LoadWordDoc {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["LoadWordDoc"]));
|
||||
}
|
||||
set {
|
||||
this["LoadWordDoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Unchecked")]
|
||||
public global::System.Windows.Forms.CheckState LoadRTFDoc {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["LoadRTFDoc"]));
|
||||
}
|
||||
set {
|
||||
this["LoadRTFDoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState PurgeData {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["PurgeData"]));
|
||||
}
|
||||
set {
|
||||
this["PurgeData"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string VePromsFilename {
|
||||
get {
|
||||
return ((string)(this["VePromsFilename"]));
|
||||
}
|
||||
set {
|
||||
this["VePromsFilename"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string LogFileLoc {
|
||||
get {
|
||||
return ((string)(this["LogFileLoc"]));
|
||||
}
|
||||
set {
|
||||
this["LogFileLoc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string BackupFileName {
|
||||
get {
|
||||
return ((string)(this["BackupFileName"]));
|
||||
}
|
||||
set {
|
||||
this["BackupFileName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string BackupFolder {
|
||||
get {
|
||||
return ((string)(this["BackupFolder"]));
|
||||
}
|
||||
set {
|
||||
this["BackupFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True")]
|
||||
public string ConnectionString {
|
||||
get {
|
||||
return ((string)(this["ConnectionString"]));
|
||||
}
|
||||
set {
|
||||
this["ConnectionString"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("VEPROMS")]
|
||||
public string DBName {
|
||||
get {
|
||||
return ((string)(this["DBName"]));
|
||||
}
|
||||
set {
|
||||
this["DBName"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DBPath {
|
||||
get {
|
||||
return ((string)(this["DBPath"]));
|
||||
}
|
||||
set {
|
||||
this["DBPath"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string PDFFolder {
|
||||
get {
|
||||
return ((string)(this["PDFFolder"]));
|
||||
}
|
||||
set {
|
||||
this["PDFFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Unchecked")]
|
||||
public global::System.Windows.Forms.CheckState CheckRTF {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["CheckRTF"]));
|
||||
}
|
||||
set {
|
||||
this["CheckRTF"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int Skip {
|
||||
get {
|
||||
return ((int)(this["Skip"]));
|
||||
}
|
||||
set {
|
||||
this["Skip"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("1")]
|
||||
public int ConvertTo {
|
||||
get {
|
||||
return ((int)(this["ConvertTo"]));
|
||||
}
|
||||
set {
|
||||
this["ConvertTo"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState RedPDFs {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["RedPDFs"]));
|
||||
}
|
||||
set {
|
||||
this["RedPDFs"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Checked")]
|
||||
public global::System.Windows.Forms.CheckState OnlyThisSet {
|
||||
get {
|
||||
return ((global::System.Windows.Forms.CheckState)(this["OnlyThisSet"]));
|
||||
}
|
||||
set {
|
||||
this["OnlyThisSet"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||
public int ExecutionMode {
|
||||
get {
|
||||
return ((int)(this["ExecutionMode"]));
|
||||
}
|
||||
set {
|
||||
this["ExecutionMode"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase1")]
|
||||
public string Phase1 {
|
||||
get {
|
||||
return ((string)(this["Phase1"]));
|
||||
}
|
||||
set {
|
||||
this["Phase1"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase2")]
|
||||
public string Phase2 {
|
||||
get {
|
||||
return ((string)(this["Phase2"]));
|
||||
}
|
||||
set {
|
||||
this["Phase2"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Phase3")]
|
||||
public string Phase3 {
|
||||
get {
|
||||
return ((string)(this["Phase3"]));
|
||||
}
|
||||
set {
|
||||
this["Phase3"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\fmtall")]
|
||||
public string FormatFolder {
|
||||
get {
|
||||
return ((string)(this["FormatFolder"]));
|
||||
}
|
||||
set {
|
||||
this["FormatFolder"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\genmacall")]
|
||||
public string GenMacFolder {
|
||||
get {
|
||||
return ((string)(this["GenMacFolder"]));
|
||||
}
|
||||
set {
|
||||
this["GenMacFolder"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DataLoader.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="VeSamFilename" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="DbfPathname" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="LoadWordDoc" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Checked</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoadRTFDoc" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Unchecked</Value>
|
||||
</Setting>
|
||||
<Setting Name="PurgeData" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Checked</Value>
|
||||
</Setting>
|
||||
<Setting Name="VePromsFilename" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="LogFileLoc" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="BackupFileName" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="BackupFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="ConnectionString" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True</Value>
|
||||
</Setting>
|
||||
<Setting Name="DBName" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">VEPROMS</Value>
|
||||
</Setting>
|
||||
<Setting Name="DBPath" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="PDFFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="CheckRTF" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Unchecked</Value>
|
||||
</Setting>
|
||||
<Setting Name="Skip" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="ConvertTo" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">1</Value>
|
||||
</Setting>
|
||||
<Setting Name="RedPDFs" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Checked</Value>
|
||||
</Setting>
|
||||
<Setting Name="OnlyThisSet" Type="System.Windows.Forms.CheckState" Scope="User">
|
||||
<Value Profile="(Default)">Checked</Value>
|
||||
</Setting>
|
||||
<Setting Name="ExecutionMode" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="Phase1" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Phase1</Value>
|
||||
</Setting>
|
||||
<Setting Name="Phase2" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Phase2</Value>
|
||||
</Setting>
|
||||
<Setting Name="Phase3" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Phase3</Value>
|
||||
</Setting>
|
||||
<Setting Name="FormatFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">c:\development\fmtall</Value>
|
||||
</Setting>
|
||||
<Setting Name="GenMacFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">c:\development\genmacall</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoadApproved" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="Phase4" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Phase4</Value>
|
||||
</Setting>
|
||||
<Setting Name="ProcessOnlyInLocation" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="WhatROsToConvert" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="SelectedROFst" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">-1</Value>
|
||||
</Setting>
|
||||
<Setting Name="AnnotateWhenConvertingToText" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="AnnotateWhenShowingMissingRO" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="AnnotateWhenShowingDifferentRO" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="HowMany" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -1 +0,0 @@
|
||||
C1.Win.C1FlexGrid.C1FlexGrid, C1.Win.C1FlexGrid.2, Version=2.6.20101.528, Culture=neutral, PublicKeyToken=79882d576c6336da
|
||||
@@ -1,290 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public delegate void ROFixerEvent(object sender, ROFixerEventArgs args);
|
||||
public class ROFixerEventArgs
|
||||
{
|
||||
private string _MyStatus;
|
||||
|
||||
public string MyStatus
|
||||
{
|
||||
get { return _MyStatus; }
|
||||
set { _MyStatus = value; }
|
||||
}
|
||||
public ROFixerEventArgs(string myStatus)
|
||||
{
|
||||
_MyStatus = myStatus;
|
||||
}
|
||||
}
|
||||
class ROFixer
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public event ROFixerEvent StatusChanged;
|
||||
private void OnStatusChanged(object sender, ROFixerEventArgs args)
|
||||
{
|
||||
if (StatusChanged != null)
|
||||
StatusChanged(sender, args);
|
||||
}
|
||||
private string _Status;
|
||||
|
||||
public string Status
|
||||
{
|
||||
get { return _Status; }
|
||||
set
|
||||
{
|
||||
_Status = value;
|
||||
OnStatusChanged(this, new ROFixerEventArgs(_Status));
|
||||
}
|
||||
}
|
||||
private int _ErrorCount = 0;
|
||||
|
||||
public int ErrorCount
|
||||
{
|
||||
get { return _ErrorCount; }
|
||||
set { _ErrorCount = value; }
|
||||
}
|
||||
private string _LogPath;
|
||||
private frmLoader frmMain;
|
||||
public ROFixer(string logpath, frmLoader myfrmMain)
|
||||
{
|
||||
_LogPath = logpath;
|
||||
frmMain = myfrmMain;
|
||||
}
|
||||
public TimeSpan Process()
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs();
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
public TimeSpan Process(DocVersionInfo dvi)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs(dvi);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
public TimeSpan Process(ProcedureInfo pi)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs(pi);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
private void ProcessROs()
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.Get();
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
//private void ProcessROs(FolderInfo fi)
|
||||
//{
|
||||
// Status = "Getting List...";
|
||||
// RoUsageInfoList myRoUsages = RoUsageInfoList.GetByFolder(fi);
|
||||
// DoProcessROs(myRoUsages);
|
||||
//}
|
||||
private void ProcessROs(DocVersionInfo dvi)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.GetByDocVersion(dvi);
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
private void ProcessROs(ProcedureInfo pi)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.GetByProcedure(pi);
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
private AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood
|
||||
public AnnotationType VolianCommentType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_VolianCommentType == null)
|
||||
_VolianCommentType = AnnotationType.GetByName("Volian Comment");
|
||||
if (_VolianCommentType == null)
|
||||
_VolianCommentType = AnnotationType.MakeAnnotationType("Volian Comment",null);
|
||||
return _VolianCommentType;
|
||||
}
|
||||
}
|
||||
private void DoProcessROs(RoUsageInfoList myRoUsages)
|
||||
{
|
||||
int changeCount = 0;
|
||||
// get list of content records
|
||||
List<int> myContentList = new List<int>();
|
||||
Dictionary<int, ROFSTLookup> roFstLookups = new Dictionary<int,ROFSTLookup>();
|
||||
Dictionary<int, ROFSTLookup> oldRoFstLookups = null;
|
||||
ROFstInfo oldRoFst = null;
|
||||
if (frmMain.MySettings.SelectedROFst > 0)
|
||||
{
|
||||
oldRoFst = ROFstInfo.Get(frmMain.MySettings.SelectedROFst);
|
||||
oldRoFstLookups = new Dictionary<int, ROFSTLookup>();
|
||||
}
|
||||
foreach (RoUsageInfo rou in myRoUsages)
|
||||
{
|
||||
if (!myContentList.Contains(rou.ContentID))
|
||||
{
|
||||
myContentList.Add(rou.ContentID);
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
foreach (int cid in myContentList)
|
||||
{
|
||||
Status = string.Format("Processing {0} of {1} steps", ++i, myContentList.Count);
|
||||
ContentInfo myContentInfo = ContentInfo.Get(cid);
|
||||
DocVersionInfo dvi = myContentInfo.ContentItems[0].MyProcedure.MyDocVersion;
|
||||
int versionId = dvi.VersionID;
|
||||
ROFstInfo myRoFst = dvi.DocVersionAssociations[0].MyROFst;
|
||||
if (!roFstLookups.ContainsKey(versionId))
|
||||
{
|
||||
roFstLookups.Add(versionId, myRoFst.GetROFSTLookup(dvi));
|
||||
}
|
||||
ROFSTLookup myLookup = roFstLookups[versionId];
|
||||
if (oldRoFstLookups != null && !oldRoFstLookups.ContainsKey(versionId))
|
||||
{
|
||||
oldRoFstLookups.Add(versionId, oldRoFst.GetROFSTLookup(dvi));
|
||||
}
|
||||
ROFSTLookup oldLookup = null;
|
||||
if(oldRoFstLookups != null)
|
||||
oldLookup = oldRoFstLookups[versionId];
|
||||
using (Content ctmp = myContentInfo.Get())
|
||||
{
|
||||
ItemInfo ii = myContentInfo.ContentItems[0];
|
||||
foreach (RoUsageInfo ru in myContentInfo.ContentRoUsages)
|
||||
{
|
||||
string sameMsg = string.Empty;
|
||||
bool theSame = false;
|
||||
if (oldLookup != null)
|
||||
theSame = CheckIfTheSame(ii, ru.ROID, myLookup, oldLookup, dvi, ref sameMsg);
|
||||
ROFSTLookup.rochild rocc = myLookup.GetRoChild12(ru.ROID);
|
||||
if (rocc.value == null)
|
||||
rocc = myLookup.GetRoChild(ru.ROID);
|
||||
int myType = rocc.type;
|
||||
string myValue = myLookup.GetTranslatedRoValue(ru.ROID, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
myValue = myValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string fileNameOnly = null;
|
||||
if (myType == 8 && myValue.Contains("\n"))
|
||||
{
|
||||
fileNameOnly = myValue.Split("\n".ToCharArray())[0];
|
||||
myValue = myValue.Replace("\n", "");// Remove newlines in Figure data
|
||||
}
|
||||
string textB4 = ctmp.Text;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
string oldval;
|
||||
switch (frmMain.MySettings.WhatROsToConvert)
|
||||
{
|
||||
case ROUpdateMode.None:
|
||||
oldval = ctmp.FixContentText(ru, myValue, myType, myRoFst, fileNameOnly,"");
|
||||
if(myValue == "?" && frmMain.MySettings.AnnotateWhenShowingMissingRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) missing", ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
else if (ctmp.Text != textB4 && frmMain.MySettings.AnnotateWhenShowingDifferentRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("Old RO value ({0}) different than new RO value({1})", ItemInfo.ConvertToDisplayText(oldval), ItemInfo.ConvertToDisplayText(myValue)), null);
|
||||
break;
|
||||
case ROUpdateMode.All:
|
||||
oldval = ctmp.ConvertROToText(ru, myValue, myType, myRoFst);
|
||||
if (frmMain.MySettings.AnnotateWhenConvertingToText)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
break;
|
||||
default:
|
||||
if (myValue == "?")
|
||||
{
|
||||
oldval = ctmp.ConvertROToText(ru, myValue, myType, myRoFst);
|
||||
if (frmMain.MySettings.AnnotateWhenConvertingToText)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text" + sameMsg, ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldval = ctmp.FixContentText(ru, myValue, myType, myRoFst, fileNameOnly,"");
|
||||
if (ctmp.Text != textB4 && frmMain.MySettings.AnnotateWhenShowingDifferentRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("Old RO value ({0}) different than new RO value({1})" + sameMsg, ItemInfo.ConvertToDisplayText(oldval), ItemInfo.ConvertToDisplayText(myValue)), null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (ctmp.Text != textB4)
|
||||
{
|
||||
changeCount++;
|
||||
//Console.WriteLine("'{0}', '{1}', '{2}', '{3}'", replace(oldval, @"\u8209?", "-"), replace(myValue, @"\u8209?", "-"), ru.ROID, rocc.appid);
|
||||
frmMain.AddInfo("'{0}','{1}','{2}','{3}','R{4}','{5}','{6}'", ii.MyDocVersion.MyFolder.Name, ii.ShortPath,
|
||||
(oldval ?? "").Replace(@"\u8209?", "-").Replace("'", "''"), myValue.Replace(@"\u8209?", "-").Replace("'", "''"), ru.ROID, myLookup.GetAccPageID(ru.ROID), sameMsg);
|
||||
}
|
||||
else if (sameMsg != string.Empty && sameMsg != ", Exact Match")
|
||||
{
|
||||
frmMain.AddInfo("'{0}','{1}','{2}','{3}','R{4}','{5}','{6}'", ii.MyDocVersion.MyFolder.Name, ii.ShortPath,
|
||||
(oldval ?? "").Replace(@"\u8209?", "-").Replace("'", "''"), myValue.Replace(@"\u8209?", "-").Replace("'", "''"), ru.ROID, myLookup.GetAccPageID(ru.ROID), sameMsg);
|
||||
}
|
||||
}
|
||||
if (ctmp.IsDirty)
|
||||
{
|
||||
//ctmp.DTS = DateTime.Now;
|
||||
ctmp.Save();
|
||||
ContentInfo.Refresh(ctmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
frmMain.AddInfo("{0} RO Values Updated", changeCount);
|
||||
MessageBox.Show(String.Format("{0} RO Values Updated", changeCount), "RO Value Update Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private bool CheckIfTheSame(ItemInfo ii, string roid, ROFSTLookup myLookup, ROFSTLookup oldLookup, DocVersionInfo dvi, ref string sameMsg)
|
||||
{
|
||||
/*
|
||||
ROFSTLookup.rochild rocc = myLookup.GetRoChild12(ru.ROID);
|
||||
if (rocc.value == null)
|
||||
rocc = myLookup.GetRoChild(ru.ROID);
|
||||
int myType = rocc.type;
|
||||
*/
|
||||
ROFSTLookup.rochild roc = myLookup.GetRoChild12(roid);
|
||||
if (roc.value == null) roc = myLookup.GetRoChild(roid);
|
||||
ROFSTLookup.rochild oroc = oldLookup.GetRoChild12(roid);
|
||||
if (oroc.value == null) oroc = oldLookup.GetRoChild(roid);
|
||||
string myValue = myLookup.GetTranslatedRoValue(roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
myValue = myValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string oldValue = oldLookup.GetTranslatedRoValue(roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
oldValue = oldValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string myAccPageID = myLookup.GetAccPageID(roid);
|
||||
string oldAccPageID = oldLookup.GetAccPageID(roid);
|
||||
if (myValue == oldValue && roc.type == oroc.type && ((myAccPageID ?? "null") == (oldAccPageID ?? "null")))
|
||||
{
|
||||
sameMsg = ", Exact Match";
|
||||
return true;
|
||||
}
|
||||
if (myValue != oldValue && roc.type == oroc.type && ((myAccPageID ?? "null") == (oldAccPageID ?? "null")))
|
||||
{
|
||||
sameMsg = ", Different Value, Same RO";
|
||||
return false;
|
||||
}
|
||||
if ((myAccPageID ?? "null") != (oldAccPageID ?? "null"))
|
||||
{
|
||||
ROFSTLookup.rochild? myroc = myLookup.GetROChildByAccPageID(oldAccPageID, dvi.DocVersionConfig.RODefaults_setpointprefix, dvi.DocVersionConfig.RODefaults_graphicsprefix);
|
||||
if (myroc != null)
|
||||
{
|
||||
string myValueNew = myLookup.GetTranslatedRoValue(((ROFSTLookup.rochild)myroc).roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
if(myValueNew == oldValue)
|
||||
sameMsg = ", Same Value, Different RO";
|
||||
else
|
||||
sameMsg = ", Different Value, Different RO";
|
||||
}
|
||||
else
|
||||
sameMsg = ", Missing RO";
|
||||
return false;
|
||||
}
|
||||
sameMsg = ", Unknown";
|
||||
|
||||
//if (myLookup.GetAccPageID(roid) == oldLookup.GetAccPageID(roid))
|
||||
//{
|
||||
// sameMsg = string.Format("ROID: {0}, AccPageID: {1}, OldAccPageID: {2}", roid, myLookup.GetAccPageID(roid), oldLookup.GetAccPageID(roid));
|
||||
// return false;
|
||||
//}
|
||||
//sameMsg = "Values and AccPageIDs are different for ROID: " + roid;
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> myRoFst_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
{
|
||||
return Volian.Controls.Library.VlnFlexGrid.ROTableUpdate(sender,args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public delegate void ROFixerEvent(object sender, ROFixerEventArgs args);
|
||||
public class ROFixerEventArgs
|
||||
{
|
||||
private string _MyStatus;
|
||||
|
||||
public string MyStatus
|
||||
{
|
||||
get { return _MyStatus; }
|
||||
set { _MyStatus = value; }
|
||||
}
|
||||
public ROFixerEventArgs(string myStatus)
|
||||
{
|
||||
_MyStatus = myStatus;
|
||||
}
|
||||
}
|
||||
class ROFixer
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public event ROFixerEvent StatusChanged;
|
||||
private void OnStatusChanged(object sender, ROFixerEventArgs args)
|
||||
{
|
||||
if (StatusChanged != null)
|
||||
StatusChanged(sender, args);
|
||||
}
|
||||
private string _Status;
|
||||
|
||||
public string Status
|
||||
{
|
||||
get { return _Status; }
|
||||
set
|
||||
{
|
||||
_Status = value;
|
||||
OnStatusChanged(this, new ROFixerEventArgs(_Status));
|
||||
}
|
||||
}
|
||||
private int _ErrorCount = 0;
|
||||
|
||||
public int ErrorCount
|
||||
{
|
||||
get { return _ErrorCount; }
|
||||
set { _ErrorCount = value; }
|
||||
}
|
||||
private string _LogPath;
|
||||
private frmLoader frmMain;
|
||||
public ROFixer(string logpath, frmLoader myfrmMain)
|
||||
{
|
||||
_LogPath = logpath;
|
||||
frmMain = myfrmMain;
|
||||
}
|
||||
public TimeSpan Process()
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs();
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
public TimeSpan Process(DocVersionInfo dvi)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs(dvi);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
public TimeSpan Process(ProcedureInfo pi)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessROs(pi);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
private void ProcessROs()
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.Get();
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
//private void ProcessROs(FolderInfo fi)
|
||||
//{
|
||||
// Status = "Getting List...";
|
||||
// RoUsageInfoList myRoUsages = RoUsageInfoList.GetByFolder(fi);
|
||||
// DoProcessROs(myRoUsages);
|
||||
//}
|
||||
private void ProcessROs(DocVersionInfo dvi)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.GetByDocVersion(dvi);
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
private void ProcessROs(ProcedureInfo pi)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
RoUsageInfoList myRoUsages = RoUsageInfoList.GetByProcedure(pi);
|
||||
DoProcessROs(myRoUsages);
|
||||
}
|
||||
private AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood
|
||||
public AnnotationType VolianCommentType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_VolianCommentType == null)
|
||||
_VolianCommentType = AnnotationType.GetByName("Volian Comment");
|
||||
if (_VolianCommentType == null)
|
||||
_VolianCommentType = AnnotationType.MakeAnnotationType("Volian Comment",null);
|
||||
return _VolianCommentType;
|
||||
}
|
||||
}
|
||||
private void DoProcessROs(RoUsageInfoList myRoUsages)
|
||||
{
|
||||
int changeCount = 0;
|
||||
// get list of content records
|
||||
List<int> myContentList = new List<int>();
|
||||
Dictionary<int, ROFSTLookup> roFstLookups = new Dictionary<int,ROFSTLookup>();
|
||||
Dictionary<int, ROFSTLookup> oldRoFstLookups = null;
|
||||
ROFstInfo oldRoFst = null;
|
||||
if (frmMain.MySettings.SelectedROFst > 0)
|
||||
{
|
||||
oldRoFst = ROFstInfo.Get(frmMain.MySettings.SelectedROFst);
|
||||
oldRoFstLookups = new Dictionary<int, ROFSTLookup>();
|
||||
}
|
||||
foreach (RoUsageInfo rou in myRoUsages)
|
||||
{
|
||||
if (!myContentList.Contains(rou.ContentID))
|
||||
{
|
||||
myContentList.Add(rou.ContentID);
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
foreach (int cid in myContentList)
|
||||
{
|
||||
Status = string.Format("Processing {0} of {1} steps", ++i, myContentList.Count);
|
||||
ContentInfo myContentInfo = ContentInfo.Get(cid);
|
||||
DocVersionInfo dvi = myContentInfo.ContentItems[0].MyProcedure.MyDocVersion;
|
||||
int versionId = dvi.VersionID;
|
||||
ROFstInfo myRoFst = dvi.DocVersionAssociations[0].MyROFst;
|
||||
if (!roFstLookups.ContainsKey(versionId))
|
||||
{
|
||||
roFstLookups.Add(versionId, myRoFst.GetROFSTLookup(dvi));
|
||||
}
|
||||
ROFSTLookup myLookup = roFstLookups[versionId];
|
||||
if (oldRoFstLookups != null && !oldRoFstLookups.ContainsKey(versionId))
|
||||
{
|
||||
oldRoFstLookups.Add(versionId, oldRoFst.GetROFSTLookup(dvi));
|
||||
}
|
||||
ROFSTLookup oldLookup = null;
|
||||
if(oldRoFstLookups != null)
|
||||
oldLookup = oldRoFstLookups[versionId];
|
||||
using (Content ctmp = myContentInfo.Get())
|
||||
{
|
||||
ItemInfo ii = myContentInfo.ContentItems[0];
|
||||
foreach (RoUsageInfo ru in myContentInfo.ContentRoUsages)
|
||||
{
|
||||
string sameMsg = string.Empty;
|
||||
bool theSame = false;
|
||||
//if (oldLookup != null)
|
||||
// theSame = CheckIfTheSame(ii, ru.ROID, myLookup, oldLookup, dvi, ref sameMsg);
|
||||
ROFSTLookup.rochild rocc = myLookup.GetRoChild12(ru.ROID);
|
||||
if (rocc.value == null)
|
||||
rocc = myLookup.GetRoChild(ru.ROID);
|
||||
int myType = rocc.type;
|
||||
string myValue = myLookup.GetTranslatedRoValue(ru.ROID, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
myValue = myValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string fileNameOnly = null;
|
||||
if (myType == 8 && myValue.Contains("\n"))
|
||||
{
|
||||
fileNameOnly = myValue.Split("\n".ToCharArray())[0];
|
||||
myValue = myValue.Replace("\n", "");// Remove newlines in Figure data
|
||||
}
|
||||
string textB4 = ctmp.Text;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
string oldval;
|
||||
switch (frmMain.MySettings.WhatROsToConvert)
|
||||
{
|
||||
case ROUpdateMode.None:
|
||||
oldval = ctmp.FixContentText(ru, myValue, myType, myRoFst, fileNameOnly);
|
||||
if(myValue == "?" && frmMain.MySettings.AnnotateWhenShowingMissingRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) missing", ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
else if (ctmp.Text != textB4 && frmMain.MySettings.AnnotateWhenShowingDifferentRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("Old RO value ({0}) different than new RO value({1})", ItemInfo.ConvertToDisplayText(oldval), ItemInfo.ConvertToDisplayText(myValue)), null);
|
||||
break;
|
||||
case ROUpdateMode.All:
|
||||
oldval = ctmp.ConvertROToText(ru, myValue, myType, myRoFst);
|
||||
if (frmMain.MySettings.AnnotateWhenConvertingToText)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
break;
|
||||
default:
|
||||
if (myValue == "?")
|
||||
{
|
||||
oldval = ctmp.ConvertROToText(ru, myValue, myType, myRoFst);
|
||||
if (frmMain.MySettings.AnnotateWhenConvertingToText)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text" + sameMsg, ItemInfo.ConvertToDisplayText(oldval)), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldval = ctmp.FixContentText(ru, myValue, myType, myRoFst, fileNameOnly);
|
||||
if (ctmp.Text != textB4 && frmMain.MySettings.AnnotateWhenShowingDifferentRO)
|
||||
Annotation.MakeAnnotation(ctmp.ContentItems[0].MyItem, VolianCommentType, "", string.Format("Old RO value ({0}) different than new RO value({1})" + sameMsg, ItemInfo.ConvertToDisplayText(oldval), ItemInfo.ConvertToDisplayText(myValue)), null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (ctmp.Text != textB4)
|
||||
{
|
||||
changeCount++;
|
||||
//Console.WriteLine("'{0}', '{1}', '{2}', '{3}'", replace(oldval, @"\u8209?", "-"), replace(myValue, @"\u8209?", "-"), ru.ROID, rocc.appid);
|
||||
frmMain.AddInfo("'{0}','{1}','{2}','{3}','R{4}','{5}','{6}'", ii.MyDocVersion.MyFolder.Name, ii.ShortPath,
|
||||
(oldval ?? "").Replace(@"\u8209?", "-").Replace("'", "''"), myValue.Replace(@"\u8209?", "-").Replace("'", "''"), ru.ROID, myLookup.GetAccPageID(ru.ROID), sameMsg);
|
||||
}
|
||||
else if (sameMsg != string.Empty && sameMsg != ", Exact Match")
|
||||
{
|
||||
frmMain.AddInfo("'{0}','{1}','{2}','{3}','R{4}','{5}','{6}'", ii.MyDocVersion.MyFolder.Name, ii.ShortPath,
|
||||
(oldval ?? "").Replace(@"\u8209?", "-").Replace("'", "''"), myValue.Replace(@"\u8209?", "-").Replace("'", "''"), ru.ROID, myLookup.GetAccPageID(ru.ROID), sameMsg);
|
||||
}
|
||||
}
|
||||
if (ctmp.IsDirty)
|
||||
{
|
||||
//ctmp.DTS = DateTime.Now;
|
||||
ctmp.Save();
|
||||
ContentInfo.Refresh(ctmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
frmMain.AddInfo("{0} RO Values Updated", changeCount);
|
||||
MessageBox.Show(String.Format("{0} RO Values Updated", changeCount), "RO Value Update Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private bool CheckIfTheSame(ItemInfo ii, string roid, ROFSTLookup myLookup, ROFSTLookup oldLookup, DocVersionInfo dvi, ref string sameMsg)
|
||||
{
|
||||
/*
|
||||
ROFSTLookup.rochild rocc = myLookup.GetRoChild12(ru.ROID);
|
||||
if (rocc.value == null)
|
||||
rocc = myLookup.GetRoChild(ru.ROID);
|
||||
int myType = rocc.type;
|
||||
*/
|
||||
ROFSTLookup.rochild roc = myLookup.GetRoChild12(roid);
|
||||
if (roc.value == null) roc = myLookup.GetRoChild(roid);
|
||||
ROFSTLookup.rochild oroc = oldLookup.GetRoChild12(roid);
|
||||
if (oroc.value == null) oroc = oldLookup.GetRoChild(roid);
|
||||
string myValue = myLookup.GetTranslatedRoValue(roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
myValue = myValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string oldValue = oldLookup.GetTranslatedRoValue(roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
oldValue = oldValue.Replace(@"\up2 \u8209?", @"\up2\u8209?");// Remove space between superscript command and non-breaking hyphen
|
||||
string myAccPageID = myLookup.GetAccPageID(roid);
|
||||
string oldAccPageID = oldLookup.GetAccPageID(roid);
|
||||
if (myValue == oldValue && roc.type == oroc.type && ((myAccPageID ?? "null") == (oldAccPageID ?? "null")))
|
||||
{
|
||||
sameMsg = ", Exact Match";
|
||||
return true;
|
||||
}
|
||||
if (myValue != oldValue && roc.type == oroc.type && ((myAccPageID ?? "null") == (oldAccPageID ?? "null")))
|
||||
{
|
||||
sameMsg = ", Different Value, Same RO";
|
||||
return false;
|
||||
}
|
||||
if ((myAccPageID ?? "null") != (oldAccPageID ?? "null"))
|
||||
{
|
||||
ROFSTLookup.rochild? myroc = myLookup.GetROChildByAccPageID(oldAccPageID, dvi.DocVersionConfig.RODefaults_setpointprefix), dvi.DocVersionConfig.RODefaults_graphicsprefix);
|
||||
if (myroc != null)
|
||||
{
|
||||
string myValueNew = myLookup.GetTranslatedRoValue(((ROFSTLookup.rochild)myroc).roid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||
if(myValueNew == oldValue)
|
||||
sameMsg = ", Same Value, Different RO";
|
||||
else
|
||||
sameMsg = ", Different Value, Different RO";
|
||||
}
|
||||
else
|
||||
sameMsg = ", Missing RO";
|
||||
return false;
|
||||
}
|
||||
sameMsg = ", Unknown";
|
||||
|
||||
//if (myLookup.GetAccPageID(roid) == oldLookup.GetAccPageID(roid))
|
||||
//{
|
||||
// sameMsg = string.Format("ROID: {0}, AccPageID: {1}, OldAccPageID: {2}", roid, myLookup.GetAccPageID(roid), oldLookup.GetAccPageID(roid));
|
||||
// return false;
|
||||
//}
|
||||
//sameMsg = "Values and AccPageIDs are different for ROID: " + roid;
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<string> myRoFst_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
{
|
||||
return Volian.Controls.Library.VlnFlexGrid.ROTableUpdate(sender,args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private List<string> InvalidROs = new List<string>();
|
||||
private string MigrateRos(OleDbConnection cn, string textm, string seqcvt, Content content, DocVersion docver, bool conv_caret,ref int rotype)
|
||||
{
|
||||
StringBuilder rotxt = new StringBuilder();
|
||||
int instance = 0;
|
||||
int beg = 0;
|
||||
DataTable dt = null;
|
||||
DataSet ds = null;
|
||||
OleDbDataAdapter da = null;
|
||||
|
||||
string cmd = "SELECT * FROM USAGERO WHERE [NUMBER]='" + ProcNumber.Replace("'", "''") + "' AND [SEQUENCE] ='" + seqcvt + "' ORDER BY [INSTANCE]";
|
||||
da = new OleDbDataAdapter(cmd, cn);
|
||||
// get usage records for the ROID.
|
||||
ds = new DataSet();
|
||||
try
|
||||
{
|
||||
da.Fill(ds);
|
||||
dt = ds.Tables[0];
|
||||
dt.CaseSensitive = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "migrateRos");
|
||||
log.Error("Error getting RO Usages");
|
||||
log.ErrorFormat("proc number = {0}, oldstepsequence = {1}",ProcNumber, seqcvt);
|
||||
do
|
||||
{
|
||||
log.ErrorFormat("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
ex = ex.InnerException;
|
||||
} while (ex != null);
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
return textm;
|
||||
}
|
||||
char[] chrrotrn = { '\x15', '\x3a6' };
|
||||
int tok = textm.IndexOfAny(chrrotrn);
|
||||
while (tok > -1)
|
||||
{
|
||||
// found a token, add the roid & value into the string and
|
||||
// add an ro usage for it.
|
||||
rotxt.Append(textm.Substring(beg, tok - beg));
|
||||
if (instance < dt.Rows.Count)
|
||||
{
|
||||
DataRow dr = dt.Rows[instance];
|
||||
string ROID = dr["ROID"].ToString();
|
||||
RoUsage ro = RoUsage.MakeRoUsage(content, ROID, null, DateTime.Now, "Migration", rodb);
|
||||
try
|
||||
{
|
||||
ROFSTLookup mylookup = rofstinfo.GetROFSTLookup(DocVersionInfo.Get(docver.VersionID));
|
||||
ROFSTLookup.rochild myro = mylookup.GetRoChild12(ROID.ToUpper());
|
||||
rotype = Math.Max(rotype, myro.type);
|
||||
string roval = mylookup.GetTranslatedRoValue(ROID.ToUpper(), conv_caret);
|
||||
if (textm[tok] == '\x3a6' && roval.IndexOf('\n')>-1) // figure - just get image name
|
||||
{
|
||||
roval = roval.Substring(0, roval.IndexOf('\n'));
|
||||
}
|
||||
roval = roval.Replace("{", @"\{");
|
||||
roval = roval.Replace("}", @"\}");
|
||||
// add an annotation stating "Invalid Unit RO 'ROID'. Need an Item for this, so just add
|
||||
// it to a list of 'invalid ros' so that calling method can add annotations to the Item.
|
||||
if (roval == "?")
|
||||
{
|
||||
if (ROID.StartsWith("FFFF"))
|
||||
InvalidROs.Add(string.Format("Invalid Unit RO '{0}'", ROID.Substring(0, 12)));
|
||||
else
|
||||
InvalidROs.Add(string.Format("Invalid RO '{0}'", ROID.Substring(0, 12)));
|
||||
}
|
||||
//if (roval.Contains("\r") || roval.Contains("\n"))
|
||||
// Console.WriteLine("RO has new Lines");
|
||||
//string results = string.Format(@"\v <START]\v0 {0}\v #Link:ReferencedObject:{1} {2} {3}\v0 \v [END>\v0 ",
|
||||
// rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID, rodb.RODbID);
|
||||
// RHM 20100308 - string results = string.Format(@"\v <START]\v0\cf1 {0}\cf0\v #Link:ReferencedObject:{1} {2} {3}\v0 \v [END>\v0 ",
|
||||
// RHM 20100308 - roval.Replace("\r\n","\\par\r\n"), ro.ROUsageID, ROID, rodb.RODbID);
|
||||
string results = string.Format(@"\v <START]\v0 {0}\v #Link:ReferencedObject:{1} {2} {3}[END>\v0 ",
|
||||
roval, ro.ROUsageID, ROID, rodb.RODbID);
|
||||
rotxt.Append(results);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
frmMain.AddError(ex, "MigrateRos '{0}' '{1}' {2}", ProcNumber, seqcvt, instance);
|
||||
log.Error("Error setting RO data in text field");
|
||||
log.ErrorFormat("Error Message = {0}", ex.Message);
|
||||
log.ErrorFormat("proc number = {0}, oldstepsequence = {1}, instance = {2}", ProcNumber, seqcvt, instance);
|
||||
}
|
||||
instance++;
|
||||
}
|
||||
else
|
||||
{
|
||||
rotxt.Append("?");
|
||||
InvalidROs.Add("The ? in the step text represents an RO that was not connected to the ro database.");
|
||||
log.Error("Error setting RO data in text field");
|
||||
log.ErrorFormat("proc number = {0}, oldstepsequence = {1}, instance = {2}", ProcNumber, seqcvt, instance);
|
||||
}
|
||||
beg = tok + 1;
|
||||
if (beg > textm.Length)
|
||||
{
|
||||
tok = -1;
|
||||
da.Dispose();
|
||||
}
|
||||
else
|
||||
tok = textm.IndexOf('\x15', beg); // there would only be one figure - only check for ro after 1st time
|
||||
}
|
||||
if (beg <= textm.Length - 1)
|
||||
rotxt.Append(textm.Substring(beg, textm.Length - beg));
|
||||
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
return rotxt.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class RichTextBox41
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class RichTextBox41 : RichTextBox
|
||||
{
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
static extern IntPtr LoadLibrary(string lpFileName);
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
CreateParams prams = base.CreateParams;
|
||||
if (LoadLibrary("msftedit.dll") != IntPtr.Zero)
|
||||
{
|
||||
//prams.ExStyle |= 0x020; // transparent
|
||||
prams.ClassName = "RICHEDIT50W";
|
||||
}
|
||||
return prams;
|
||||
}
|
||||
}
|
||||
public RichTextBox41()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public RichTextBox41(IContainer container)
|
||||
{
|
||||
container.Add(this);
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Text.RegularExpressions;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Config;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
public void MigrateROFST(string fstPath, DocVersion docver)
|
||||
{
|
||||
//if (!File.Exists(fstPath + @"\ro.fst"))
|
||||
//{
|
||||
// log.ErrorFormat("RO FST Does not exist: {0}", fstPath);
|
||||
// return;
|
||||
//}
|
||||
// get the proc.ini value for the ropath. If it doesn't exist, use "..\"
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
XmlDocument d = cfg.IniToXml(fstPath + @"\proc.ini");
|
||||
string roDbpath = null;
|
||||
string sp_prefix = null;
|
||||
string img_prefix = null;
|
||||
if (d != null)
|
||||
{
|
||||
XmlElement xml = d.DocumentElement;
|
||||
XmlNode rodef = xml.SelectSingleNode("//RODefaults");
|
||||
XmlElement ele = rodef as XmlElement;
|
||||
//string tmp = null;
|
||||
if (ele != null)
|
||||
{
|
||||
roDbpath = ele.GetAttribute("ROPATH");
|
||||
sp_prefix = ele.GetAttribute("Setpoint");
|
||||
img_prefix = ele.GetAttribute("Graphics");
|
||||
}
|
||||
}
|
||||
DirectoryInfo di2 = new DirectoryInfo(fstPath);
|
||||
roDbpath = roDbpath ?? "";
|
||||
if (roDbpath == "")
|
||||
roDbpath = @"..\ro";
|
||||
if (roDbpath.StartsWith(@"..\"))
|
||||
{
|
||||
while (roDbpath.StartsWith(@"..\"))
|
||||
{
|
||||
di2 = di2.Parent;
|
||||
roDbpath = roDbpath.Substring(3);
|
||||
}
|
||||
DirectoryInfo[] dis = di2.GetDirectories(roDbpath);
|
||||
if (dis.Length > 0) roDbpath = dis[0].FullName;
|
||||
}
|
||||
//if (roDbpath == null || roDbpath == "")
|
||||
// roDbpath = fstPath.Substring(0, fstPath.LastIndexOf('\\')) + @"\ro";
|
||||
|
||||
// first see if this rodb has been migrated (another dataset may have migrated it)
|
||||
DirectoryInfo di = new DirectoryInfo(roDbpath);
|
||||
rodb = RODb.GetByFolderPath(di.FullName);
|
||||
if (rodb == null)
|
||||
{
|
||||
|
||||
// There may be more than 1 'ro' as the 'ROName' field (ROName is derived from the ropath).
|
||||
// Get new name be incrementing, if so.
|
||||
string newname = NewROName(di.Name);
|
||||
// If there is default graphic file extension data in the roapp.ini, use this as config
|
||||
// data for the rodb, otherwise set it to 'cstring' for now.
|
||||
cfg = new ConfigFile();
|
||||
d = cfg.LoadRoAppIni(roDbpath);
|
||||
rodb = RODb.MakeRODb(di.Name, di.FullName, "cstring", d==null?null:d.InnerXml);
|
||||
}
|
||||
|
||||
// now see if the same ro.fst has been migrated. To determine this check if a record
|
||||
// exists for the rodb and with the same dts as the file.
|
||||
FileInfo fi = new FileInfo(fstPath + @"\ro.fst");
|
||||
if (!fi.Exists)
|
||||
fi = new FileInfo(roDbpath + @"\ro.fst");
|
||||
|
||||
ROFst rofst = ROFst.GetByRODbID_DTS(rodb.RODbID, fi.LastWriteTimeUtc);
|
||||
if (rofst == null) // if not already in our database, then add it.
|
||||
{
|
||||
// Next read in the rofst & make the rofst record.
|
||||
FileStream fsIn = new FileStream(fi.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
// Create an instance of StreamReader that can read characters from the FileStream.
|
||||
BinaryReader r = new BinaryReader(fsIn);
|
||||
byte[] ab = r.ReadBytes((int)fsIn.Length);
|
||||
//r.Close();
|
||||
fsIn.Close();
|
||||
// get the date time stamp, need to create the record with the file's dts.
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, fi.LastWriteTimeUtc, "Migration");
|
||||
}
|
||||
// Next hook the rofst to the docversion using the associations table.
|
||||
bool appending = false;
|
||||
if (docver.DocVersionAssociationCount == 0)
|
||||
{
|
||||
DocVersionAssociation dva = docver.DocVersionAssociations.Add(rofst);
|
||||
AssociationConfig assoc_cfg = new AssociationConfig();
|
||||
assoc_cfg.RODefaults_graphicsprefix = img_prefix;
|
||||
assoc_cfg.RODefaults_setpointprefix = sp_prefix;
|
||||
dva.Config = assoc_cfg.ToString();
|
||||
docver.Save();
|
||||
rofst.Dispose();
|
||||
}
|
||||
else
|
||||
appending = true;
|
||||
rofstinfo = ROFstInfo.Get(rofst.ROFstID); // refresh the info record!
|
||||
|
||||
// Now load any images in... type 8: // Intergrated Graphics RO type
|
||||
ROFSTLookup mylookup = rofstinfo.GetROFSTLookup(DocVersionInfo.Get(docver.VersionID));
|
||||
if (!appending && mylookup != null)
|
||||
{
|
||||
for (int i = 0; i < mylookup.myHdr.myDbs.Length; i++)
|
||||
{
|
||||
// walk through the rofst 'database' searching for
|
||||
// all nodes that are integrated graphics, i.e. type 8.
|
||||
if (mylookup.myHdr.myDbs[i].children != null)
|
||||
MigrateRoFstGraphics(roDbpath, mylookup.myHdr.myDbs[i].children, rodb);
|
||||
}
|
||||
}
|
||||
ROImageInfo.FlagImagesZipped();
|
||||
}
|
||||
|
||||
private string NewROName(string roName)
|
||||
{
|
||||
string retval = roName;
|
||||
int iSuffix = -1;
|
||||
RODbInfoList rodblist = RODbInfoList.Get();
|
||||
|
||||
foreach (RODbInfo rdi in rodblist)
|
||||
{
|
||||
if (rdi.ROName.StartsWith(roName))
|
||||
{
|
||||
if (rdi.ROName == roName)
|
||||
iSuffix = 0;
|
||||
else if (Regex.IsMatch(rdi.ROName, roName + "[_][0-9]+"))
|
||||
{
|
||||
int ii = int.Parse(rdi.ROName.Substring(1 + roName.Length));
|
||||
if (ii > iSuffix) iSuffix = ii;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iSuffix >= 0)
|
||||
retval = string.Format("{0}_{1}", roName, iSuffix + 1);
|
||||
return retval;
|
||||
}
|
||||
private void MigrateRoFstGraphics(string rodbpath, ROFSTLookup.rochild[] rochild, RODb rodb)
|
||||
{
|
||||
for (int i = 0; i < rochild.Length; i++)
|
||||
{
|
||||
if (rochild[i].type == 8) AddGraphic(rodbpath, rochild[i].value, rodb);
|
||||
if (rochild[i].children != null) MigrateRoFstGraphics(rodbpath, rochild[i].children, rodb);
|
||||
}
|
||||
}
|
||||
private void AddGraphic(string rodbpath, string p, RODb rodb)
|
||||
{
|
||||
if (p == null) return;
|
||||
string imgname = p.Substring(0, p.IndexOf('\n'));
|
||||
int thedot = imgname.LastIndexOf('.');
|
||||
string fname = imgname;
|
||||
if (thedot == -1 || (thedot != (imgname.Length - 4)))
|
||||
{
|
||||
RODbConfig roDbCfg = new RODbConfig(rodb.Config);
|
||||
fname += string.Format(".{0}", roDbCfg.GetDefaultGraphicExtension());
|
||||
}
|
||||
|
||||
string imgfile = rodbpath + @"\" + fname;
|
||||
if (File.Exists(imgfile))
|
||||
{
|
||||
FileInfo fi = new FileInfo(imgfile);
|
||||
frmMain.Status = "Processing Image " + fname;
|
||||
// if the roimage record exists, don't create a new one...
|
||||
//Console.WriteLine("ROImage Key {0} List {1} ID {2}", ROImage.CacheCountPrimaryKey, ROImage.CacheCountList, ROImage.CacheCountByRODbID);
|
||||
//Console.WriteLine("ROImageInfo Key {0} List {1}", ROImageInfo.CacheCountPrimaryKey, ROImageInfo.CacheCountList);
|
||||
//Console.WriteLine("ROFst Key {0} List {1} ID {2}", ROFst.CacheCountPrimaryKey, ROFst.CacheCountList, ROFst.CacheCountByRODbID_DTS);
|
||||
//Console.WriteLine("ROFstInfo Key {0} List {1}", ROFstInfo.CacheCountPrimaryKey, ROFstInfo.CacheCountList);
|
||||
frmMain.AddInfo("Adding RO Image {0}", imgname);
|
||||
//using (roImg = ROImage.GetByRODbID_FileName_DTS(rodb.RODbID, imgname, fi.LastWriteTimeUtc))
|
||||
//{
|
||||
ROImage roImg = null;
|
||||
roImg = GetImageFromAvailable(rodb.RODbID, imgname, fi.LastWriteTimeUtc);
|
||||
if (roImg == null)
|
||||
{
|
||||
roImg = ROImage.GetByRODbID_FileName_DTS(rodb.RODbID, imgname, fi.LastWriteTimeUtc);
|
||||
if (roImg == null)
|
||||
{
|
||||
using (FileStream fsIn = new FileStream(imgfile, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
// Create an instance of StreamReader that can read characters from the FileStream.
|
||||
BinaryReader r = new BinaryReader(fsIn);
|
||||
byte[] ab = r.ReadBytes((int)fsIn.Length);
|
||||
r.Close();
|
||||
fsIn.Close();
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
ci.AddItem("Image", "Size", ab.Length.ToString());
|
||||
roImg = ROImage.MakeROImage(rodb, imgname, ROImageInfo.Compress(ab), ci.ToString(), fi.LastWriteTimeUtc, "Migration");
|
||||
}
|
||||
}
|
||||
AddToAvailable(roImg, rodb.RODbID, imgname, fi.LastWriteTimeUtc);
|
||||
}
|
||||
// see if it's already linked to the current rofst..
|
||||
//Figure figure = Figure.GetByROFstID_ImageID(rofstinfo.ROFstID, roImg.ImageID);
|
||||
using (Figure figure = Figure.GetByROFstID_ImageID(rofstinfo.ROFstID, roImg.ImageID))
|
||||
{
|
||||
if (figure != null) return;
|
||||
//using (ROFst rofst = rofstinfo.Get())
|
||||
ROFst rofst = rofstinfo.Get(); // Use the cached ROFST rather than creating and disposing
|
||||
//figure = Figure.MakeFigure(rofst, roImg, null);
|
||||
using (Figure tfig = Figure.MakeFigure(rofst, roImg, null)) ;
|
||||
}
|
||||
//roImg.Dispose();
|
||||
}
|
||||
else
|
||||
frmMain.AddError("Cannot Find Image File {0}", imgfile);
|
||||
}
|
||||
|
||||
private void AddToAvailable(ROImage roImg, int dbid, string imgname, DateTime dateTime)
|
||||
{
|
||||
string key = AvailableKey(dbid, imgname, dateTime);
|
||||
_AvaiableROImages.Add(key, roImg);
|
||||
}
|
||||
|
||||
private string AvailableKey(int dbid, string imgname, DateTime dateTime)
|
||||
{
|
||||
return string.Format("{0}|{1}|{2}", dbid, imgname, dateTime.ToString("yyyyMMdd HHmmss"));
|
||||
}
|
||||
|
||||
private ROImage GetImageFromAvailable(int dbid, string imgname, DateTime dateTime)
|
||||
{
|
||||
string key = AvailableKey(dbid, imgname, dateTime);
|
||||
if (_AvaiableROImages.ContainsKey(key)) return _AvaiableROImages[key];
|
||||
return null;
|
||||
}
|
||||
private Dictionary<string, ROImage> _AvaiableROImages = new Dictionary<string, ROImage>();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
// Add .Net Reference Microsoft.SqlServer.ConnectionInfo
|
||||
using Microsoft.SqlServer.Management.Common;
|
||||
// Add .Net Reference Microsoft.SqlServer.Smo
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public delegate void SQLScriptRunnerEvent(object sender, SqlInfoMessageEventArgs args);
|
||||
public class SQLScriptRunner
|
||||
{
|
||||
public event SQLScriptRunnerEvent InfoMessage;
|
||||
public void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
|
||||
{
|
||||
if (InfoMessage != null) InfoMessage(sender, args);
|
||||
}
|
||||
private string _Script;
|
||||
public string Script
|
||||
{
|
||||
get { return _Script; }
|
||||
set { _Script = value; }
|
||||
}
|
||||
private string _ConnectionString;
|
||||
public string ConnectionString
|
||||
{
|
||||
get { return _ConnectionString; }
|
||||
set { _ConnectionString = value; }
|
||||
}
|
||||
public SQLScriptRunner(string script, string connectionString)
|
||||
{
|
||||
_Script = script;
|
||||
_ConnectionString = connectionString;
|
||||
}
|
||||
public SQLScriptRunner(string dbName, string backupFolder, string connectionString, DateTime dateTime, string suffix)
|
||||
{
|
||||
_Script = string.Format("Backup database [{0}] to disk = '{1}\\{0}_{2}{3}.BAK'\r\n" +
|
||||
"GO\r\nPRINT '{0} backed up to {1}\\{0}_{2}{3}.BAK'",
|
||||
dbName, backupFolder, dateTime.ToString("yyyyMMdd_HHmm"),suffix);
|
||||
_ConnectionString = connectionString;
|
||||
}
|
||||
public void Run()
|
||||
{
|
||||
SqlConnection cn = new SqlConnection(ConnectionString);
|
||||
cn.Open();
|
||||
cn.InfoMessage += new SqlInfoMessageEventHandler(cn_InfoMessage);
|
||||
Server srv = new Server(new ServerConnection(cn));
|
||||
srv.ConnectionContext.ExecuteNonQuery(Script);
|
||||
cn.Close();
|
||||
}
|
||||
void cn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
|
||||
{
|
||||
OnInfoMessage(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,924 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows.Forms;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Config;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Security.
|
||||
/// </summary>
|
||||
///
|
||||
#region OldVeSamClasses
|
||||
// do a temp plant - we may keep this for loading in data. It will be migrated
|
||||
// to a folders record.
|
||||
#region Options
|
||||
public class PlantOptions
|
||||
{
|
||||
private UInt16 _id;
|
||||
private UInt32 _plopts;
|
||||
public List<ProcOptions> poList = new List<ProcOptions>();
|
||||
|
||||
public UInt16 Id
|
||||
{
|
||||
get {return _id;}
|
||||
set {if (_id != value) _id = value;}
|
||||
}
|
||||
|
||||
public UInt32 Options
|
||||
{
|
||||
get {return _plopts;}
|
||||
set {if (_plopts != value) _plopts = value;}
|
||||
}
|
||||
}
|
||||
public class ProcOptions
|
||||
{
|
||||
private UInt16 _id;
|
||||
private UInt16 _selected;
|
||||
public UInt32 [] Options = new UInt32[4];
|
||||
|
||||
public UInt16 Id
|
||||
{
|
||||
get {return _id;}
|
||||
set {if (_id != value)_id = value;}
|
||||
}
|
||||
public UInt16 Selected
|
||||
{
|
||||
get {return _selected;}
|
||||
set {if (_selected != value)_selected = value;}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region OldFolders
|
||||
public class Plant
|
||||
{
|
||||
private string _name;
|
||||
private string _path;
|
||||
private UInt16 _id;
|
||||
public Dictionary<ushort, ProcSet> psDic = new Dictionary<ushort,ProcSet>();
|
||||
|
||||
public string Name
|
||||
{
|
||||
get {return _name;}
|
||||
set
|
||||
{
|
||||
if (value == null) value = string.Empty;
|
||||
if (_name != value) _name = value;
|
||||
}
|
||||
}
|
||||
public string Path
|
||||
{
|
||||
get {return _path;}
|
||||
set
|
||||
{
|
||||
if (value == null) value = string.Empty;
|
||||
if (_path != value)_path = value;
|
||||
}
|
||||
}
|
||||
public UInt16 Id
|
||||
{
|
||||
get {return _id;}
|
||||
set {if (_id != value) _id = value;}
|
||||
}
|
||||
|
||||
public Plant() { }
|
||||
public Plant(string nm, string pth, UInt16 idn)
|
||||
{
|
||||
_name = nm;
|
||||
_path = pth;
|
||||
_id = idn;
|
||||
}
|
||||
}
|
||||
|
||||
public class ProcSet
|
||||
{
|
||||
private string _name;
|
||||
private string _path;
|
||||
private UInt16 _id;
|
||||
public string Name
|
||||
{
|
||||
get {return _name;}
|
||||
set
|
||||
{
|
||||
if (value == null) value = string.Empty;
|
||||
if (_name != value)_name = value;
|
||||
}
|
||||
}
|
||||
public string Path
|
||||
{
|
||||
get {return _path;}
|
||||
set
|
||||
{
|
||||
if (value == null) value = string.Empty;
|
||||
if (_path != value)_path = value;
|
||||
}
|
||||
}
|
||||
public UInt16 Id
|
||||
{
|
||||
get {return _id;}
|
||||
set {if (_id != value) _id = value;}
|
||||
}
|
||||
public ProcSet() { }
|
||||
|
||||
public ProcSet(string nm, string pth, UInt16 idn)
|
||||
{
|
||||
_name = nm;
|
||||
_path = pth;
|
||||
_id = idn;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region OldUser
|
||||
// The OldUser class stores data from the vesam input. The User class migrates
|
||||
// and saves data to the new sql database.
|
||||
public class OldUser
|
||||
{
|
||||
private UInt32 _systemopts;
|
||||
private string _username;
|
||||
private bool _blockaccessflag = false;
|
||||
public List<PlantOptions> PlantOpts = new List<PlantOptions>();
|
||||
|
||||
public UInt32 SystemOpts
|
||||
{
|
||||
get { return _systemopts; }
|
||||
set { if (_systemopts != value) _systemopts = value; }
|
||||
}
|
||||
public string UserName
|
||||
{
|
||||
get { return _username; }
|
||||
set
|
||||
{
|
||||
if (value == null) value = string.Empty;
|
||||
if (_username != value) _username = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool BlockAccessFlag
|
||||
{
|
||||
get { return _blockaccessflag; }
|
||||
set { if (_blockaccessflag != value) _blockaccessflag = value; }
|
||||
}
|
||||
|
||||
public bool PermissionToManageFlag
|
||||
{
|
||||
get { return (_systemopts & VESamOpt.DOCMAINT)==0?false:true; }
|
||||
//set { if (_permissiontomanageflag != value) _permissiontomanageflag = value; }
|
||||
}
|
||||
|
||||
public bool SystemAdminFlag
|
||||
{
|
||||
get { return (_systemopts & VESamOpt.SYSADMIN)==0 ? false:true; }
|
||||
//set { if (_systemadminflag != value) _systemadminflag = value; }
|
||||
}
|
||||
|
||||
public bool PermissionToLockFlag
|
||||
{
|
||||
get { return (_systemopts & VESamOpt.LOCKSYSTEM)==0 ? false:true; }
|
||||
//set { if (_permissiontolockflag != value) _permissiontolockflag = value; }
|
||||
}
|
||||
|
||||
public bool RoEditorFlag
|
||||
{
|
||||
get { return (_systemopts & VESamOpt.ROEDITOR) == 0 ? false : true; }
|
||||
}
|
||||
|
||||
public OldUser(string nm)
|
||||
{
|
||||
_username = nm;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region VESam
|
||||
public class VESamOpt
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
public const long VIEW = 0x00000001L;
|
||||
public const long PRINT = 0x00000002L;
|
||||
public const long PRINTDRAFT = 0x00000004L;
|
||||
public const long PRINTCHANGES = 0x00000008L;
|
||||
public const long EDIT = 0x00000010L;
|
||||
public const long SEARCH = 0x00000020L;
|
||||
public const long STANDARDSTEPS = 0x00000040L;
|
||||
public const long APPROVE = 0x00000080L;
|
||||
public const long APPROVESINGLE = 0x00000100L;
|
||||
public const long LIBRARYDOCS = 0x00000200L;
|
||||
public const long ADDMODDEL = 0x00000400L;
|
||||
public const long CLEAN = 0x00000800L;
|
||||
public const long LOCKPROC = 0x00001000L;
|
||||
public const long LOCKSET = 0x00000001L;
|
||||
public const long UCF = 0x00000002L;
|
||||
public const long LOCKSYSTEM = 0x00000001L;
|
||||
public const long DOCMAINT = 0x00000002L;
|
||||
public const long ROEDITOR = 0x00000004L;
|
||||
public const long SYSADMIN = 0x00000008L;
|
||||
|
||||
public const int SUPERUSER = 1000;
|
||||
public const long SUPERACCESS = 0xFFFFFFFFL;
|
||||
|
||||
private bool _blockAccess;
|
||||
public int userid = -1;
|
||||
public string initials;
|
||||
private const string samoptname = "vesam.opt";
|
||||
public FileStream fs;
|
||||
public BinaryReader bw;
|
||||
public bool isDemoMode = false;
|
||||
List<Plant> plntList = new List<Plant>();
|
||||
List<OldUser> userList = new List<OldUser>();
|
||||
Dictionary<ushort, Plant> plntDic = new Dictionary<ushort, Plant>();
|
||||
|
||||
public bool BlockAccess
|
||||
{
|
||||
get { return _blockAccess; }
|
||||
set { if (_blockAccess != value) _blockAccess = value; }
|
||||
}
|
||||
|
||||
public bool OpenFile(string oname)
|
||||
{
|
||||
try
|
||||
{
|
||||
fs = new FileStream(oname, FileMode.Open, FileAccess.Read, FileShare.Read, 1, false);
|
||||
bw = new BinaryReader(fs);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message, "Security File");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseFile()
|
||||
{
|
||||
bw.Close();
|
||||
fs.Close();
|
||||
bw = null;
|
||||
fs = null;
|
||||
}
|
||||
public Dictionary<ushort, Plant> LoadPlants()
|
||||
{
|
||||
UInt16 ui16;
|
||||
UInt32 ui32;
|
||||
|
||||
try
|
||||
{
|
||||
byte x;
|
||||
|
||||
// read past some header stuff.
|
||||
for (int jj = 0; jj < 8; jj++) x = bw.ReadByte();
|
||||
|
||||
long nxtPl = bw.ReadUInt32();
|
||||
uint nmPlant = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
|
||||
// not needed here, but need to read past this...
|
||||
long nxtUs = bw.ReadUInt32();
|
||||
uint nmUser = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
long nxtGr = bw.ReadUInt32();
|
||||
uint nmGrp = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
|
||||
BlockAccess = bw.ReadUInt16()==0?false:true;
|
||||
|
||||
string pname, ppth;
|
||||
for (int i = 0; i < nmPlant; i++)
|
||||
{
|
||||
if (nxtPl == 0xFFFFFFFEL)
|
||||
{
|
||||
log.Error("Reading in VESAM options file - cannot find next plant in list");
|
||||
break;
|
||||
}
|
||||
fs.Seek(nxtPl, SeekOrigin.Begin);
|
||||
nxtPl = bw.ReadUInt32();
|
||||
|
||||
Plant pl = new Plant();
|
||||
pl.Id = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
|
||||
byte[] stmp = new byte[256];
|
||||
stmp = bw.ReadBytes(ui16);
|
||||
pname = Encoding.ASCII.GetString(stmp, 0, ui16);
|
||||
pl.Name = pname;
|
||||
ui16 = bw.ReadUInt16();
|
||||
stmp = bw.ReadBytes(ui16);
|
||||
ppth = Encoding.ASCII.GetString(stmp, 0, ui16);
|
||||
pl.Path = ppth;
|
||||
|
||||
// read in any sets within this plant.
|
||||
UInt16 nmPrcDr = bw.ReadUInt16();
|
||||
ui32 = bw.ReadUInt32();
|
||||
UInt32 nxtPr = bw.ReadUInt32();
|
||||
|
||||
for (int j = 0; j < nmPrcDr; j++)
|
||||
{
|
||||
ProcSet ps = new ProcSet();
|
||||
ps.Id = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
stmp = bw.ReadBytes(ui16);
|
||||
pname = Encoding.ASCII.GetString(stmp, 0, ui16);
|
||||
ps.Name = pname;
|
||||
ui16 = bw.ReadUInt16();
|
||||
stmp = bw.ReadBytes(ui16);
|
||||
ppth = Encoding.ASCII.GetString(stmp, 0, ui16);
|
||||
ps.Path = ppth;
|
||||
ui32 = bw.ReadUInt32();
|
||||
if (nxtPr == 0xFFFFFFFDL && j + 1 < nmPrcDr)
|
||||
{
|
||||
log.ErrorFormat("Loading vesam.opt - procedure sets for {0}", ps.Name);
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
pl.psDic.Add(ps.Id, ps);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Adding to set dictionary - {0}. Error: {1}" + ps.Path, ex.Message);
|
||||
}
|
||||
if (nxtPr != 0xFFFFFFFDL)
|
||||
{
|
||||
fs.Seek(nxtPr, SeekOrigin.Begin);
|
||||
nxtPr = bw.ReadUInt32();
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
if (!plntDic.ContainsKey(pl.Id))plntDic.Add(pl.Id, pl);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Adding to plant dictionary - {0}. Error: {1}", pl.Path, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Loading plants from vesam.opt: {0}", ex.Message);
|
||||
return null;
|
||||
}
|
||||
return plntDic;
|
||||
}
|
||||
public List<OldUser> LoadUserList()
|
||||
{
|
||||
UInt16 ui16;
|
||||
UInt32 ui32;
|
||||
try
|
||||
{
|
||||
byte x;
|
||||
|
||||
fs.Seek(0, SeekOrigin.Begin);
|
||||
// read past some header stuff.
|
||||
for (int jj = 0; jj < 8; jj++) x = bw.ReadByte();
|
||||
long nxtPl = bw.ReadUInt32();
|
||||
uint nmPlant = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
|
||||
// get info in header for users
|
||||
long nxtUs = bw.ReadUInt32();
|
||||
uint nmUser = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
long nxtGr = bw.ReadUInt32();
|
||||
uint nmGrp = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16();
|
||||
|
||||
bool localblockAccess = bw.ReadUInt16()==0?false:true;
|
||||
// Now read in all of the user information
|
||||
UInt16 uid;
|
||||
string fName, fPass;
|
||||
for (int i = 0; i < nmUser; i++)
|
||||
{
|
||||
if (nxtUs == 0xFFFFFFFCL && i + 1 < nmUser)
|
||||
{
|
||||
log.Error("Loading vesam.opt - reading in user list.");
|
||||
return null;
|
||||
}
|
||||
|
||||
fs.Seek((long)nxtUs, SeekOrigin.Begin);
|
||||
nxtUs = bw.ReadUInt32();
|
||||
uid = bw.ReadUInt16();
|
||||
ui16 = bw.ReadUInt16(); // user's group?
|
||||
|
||||
byte[] test = new byte[10];
|
||||
test = bw.ReadBytes(10);
|
||||
|
||||
// get ve-proms (vesam) username & password
|
||||
fName = Encoding.ASCII.GetString(test, 0, 10);
|
||||
int indx = fName.IndexOf("\0");
|
||||
string fNameTrim = fName.Substring(0, indx);
|
||||
test = bw.ReadBytes(10);
|
||||
fPass = Encoding.ASCII.GetString(test, 0, 10);
|
||||
indx = fPass.IndexOf("\0");
|
||||
string fPassTrim = fPass.Substring(0, indx);
|
||||
OldUser usr = new OldUser(fNameTrim);
|
||||
usr.SystemOpts = bw.ReadUInt32();
|
||||
usr.BlockAccessFlag = localblockAccess;
|
||||
ui32 = bw.ReadUInt32();
|
||||
|
||||
// now get plant & proc set options.
|
||||
nmPlant = bw.ReadUInt16();
|
||||
for (int j = 0; j < nmPlant; j++)
|
||||
{
|
||||
PlantOptions plO = new PlantOptions();
|
||||
plO.Id = bw.ReadUInt16();
|
||||
plO.Options = bw.ReadUInt32();
|
||||
ui32 = bw.ReadUInt32();
|
||||
UInt16 nmPrcDr = bw.ReadUInt16();
|
||||
for (int k = 0; k < nmPrcDr; k++)
|
||||
{
|
||||
ProcOptions prO = new ProcOptions();
|
||||
prO.Id = bw.ReadUInt16();
|
||||
prO.Selected = bw.ReadUInt16();
|
||||
for (int kk = 0; kk < 4; kk++) prO.Options[kk] = bw.ReadUInt32();
|
||||
plO.poList.Add(prO);
|
||||
}
|
||||
usr.PlantOpts.Add(plO);
|
||||
}
|
||||
userList.Add(usr);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error Loading (old) User info from vesam.opt: {0}", ex.Message);
|
||||
return null ;
|
||||
}
|
||||
return userList;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region SecurityMigration
|
||||
public class Security
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
Dictionary<ushort, Plant> plntDic = new Dictionary<ushort, Plant>();
|
||||
List<OldUser> userList = new List<OldUser>();
|
||||
private string _VePromsPath = null;
|
||||
private string optfilename;
|
||||
private string[] prflags ={ "Vfw", "Prnt", "Prnt Drft", "Prnt Chgs", "Edit", "Srch", "St Stp", "App", "App Sel", "Lib", "AMD", "Clean", "Lock" };
|
||||
private string[] sysflags ={ "NetworkLock", "SysMaint", "ROEditor", "SysAdmin" };
|
||||
#region NewMig
|
||||
public Security(string pathname, string vepromspath)
|
||||
{
|
||||
if (File.Exists(pathname) == false)
|
||||
{
|
||||
MessageBox.Show("Could not locate the Security Options file:\n\n" + pathname, "Security Access Error");
|
||||
optfilename = null;
|
||||
return;
|
||||
}
|
||||
_VePromsPath = vepromspath;
|
||||
optfilename = pathname;
|
||||
}
|
||||
public bool Migrate()
|
||||
{
|
||||
VESamOpt vso = new VESamOpt();
|
||||
bool suc = vso.OpenFile(optfilename);
|
||||
if (!suc) return false;
|
||||
plntDic = vso.LoadPlants();
|
||||
if (plntDic == null) return false;
|
||||
suc = VerifyFolders(plntDic);
|
||||
if (!suc) return suc;
|
||||
userList = vso.LoadUserList();
|
||||
if (userList == null) return false;
|
||||
vso.CloseFile();
|
||||
vso = null;
|
||||
log.Info("Original vesam.opt loaded successfully - next step is to migrate security information to new database");
|
||||
//WriteOutSummary(plntDic, userList);
|
||||
suc = TranslateToNew(vso, plntDic, userList);
|
||||
log.Info("Migrated vesam successfully");
|
||||
return suc ;
|
||||
}
|
||||
#endregion
|
||||
#region WriteVESamSummary
|
||||
private void WriteOutSummary(Dictionary<ushort, Plant> plntDic, List<OldUser> userList)
|
||||
{
|
||||
foreach (OldUser usr in userList)
|
||||
{
|
||||
log.InfoFormat("User = {0}", usr.UserName);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if ((usr.SystemOpts & (1L << i)) != 0) sb.Append(sysflags[i] + " ");
|
||||
}
|
||||
if (sb.Length > 0) log.InfoFormat(" System Options = {0}", sb.ToString());
|
||||
|
||||
// for now, don't worry about system options.
|
||||
// for each plant, list any permissions of the plant or its proc sets. If
|
||||
// none set, nothing will be listed.
|
||||
foreach (PlantOptions po in usr.PlantOpts)
|
||||
{
|
||||
bool plntout = false;
|
||||
Plant pl = (Plant)plntDic[po.Id];
|
||||
if (po.Options != 0)
|
||||
{
|
||||
plntout = true;
|
||||
log.InfoFormat(" Plant = {0}. Options = {1}", pl.Name, po.Options);
|
||||
}
|
||||
foreach (ProcOptions psO in po.poList)
|
||||
{
|
||||
ProcSet ps = (ProcSet)pl.psDic[psO.Id];
|
||||
if (psO.Options[0] != 0 || psO.Options[1] != 0 || psO.Options[2] != 0 || psO.Options[3] != 0)
|
||||
{
|
||||
if (!plntout) log.InfoFormat(" Plant = {0}.", pl.Name);
|
||||
log.InfoFormat(" Procedure Set = {0}", ps.Name);
|
||||
sb.Length = 0;
|
||||
int nm = 0;
|
||||
for (int i1 = 0; i1 < 4; i1++)
|
||||
{
|
||||
for (int j1 = 0; j1 < 16; j1++)
|
||||
{
|
||||
if ((psO.Options[i1] & (1L << j1)) != 0) sb.Append(prflags[nm] + " ");
|
||||
nm++;
|
||||
}
|
||||
}
|
||||
if (sb.Length > 0) log.InfoFormat(" {0}", sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region MigrateCode
|
||||
private string[] defaultRole ={ "Administrator", "User Administrator", "RO Manager", "Writer", "Reviewer", "Guest" };
|
||||
private string[] defaultRoleTitle = { "Manages Data - Backups, Approval etc.", "Maintains User Security", "Maintains Referenced Objects", "Can Edit", "Can potentially add comments", "Read-Only access to approved procedures" };
|
||||
// defaultPermData sets the permission data (Permissions table) - columns are
|
||||
// PermLevel, VersionType, PermValue (Note for vesam migration, PermAD is always allow, i.e. 0)
|
||||
private int[,] defaultPermData = {
|
||||
{2, 3, 15}, // Administrator
|
||||
{1, 3, 15}, // User Administrator
|
||||
{3, 3, 15}, // RO Manager
|
||||
{5, 1, 15}, // Writer
|
||||
{7, 3, 15}, // Reviewer
|
||||
{2, 2, 1}}; // Guest
|
||||
|
||||
private int[] accessLevelSetup = { -1, 5, 4, 3, 0, 0, 2, 1 };
|
||||
private int[] accessLevelTrans;
|
||||
|
||||
private Dictionary<int, Role> AddDefaultRoles()
|
||||
{
|
||||
Dictionary<int, Role> rdic = new Dictionary<int, Role>();
|
||||
try
|
||||
{
|
||||
accessLevelTrans = new int[accessLevelSetup.Length];
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Role role = Role.New();
|
||||
role.Name = defaultRole[i];
|
||||
role.Title = defaultRoleTitle[i];
|
||||
if (!role.IsSavable) ErrorRpt.ErrorReport(role);
|
||||
role.Save();
|
||||
Permission perm = Permission.New();
|
||||
perm.MyRole = role;
|
||||
perm.PermLevel = defaultPermData[i, 0];
|
||||
perm.VersionType = defaultPermData[i, 1];
|
||||
perm.PermValue = defaultPermData[i, 2];
|
||||
if (!perm.IsSavable) ErrorRpt.ErrorReport(perm);
|
||||
perm.Save();
|
||||
rdic.Add(role.RID, role);
|
||||
for (int j = 1; j < accessLevelSetup.Length; j++)
|
||||
{
|
||||
if (accessLevelSetup[j] == i) accessLevelTrans[j] = role.RID;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error setting default roles & permissions: {0}", ex.Message);
|
||||
return null;
|
||||
}
|
||||
return rdic;
|
||||
}
|
||||
|
||||
public bool VerifyFolders(Dictionary<ushort, Plant> dicPlants)
|
||||
{
|
||||
try
|
||||
{
|
||||
// For each folder from vesam, see if there is a matching folder already
|
||||
// migrated...
|
||||
|
||||
FolderInfoList fil = FolderInfoList.Get();
|
||||
// add the titles to a dictionary for quick checking
|
||||
List<string> folderlist = new List<string>();
|
||||
foreach (FolderInfo fi in fil)
|
||||
{
|
||||
folderlist.Add(fi.Title.ToUpper());
|
||||
}
|
||||
|
||||
foreach (ushort u in dicPlants.Keys)
|
||||
{
|
||||
Plant pl = dicPlants[u];
|
||||
bool foundplant = false;
|
||||
if (folderlist.Contains(pl.Path.ToUpper())) foundplant=true;
|
||||
|
||||
if (!foundplant)
|
||||
log.InfoFormat("Plant from vesam.opt not found in folder data: {0}", pl.Path);
|
||||
else // if found, check for sets
|
||||
{
|
||||
foreach (ushort uu in pl.psDic.Keys)
|
||||
{
|
||||
ProcSet pr = pl.psDic[uu];
|
||||
bool foundprocset = false;
|
||||
foreach (FolderInfo fi in fil)
|
||||
{
|
||||
string tstpath = pl.Path.ToUpper() + "\\" + pr.Path.ToUpper();
|
||||
if (tstpath == fi.Title.ToUpper())
|
||||
{
|
||||
foundprocset = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!foundprocset) log.InfoFormat("Procedure Set from vesam.opt not found in folder data: {0}\\{1}", pl.Path, pr.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("error mapping vesam directories to data directories, error = {0}", ex.Message);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private Dictionary<string, int> LoadFolders()
|
||||
{
|
||||
FolderInfoList fldlist = FolderInfoList.Get();
|
||||
Dictionary<string, int> fdic = new Dictionary<string, int>();
|
||||
foreach (FolderInfo fi in fldlist)
|
||||
{
|
||||
fdic.Add(fi.Title.ToUpper(), fi.FolderID);
|
||||
}
|
||||
return fdic;
|
||||
}
|
||||
|
||||
private bool TranslateToNew(VESamOpt vso, Dictionary<ushort, Plant> plntDic, List<OldUser> userList)
|
||||
{
|
||||
Dictionary<int, Role> rlpdic = AddDefaultRoles();
|
||||
AddUsrGrpAsgnRecs(plntDic, userList);
|
||||
return true;
|
||||
}
|
||||
private string VersionName(string s)
|
||||
{
|
||||
return s.Substring(s.LastIndexOf(" - ") + 3);
|
||||
}
|
||||
private string SetName(string s)
|
||||
{
|
||||
return s.Substring(0, s.LastIndexOf(" - "));
|
||||
}
|
||||
private string FixName(string s)
|
||||
{
|
||||
s = s.Replace(" - Working Draft (Unit 1)", " (Unit 1) - Working Draft");
|
||||
s = s.Replace(" - Working Draft (Unit 2)", " (Unit 2) - Working Draft");
|
||||
s = s.Replace(" - Current Approved Version", " - Approved Version");
|
||||
return s.Replace(" - Working Draft", " - Working Draft");
|
||||
}
|
||||
private int CalcAccessLevel(int iBase, uint options, string sVersion)
|
||||
{
|
||||
if (sVersion == "Working Draft")
|
||||
{
|
||||
if (options == 0) return 0;
|
||||
if ((options & 6528) != 0) return 5;
|
||||
if ((options & 1024) != 0) return 4;
|
||||
if ((options & 528) != 0) return 3;
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iBase != 0) return iBase;
|
||||
else if (options != 0) return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
private string SystemOption(uint options)
|
||||
{
|
||||
if ((options & 11) != 0) return "\"Admin\"";
|
||||
if (options == 4) return "\"RO\"";
|
||||
return "";
|
||||
}
|
||||
private void AddAccessRights(Dictionary<int, List<int>> dic, int folderId, int roleId)
|
||||
{
|
||||
if (!dic.ContainsKey(folderId)) dic[folderId] = new List<int>();
|
||||
dic[folderId].Add(roleId);
|
||||
}
|
||||
private void AddUsrGrpAsgnRecs(Dictionary<ushort, Plant> plntDic, List<OldUser> userList)
|
||||
{
|
||||
Dictionary<string, List<string>> dicGroups = new Dictionary<string, List<string>>();
|
||||
Dictionary<string, int> dicGroupIds = new Dictionary<string, int>();
|
||||
Dictionary<string, int> dicOldFolders = new Dictionary<string, int>();
|
||||
int oldFolderCount = 1;
|
||||
dicOldFolders.Add("system", oldFolderCount++);
|
||||
Dictionary<string, int> dicNewFolders = LoadFolders();
|
||||
List<string> lstVersions = new List<string>();
|
||||
StringBuilder sb;
|
||||
OldUser frst = userList[0];
|
||||
|
||||
string[] accessLevel = { "", "\"Guest\"", "\"Reviewer\"", "\"Writer\"", "\"Admin\"", "\"Admin\"" };
|
||||
foreach (OldUser usr in userList)
|
||||
{
|
||||
int sysAccess = 5;
|
||||
Dictionary<PlantOptions, int> plantAccess = new Dictionary<PlantOptions, int>();
|
||||
|
||||
if ((usr.SystemOpts & 11) == 0)
|
||||
{
|
||||
foreach (PlantOptions po in usr.PlantOpts)
|
||||
{
|
||||
plantAccess[po] = 5;
|
||||
Plant pl = (Plant)plntDic[po.Id];
|
||||
if (!dicOldFolders.ContainsKey(pl.Path.ToUpper()))dicOldFolders.Add(pl.Path.ToUpper(), oldFolderCount++);
|
||||
string sSetLast = "";
|
||||
int iAccessLevel = 0;
|
||||
|
||||
foreach (ProcOptions psO in po.poList)
|
||||
{
|
||||
ProcSet ps = null;
|
||||
try
|
||||
{
|
||||
ps = (ProcSet)pl.psDic[psO.Id];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("here: " + ex.Message);
|
||||
}
|
||||
if (!dicOldFolders.ContainsKey(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper()))dicOldFolders.Add(pl.Path.ToUpper()+"\\"+ps.Path.ToUpper(), oldFolderCount++);
|
||||
string sName = FixName(ps.Name);
|
||||
string sVersion = VersionName(sName);
|
||||
string sSet = SetName(sName);
|
||||
if (sSet != sSetLast)
|
||||
{
|
||||
if (sSetLast != "")
|
||||
{
|
||||
// if the proc access is lower than the plant, reset plant level.
|
||||
if (iAccessLevel < plantAccess[po]) plantAccess[po] = iAccessLevel;
|
||||
iAccessLevel = 0;
|
||||
}
|
||||
sSetLast = sSet;
|
||||
}
|
||||
iAccessLevel = CalcAccessLevel(iAccessLevel, psO.Options[0], sVersion);
|
||||
}
|
||||
// do one last check to see if plant level should be lowered. Also
|
||||
// check if the system level should be lowered.
|
||||
if (iAccessLevel < plantAccess[po]) plantAccess[po] = iAccessLevel;
|
||||
if (plantAccess[po] < sysAccess) sysAccess = plantAccess[po];
|
||||
}
|
||||
}
|
||||
|
||||
// set the system level access, i.e. User Admin, System Admin & RO Editor roles if
|
||||
// necessary.
|
||||
int systemid = dicOldFolders["system"];
|
||||
|
||||
Dictionary<int, List<int>> accessRights = new Dictionary<int, List<int>>();
|
||||
if (usr.SystemOpts != 0) AddAccessRights(accessRights, systemid, accessLevelTrans[6]); // add ro editor
|
||||
if ((usr.SystemOpts & 11) != 0)
|
||||
{
|
||||
AddAccessRights(accessRights, systemid, accessLevelTrans[5]); // add sys admin rights
|
||||
AddAccessRights(accessRights, systemid, accessLevelTrans[7]); // and add user admin rights
|
||||
}
|
||||
else
|
||||
{
|
||||
// the user has a role at the system level that is not an admin,
|
||||
// such as reviewer or guest - add it in.
|
||||
if (sysAccess > 0) AddAccessRights(accessRights, systemid, accessLevelTrans[sysAccess]);
|
||||
}
|
||||
|
||||
sb = new StringBuilder(string.Format("{0},{1}", (usr.SystemOpts == 0 ? "" : "Admin"), accessLevel[sysAccess]));
|
||||
|
||||
if ((usr.SystemOpts & 11) == 0)
|
||||
{
|
||||
foreach (PlantOptions po in usr.PlantOpts)
|
||||
{
|
||||
Plant pl = plntDic[po.Id];
|
||||
// Need logic for po.Options in combination with PlantAccess[po]
|
||||
//sb.Append(string.Format(",{0}", po.Options));
|
||||
|
||||
if (plantAccess[po] > sysAccess)
|
||||
{
|
||||
AddAccessRights(accessRights, dicOldFolders[pl.Path.ToUpper()], accessLevelTrans[plantAccess[po]]);
|
||||
sb.Append(string.Format(",{0}", accessLevel[plantAccess[po]]));
|
||||
}
|
||||
else
|
||||
sb.Append(",");
|
||||
string sSetLast = "";
|
||||
string sPathLast = "";
|
||||
int iAccessLevel = 0;
|
||||
string sPath = "";
|
||||
foreach (ProcOptions psO in po.poList)
|
||||
{
|
||||
ProcSet ps = pl.psDic[psO.Id];
|
||||
string sName = FixName(ps.Name);
|
||||
string sVersion = VersionName(sName);
|
||||
if (sVersion == "Working Draft") sPath = pl.Path + "\\" + ps.Path;
|
||||
string sSet = SetName(sName);
|
||||
|
||||
if (sSet != sSetLast)
|
||||
{
|
||||
if (sSetLast != "")
|
||||
{
|
||||
if (iAccessLevel > plantAccess[po])
|
||||
{
|
||||
AddAccessRights(accessRights, dicOldFolders[sPathLast.ToUpper()], accessLevelTrans[iAccessLevel]);
|
||||
sb.Append(string.Format(",{0}", accessLevel[iAccessLevel]));
|
||||
}
|
||||
else
|
||||
sb.Append(",");
|
||||
iAccessLevel = 0;
|
||||
}
|
||||
sSetLast = sSet;
|
||||
sPathLast = sPath;
|
||||
}
|
||||
iAccessLevel = CalcAccessLevel(iAccessLevel, psO.Options[0], sVersion);
|
||||
}
|
||||
|
||||
if (iAccessLevel > plantAccess[po])
|
||||
{
|
||||
AddAccessRights(accessRights, dicOldFolders[sPathLast.ToUpper()], accessLevelTrans[iAccessLevel]);
|
||||
sb.Append(string.Format(",{0}", accessLevel[iAccessLevel]));
|
||||
}
|
||||
else
|
||||
sb.Append(",");
|
||||
}
|
||||
}
|
||||
string s = sb.ToString();
|
||||
|
||||
if (!dicGroups.ContainsKey(s))
|
||||
{
|
||||
dicGroups[s] = new List<string>();
|
||||
Group grp = Group.New();
|
||||
grp.GroupName = "Group " + dicGroups.Count.ToString();
|
||||
int pathInData = -1;
|
||||
foreach (int folderId in accessRights.Keys)
|
||||
{
|
||||
// see if this folderId exists in the data (rather
|
||||
// than the list from vesam). If not, don't do an
|
||||
// assignments record
|
||||
pathInData = 0;
|
||||
foreach (KeyValuePair<string, int> kvp in dicOldFolders)
|
||||
{
|
||||
if (kvp.Value == folderId)
|
||||
{
|
||||
string path = kvp.Key;
|
||||
if (dicNewFolders.ContainsKey(path.ToUpper()))
|
||||
pathInData = dicNewFolders[path.ToUpper()];
|
||||
}
|
||||
}
|
||||
if (pathInData>0)
|
||||
{
|
||||
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||
grp.Save();
|
||||
Folder tmpfld = Folder.Get(pathInData);
|
||||
foreach (int roleId in accessRights[folderId])
|
||||
{
|
||||
Role tmprole = Role.Get(roleId);
|
||||
grp.GroupAssignments.Add(tmprole, tmpfld);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!grp.IsSavable) ErrorRpt.ErrorReport(grp);
|
||||
grp.Save();
|
||||
dicGroupIds[s] = grp.GID;
|
||||
}
|
||||
dicGroups[s].Add(usr.UserName);
|
||||
}
|
||||
|
||||
foreach (string s in dicGroups.Keys)
|
||||
{
|
||||
foreach (string sUser in dicGroups[s])
|
||||
{
|
||||
// add user record & membership record.
|
||||
User newusr = User.New();
|
||||
newusr.UserID = sUser;
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
cfg.LoadUsrCfg(newusr, _VePromsPath);
|
||||
Group tmpgrp = Group.Get(dicGroupIds[s]);
|
||||
newusr.UserMemberships.Add(tmpgrp);
|
||||
if (!newusr.IsSavable) ErrorRpt.ErrorReport(newusr);
|
||||
newusr.Save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -1,851 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
const int E2 = 4194304;
|
||||
private Dictionary<string, int> dicOldToNew;
|
||||
private Item AddSection(Item procitem, string Number, string Title, string SecType, DateTime Dts, string Userid, ConfigInfo ci, string stpseq, string fmt, int libdocid, string pth, Item FromItem, FormatInfo activeFormat)
|
||||
{
|
||||
string missingFileName = "";
|
||||
bool missingDocFile = false;
|
||||
//Console.WriteLine("before UpdateLabels");
|
||||
frmMain.UpdateLabels(0, 1, 0);
|
||||
//Console.WriteLine("after UpdateLabels");
|
||||
try
|
||||
{
|
||||
//Console.WriteLine("before activeFormat");
|
||||
FormatInfo format = activeFormat;
|
||||
//Console.WriteLine("after activeFormat");
|
||||
|
||||
// Tie the section to format used, this will add the format xml if it doesn't exist in
|
||||
// the database yet. Note that if there is no format at this level then none should
|
||||
// be set so that the inheritance works correctly.
|
||||
if (fmt != null && fmt != "") format = GetFormat(fmt);
|
||||
|
||||
// Find the docstyle based on the section type (step[1]) & the 'type' from the dbf
|
||||
// record sectype[0])
|
||||
string dstyleindx = ((stpseq == null || stpseq == "") ? " " : stpseq.Substring(1, 1)) + ((SecType==null||SecType == "") ? " " : SecType.Substring(0, 1));
|
||||
int tmpE2 = LookupOldToNew(dstyleindx);
|
||||
//int docstyleindx = GetDocStyleIndx(dstyleindx, format, procitem, docver,Number,Title);
|
||||
int docstyleindx = GetDocStyleIndx(dstyleindx, format, procitem, Number, Title);
|
||||
DocStyle myDocStyle = format.PlantFormat.DocStyles.DocStyleList[docstyleindx];
|
||||
|
||||
// Originally there was no determination as to whether to set landscape mode. Code was added on
|
||||
// 6/11/13 to compare the PageWidth & PageLength. This code was incorrectly setting some of the
|
||||
// word documents to landscape (FNP cover pages). Adding in the topmargin fixed this.
|
||||
bool isLandscape = myDocStyle.Layout.PageWidth > (myDocStyle.Layout.TopMargin + myDocStyle.Layout.PageLength);
|
||||
// Adjust the section number. The 16bit vfw code was sometimes printing section numbers
|
||||
// differently than what was stored as data. For example VEWCNOFN: OFN MA-001, the section
|
||||
// number was '1.' and 16bit printed it as '1.0'. The flag that caused this was (surprisingly),
|
||||
// !LineAboveUnderSection, search for LineAboveUnderSection in PROMSNT\exe\print\prntStep.c
|
||||
// to find the beginning point of tracing this 16bit logic, the call to PlaceSectionTitle.
|
||||
// The change in section number is:
|
||||
// 1 -> 1. B -> B.
|
||||
// 1. -> 1.0 B. -> B.0
|
||||
// 1.0 stays same B.0 stays the same
|
||||
// It was decided to make the string change in the dataloader rather than have this 'strange'
|
||||
// code/support in the print program for the 32bit veproms. (8/30/11). This seems to work
|
||||
// for Wcnemg, WcnOFn, HLP, FPL. As other plants are migrated, this may need changed.
|
||||
|
||||
/* The 16bit code if statement is (see below for what parts of this if statement where supported
|
||||
* for data migration so far (as of 8/31/11). Note that 'Smartsubsection' only had values of
|
||||
* 0 in fmtfiles.
|
||||
* if (!CancelCurSecTitle() &&
|
||||
!(SpecialStepsFoldout && (CurDoc->oldtonew == E2)) &&
|
||||
!(SmartSubSection && (CurDoc->oldtonew & SmartSubSection) &&
|
||||
Section[CurrentSectIndex].Level == 0) &&
|
||||
Section[CurrentSectIndex].Sequence[9] != 'N') {
|
||||
*/
|
||||
FormatData fmtData = format.PlantFormat.FormatData;
|
||||
// don't want to add the '0' after . for section numbers for Catawba or McGuire
|
||||
bool isCatawbaOrMcGuire = false;
|
||||
if (fmtData.Name.ToUpper().Contains("CAT") || fmtData.Name.ToUpper().Contains("MCG")) isCatawbaOrMcGuire = true;
|
||||
if (!isCatawbaOrMcGuire &&
|
||||
fmtData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles &&
|
||||
!format.PlantFormat.DocStyles.DocStyleList[docstyleindx].CancelSectTitle &&
|
||||
!(format.PlantFormat.DocStyles.DocStyleList[docstyleindx].SpecialStepsFoldout && tmpE2 == E2))
|
||||
{
|
||||
if (!fmtData.SectData.StepSectionData.StepSectionLayoutData.LineAboveUnderSection &&
|
||||
(Number != null && Number != "") &&
|
||||
(stpseq != null && stpseq.Substring(1, 1) == "0" && stpseq.Substring(5, 1) != " "))
|
||||
{
|
||||
if (Number.EndsWith(".")) Number = Number + "0";
|
||||
else if (Number.Length>1 && Number[Number.Length-2] != '.') Number = Number + ".";
|
||||
}
|
||||
}
|
||||
|
||||
// tack on the column mode - add to config xml for node.
|
||||
if (stpseq != null && stpseq.Substring(1, 1) == "0" && stpseq.Substring(5, 1) != " ")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
char cmchar = stpseq.Substring(5, 1)[0];
|
||||
if (cmchar > '2' || cmchar < '1')
|
||||
ci.AddItem("Section", "ColumnMode", "1");
|
||||
else
|
||||
ci.AddItem("Section", "ColumnMode", stpseq.Substring(5, 1));
|
||||
}
|
||||
|
||||
// find rtf file (or use the library document temp file) & read it into the field
|
||||
// acccontent
|
||||
int Documentid=0;
|
||||
bool needEntry = false;
|
||||
if ((format.PlantFormat.DocStyles.DocStyleList[docstyleindx].StructureStyle.Style & E_DocStructStyle.TableOfContents) == E_DocStructStyle.TableOfContents &&
|
||||
(format.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoTableOfContents) == E_PurchaseOptions.AutoTableOfContents)
|
||||
needEntry = false;
|
||||
else if (libdocid != 0 || stpseq.Substring(1, 1) != "0")
|
||||
{
|
||||
needEntry = true;
|
||||
string fname = null;
|
||||
if (libdocid != 0)
|
||||
{
|
||||
Documentid = libdocid;
|
||||
if (Title.Trim().ToUpper() == "<NO TITLE>")
|
||||
{
|
||||
using (DocumentInfo di = DocumentInfo.Get(libdocid))
|
||||
Title = di.LibTitle;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = Convert.ToInt32(stpseq[0]) - 64;
|
||||
char prefix = 'A';
|
||||
prefix += (char)(num / 100);
|
||||
int numpart = num % 100;
|
||||
//string thenum = num.ToString("d2");
|
||||
fname = string.Format("{0}\\rtffiles\\{1}.{2}{3:D02}", pth, ProcFileName, prefix, numpart);
|
||||
Application.DoEvents();
|
||||
string procnum = "";
|
||||
using (ItemInfo ii = ItemInfo.Get(procitem.ItemID))
|
||||
procnum = ii.DisplayNumber;
|
||||
SaveSectionDocument(fname, stpseq, SecType, ref Documentid, procnum + ":" + (Number == string.Empty ? Title : Number), isLandscape);
|
||||
if (Documentid == 0)
|
||||
{
|
||||
if (MissingDocument == null)
|
||||
{
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
//ci.AddItem("Printing", "Length", string.Format("{0:0.0000}", 0.001));
|
||||
Byte[] tstbyte = System.Text.Encoding.Default.GetBytes("");
|
||||
MissingDocument = Document.MakeDocument("MISSING FILE IN CONVERSION", tstbyte, null, null,".doc");
|
||||
}
|
||||
Documentid = MissingDocument.DocID;
|
||||
missingDocFile = true;
|
||||
missingFileName = string.Format("{0}.{1}{2:D02}",ProcFileName, prefix, numpart);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Userid == null || Userid == "") Userid = "Migration";
|
||||
|
||||
// test for performance
|
||||
Content cont;
|
||||
Format fmt2 = format == null ? null : format.GetJustFormat();
|
||||
cont = Content.New(Number, Title, 10000+docstyleindx, fmt2, ci==null?null:ci.ToString(), Dts, Userid);
|
||||
if (needEntry)
|
||||
{
|
||||
Entry entry = cont.MyEntry;
|
||||
entry.MyDocument = Document.Get(Documentid);
|
||||
entry.DTS = Dts;
|
||||
entry.UserID = Userid;
|
||||
}
|
||||
cont.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq.TrimEnd(" ".ToCharArray());
|
||||
Item itm = null;
|
||||
// the stpseq for section records may include a space & some other data. This
|
||||
// was not part of what is stored in the transition records, so just look at
|
||||
// the sequence before the space for section records. Then use the first character
|
||||
// with a '0'. This is what's stored in the transition record, for example, if the
|
||||
// section was BI, the transition record would have B0 (the reasoning is that
|
||||
// for steps, this is what could be stored if there were enough steps.
|
||||
int trindxsp = stpseq.IndexOf(' ');
|
||||
string trstpseq = trindxsp < 0 ? stpseq : stpseq.Substring(0, 1)+ "0";
|
||||
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + trstpseq))
|
||||
{
|
||||
itm = dicTrans_ItemIds[ProcNumber + "|" + trstpseq];
|
||||
itm.MyContent = cont;
|
||||
itm.MyPrevious = FromItem;
|
||||
itm.DTS = Dts;
|
||||
itm.UserID = Userid;
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
dicTrans_ItemIds.Remove(ProcNumber + "|" + trstpseq);
|
||||
dicTrans_MigrationErrors.Remove(ProcNumber + "|" + trstpseq);
|
||||
}
|
||||
else
|
||||
itm = Item.MakeItem(FromItem, cont, Dts, Userid);
|
||||
|
||||
// Check this section type versus the docstyleindex, i.e. that the docstyle was not of
|
||||
// the same type of section as the data. For example, rgesmped.in has only 1 doc style
|
||||
// and it WAS both step & doc when the section was added as a word doc, but the current
|
||||
// rgesmped.in only supports step sections. The result was that there is Word content but
|
||||
// a step docstyle.
|
||||
//
|
||||
// Identify this problem by putting out an error message & adding an annotation. The data
|
||||
// will have to be fixed manually, i.e. go into sql server & change the format and Type to
|
||||
// use a word section type.
|
||||
if (needEntry && format.PlantFormat.DocStyles.DocStyleList[docstyleindx].IsStepSection)
|
||||
{
|
||||
frmMain.AddError("Conflicting section type (Word Section: {0}) & Document Style (Step Section type: {1})",
|
||||
ProcNumber + ":" + Number + ":" + Title, format.PlantFormat.DocStyles.DocStyleList[docstyleindx].Name);
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = "Conflicting Section Type and Document Style";
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
if (missingDocFile)
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = string.Format("Missing File: {0} In Conversion",missingFileName);
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
dicTrans_ItemDone[ProcNumber+"|"+trstpseq] = itm;
|
||||
dicOldStepSequence[itm] = stpseq;
|
||||
return itm;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "Save Section");
|
||||
log.Error("Save Section");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private int LookupOldToNew(string lkup)
|
||||
{
|
||||
if (dicOldToNew == null)
|
||||
{
|
||||
dicOldToNew = new Dictionary<string, int>();
|
||||
//dicOldToNew.Add("", 1);
|
||||
dicOldToNew.Add("0", 1);
|
||||
dicOldToNew.Add("0 ", 1);
|
||||
dicOldToNew.Add("00", 1);
|
||||
dicOldToNew.Add("01", 2);
|
||||
dicOldToNew.Add("02", 4);
|
||||
dicOldToNew.Add("03", 8);
|
||||
dicOldToNew.Add("04", 16);
|
||||
dicOldToNew.Add("I", 32);
|
||||
dicOldToNew.Add("I ", 32);
|
||||
dicOldToNew.Add("I0", 32);
|
||||
dicOldToNew.Add("I1", 64);
|
||||
dicOldToNew.Add("I2", 128);
|
||||
dicOldToNew.Add("I3", 256);
|
||||
dicOldToNew.Add("I4", 512);
|
||||
dicOldToNew.Add("A", 1024);
|
||||
dicOldToNew.Add("A ", 1024);
|
||||
dicOldToNew.Add("A0", 1024);
|
||||
dicOldToNew.Add("A1", 2048);
|
||||
dicOldToNew.Add("A2", 4096);
|
||||
dicOldToNew.Add("A3", 8192);
|
||||
dicOldToNew.Add("A4", 16384);
|
||||
dicOldToNew.Add("F", 32768);
|
||||
dicOldToNew.Add("F ", 32768);
|
||||
dicOldToNew.Add("F0", 32768);
|
||||
dicOldToNew.Add("F1", 65536);
|
||||
dicOldToNew.Add("F2", 131072);
|
||||
dicOldToNew.Add("F3", 262144);
|
||||
dicOldToNew.Add("F4", 524288);
|
||||
dicOldToNew.Add("05", 1048576);
|
||||
dicOldToNew.Add("06", 2097152);
|
||||
dicOldToNew.Add("07", 4194304);
|
||||
dicOldToNew.Add("08", 8388608);
|
||||
dicOldToNew.Add("09", 16777216);
|
||||
dicOldToNew.Add("0:", 33554432);
|
||||
dicOldToNew.Add("0;", 67108864);
|
||||
dicOldToNew.Add("0<", 134217728);
|
||||
dicOldToNew.Add("0=", 268435456);
|
||||
dicOldToNew.Add("0>", 536870912);
|
||||
}
|
||||
int retval = -1;
|
||||
try
|
||||
{
|
||||
retval = dicOldToNew[lkup];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "OldToNew {0}", lkup);
|
||||
Console.WriteLine(string.Format("Error in oldtonew {0}", lkup));
|
||||
Console.WriteLine(string.Format("Error = {0}", ex.Message));
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private int GetDocStyleIndx(string dstyleindx, FormatInfo format, Item procitem, /* DocVersion docver,*/ string Number, string Title)
|
||||
{
|
||||
int docstyle = LookupOldToNew(dstyleindx);
|
||||
DocStyle ds0 = null;
|
||||
foreach (DocStyle ds in format.PlantFormat.DocStyles.DocStyleList)
|
||||
{
|
||||
if (ds.Index == 0) ds0 = ds;
|
||||
if ((ds.OldToNew & docstyle) > 0)
|
||||
{
|
||||
//frmMain.AddError("--->>>\"Good\"\t\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"\t\"{4}\"\t\"{5}\"",
|
||||
// procitem.DisplayNumber, (Number ?? "") == "" ? Title : Number, dstyleindx, format, docstyle, ds.Name);
|
||||
return (int)ds.Index;
|
||||
}
|
||||
}
|
||||
frmMain.AddError("Bad OldToNew Document Style {0}:{1} dStyleIndex = '{2}'\r\n{3} - Missing OldToNew {4}",
|
||||
procitem.DisplayNumber, (Number ?? "") == "" ? Title : Number, dstyleindx, format, docstyle);
|
||||
//frmMain.AddError("--->>>\"Bad\"\t\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"\t\"{4}\"\t\"{5}\"",
|
||||
// procitem.DisplayNumber, (Number ?? "") == "" ? Title : Number, dstyleindx, format, docstyle, ds0.Name);
|
||||
return 0; // Default is Zero
|
||||
}
|
||||
//private FormatInfo GetFormat(Item procitem, DocVersion docver)
|
||||
//{
|
||||
// return procitem.MyItemInfo.ActiveFormat;
|
||||
// //while (procitem.MyItemInfo.a .MyContent.MyFormat == null)
|
||||
// //{
|
||||
// // // find the first sibling
|
||||
// // while (procitem.PreviousID != null)
|
||||
// // procitem = procitem.MyPrevious;
|
||||
// // if (procitem.ItemPartCount == 0) return docver.MyDocVersionInfo.ActiveFormat;
|
||||
// // // find the parent node
|
||||
// // procitem = procitem.ItemParts[0].MyContent.ContentItems[0].MyItem;
|
||||
// //}
|
||||
// //return procitem.MyContent.MyFormat;
|
||||
//}
|
||||
//private FormatInfo GetFormat(DocVersion docver)
|
||||
//{
|
||||
// if (docver.MyDocVersionInfo.MyFormat != null) return docver.MyDocVersionInfo.MyFormat;
|
||||
// return GetFormat(docver.MyDocVersionInfo.MyFolder);
|
||||
//}
|
||||
//private FormatInfo GetFormat(FolderInfo folder)
|
||||
//{
|
||||
// if (folder.MyFormat != null) return folder.MyFolderInfo.MyFormat;
|
||||
// return GetFormat(folder.MyParent);
|
||||
//}
|
||||
private string SectTitle(OleDbConnection cn, DataRowView dr, bool UseMultiLineSectionTitle, bool ConvertCaret)
|
||||
{
|
||||
string tbuff = null;
|
||||
string menustr = null;
|
||||
|
||||
if (UseMultiLineSectionTitle)
|
||||
{
|
||||
bool titleInMemo = false;
|
||||
// for accessory pages...
|
||||
if (dr["Step"].ToString().Substring(1, 1) != "0")
|
||||
{
|
||||
// The long section title is stored on a record with the "~" character.
|
||||
// This was done since originally the actual accessory page data was stored in the memo
|
||||
// field, so the long title could not be stored there, another record had to be used.
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("select * from " + ProcFileName + " where [Step] = '" + dr["Step"].ToString().Substring(0, 1) + "~';", cn);
|
||||
DataSet ds = new DataSet();
|
||||
try
|
||||
{
|
||||
da.Fill(ds);
|
||||
if (ds.Tables[0].Rows.Count == 1)
|
||||
{
|
||||
DataRow row = ds.Tables[0].Rows[0];
|
||||
tbuff = TextConvert.ConvertText(row["Textm"].ToString(),ConvertCaret);
|
||||
if (tbuff != null && tbuff != "") titleInMemo = true;
|
||||
}
|
||||
else // no long section title existed for this accessory page
|
||||
tbuff = TextConvert.ConvertText(dr["Text"].ToString().PadRight(130, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, string.Format("Error getting long section title, procedure: {0}",ProcFileName));
|
||||
log.ErrorFormat("Error getting long section title, procedure: {0}, error: {1}", ProcFileName,ex.Message);
|
||||
}
|
||||
da.Dispose();
|
||||
}
|
||||
// For step sections, the long section title is stored on the section record
|
||||
// (see above comment for accessory pages to see the difference)
|
||||
else
|
||||
{
|
||||
string t = dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd();
|
||||
string tm = dr["TextM"].ToString().Trim();
|
||||
string secttitle = tm == null || tm == "" ? t : tm;
|
||||
tbuff = TextConvert.ConvertText(secttitle, ConvertCaret);
|
||||
}
|
||||
|
||||
//// TESTS were run & it looked like that whitespace was removed before saving,
|
||||
//// so, put up a message box if find out otherwise....
|
||||
//int nl = tbuff.IndexOf("\n");
|
||||
//if (nl > -1)
|
||||
// MessageBox.Show("multiline text for section title, fix this!!");
|
||||
|
||||
//// remove newlines & any other escape/whitespace chars.
|
||||
int nl = tbuff.IndexOf("\n");
|
||||
if (nl > -1 || titleInMemo)
|
||||
{
|
||||
|
||||
string tmpstr = tbuff.Replace("\r", "");
|
||||
tmpstr = tmpstr.Replace("\t", "");
|
||||
tmpstr = tmpstr.Replace("\n", " ");
|
||||
// get rid of multiple spaces
|
||||
while (tmpstr.IndexOf(" ") > -1) tmpstr = tmpstr.Replace(" ", " ");
|
||||
tbuff = tmpstr;
|
||||
if (tbuff.Substring(tbuff.Length - 1, 1) == " ") tbuff = tbuff.Substring(0, tbuff.Length - 1);
|
||||
menustr = tbuff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tbuff==null||tbuff=="") menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
else menustr = tbuff;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // format does not include long section title
|
||||
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
}
|
||||
return menustr;
|
||||
}
|
||||
private static Color _OverrideColor = Color.Red;
|
||||
|
||||
public static Color OverrideColor
|
||||
{
|
||||
get { return Loader._OverrideColor; }
|
||||
set { Loader._OverrideColor = value; }
|
||||
}
|
||||
private bool hasFloatingFoldouts = false;
|
||||
private Dictionary<string, int> FoldoutStpSeq = null;
|
||||
private List<int> FloatingFoldoutHLS = null;
|
||||
private Item MigrateSection(Item procitem, string procnum, OleDbConnection cn, DataRowView dr, DataTable dt, Item FromItem, bool hasSubSection, string pth, DocVersion docver, FormatInfo activeFormat,Content cont)
|
||||
{
|
||||
Int32 thesectid = 0;
|
||||
bool isautogen = false;
|
||||
string stype = dr["type"].ToString();
|
||||
string s = dr["text"].ToString().PadRight(130, ' ');
|
||||
string rid = dr["recid"].ToString(); // RECID
|
||||
string num = s.Substring(85, 20).TrimEnd();
|
||||
string fmt = s.Substring(75, 8).TrimEnd(); // base format name
|
||||
string ufmt = s.Substring(83, 2).TrimEnd(); // user format number (see TSectEditDlg::SetupWindow() PROMSNT\EXE\WINED\SECTEDIT.CPP)
|
||||
// Build the format name if one was specified for this section.
|
||||
if (fmt == "")
|
||||
fmt = null;
|
||||
else if (ufmt.Length == 2 && char.IsDigit(ufmt[0]) && char.IsDigit(ufmt[1])) // user format reference must be two digits
|
||||
fmt = fmt.PadRight(8,' ') + ufmt; // append the user format reference
|
||||
bool ismulti = false;
|
||||
bool conv_caret = true;
|
||||
|
||||
// sectFormat is a local that represents the format to be used by this section.
|
||||
// Note that if the format is set for this section, check it against what the inherited
|
||||
// value would be (for example, what the format is for the set), if they are the same
|
||||
// clear the format at the section level.
|
||||
FormatInfo sectFormat = null;
|
||||
FormatInfo docverFormat = activeFormat;//docver.MyDocVersionInfo.ActiveFormat;
|
||||
if (fmt != null&& fmt !="") // Is there a long section title (from format flag)
|
||||
sectFormat = GetFormat(fmt);
|
||||
else // either from this format, or the plant.
|
||||
sectFormat = docverFormat;
|
||||
if (sectFormat != null)
|
||||
{
|
||||
ismulti = sectFormat.PlantFormat.FormatData.SectData.StepSectionData.UseMultiLineSectionTitle;
|
||||
conv_caret = sectFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta;
|
||||
hasFloatingFoldouts = sectFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout;
|
||||
}
|
||||
if (fmt != null && fmt != "") if (fmt == docverFormat.Name) fmt = null;
|
||||
string title = SectTitle(cn, dr, ismulti, conv_caret);
|
||||
string init = dr["initials"].ToString().Trim();
|
||||
string sequence = dr["CSequence"].ToString().PadRight(10);
|
||||
string step = dr["CStep"].ToString();
|
||||
|
||||
int libDocid = 0;
|
||||
|
||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
ci.AddItem("History", "RecID", rid);
|
||||
ci.AddItem("History", "ProcName", ProcFileName.ToUpper());
|
||||
if (MultiUnitCount > 0)
|
||||
{
|
||||
string apple = AddApplicability(rid);
|
||||
if(apple != null)
|
||||
ci.AddItem("MasterSlave", "Applicability", apple);
|
||||
}
|
||||
ci.AddItem("Section", "OldType", stype);
|
||||
|
||||
|
||||
// for steps sections...
|
||||
// Step Section Header Format:
|
||||
// A0 1X2S51 &Y
|
||||
// ^^^^^^^^^^^^
|
||||
// |||||||||||||
|
||||
// ||||||||||||`- 'Y','N', or blank signals to print section header - lib/section/addsec.c
|
||||
// |||||||||||`-- (bits) Auto Indent, Editable Data, Checkoff Header Type - lib/section/addsec.c
|
||||
// ||||||||||`--- blank
|
||||
// ||||||||`----- Link With Enhanced Document ' '-Default(not determined) 0-NO 1-YES
|
||||
// |||||||`------ MetaSection - number of subsections is given
|
||||
// ||||||`------- S-Separate(PageBreak); T-Continuous; ' '-Default
|
||||
// |||||`-------- Column mode (1,2,3,' '-default)
|
||||
// ||||`--------- X -only proc section; x -orig. proc; ' ' -other
|
||||
// |||`---------- Position within the procedure
|
||||
// ||`----------- ALWAYS leave blank
|
||||
// |`------------ Step Section Header marker
|
||||
// `------------- Internal section number (starts at A)
|
||||
char cbittst = sequence.PadRight(10)[8];
|
||||
if (cbittst == ' ') cbittst = '\0';
|
||||
if (step.Substring(1, 1) == "0")
|
||||
{
|
||||
// set pagination, continuous, separate. If blank, don't create attribute - uses format default.
|
||||
if (sequence.Substring(2, 1) != " ")
|
||||
{
|
||||
ci.AddItem("Section", "OriginalSteps", "Y");
|
||||
}
|
||||
if (sequence.Substring(4, 1) == "T") // continuous
|
||||
{
|
||||
ci.AddItem("Section", "Pagination", "1");
|
||||
}
|
||||
else if (sequence.Substring(4, 1) == "S") // separate
|
||||
{
|
||||
ci.AddItem("Section", "Pagination", "2");
|
||||
}
|
||||
|
||||
// Step: linked to enhanced (!exist = N)
|
||||
if (sequence.Substring(7, 1) == "1")
|
||||
{
|
||||
ci.AddItem("Step", "LnkEnh", "Y");
|
||||
}
|
||||
// determine if autogenerated section (!exist = N)
|
||||
// Placekeeper (Calvert)
|
||||
if ((cbittst & PLACEKEEPER) > 1)
|
||||
{
|
||||
isautogen = true;
|
||||
//ci.AddItem("Section", "AutoGen", "Y");
|
||||
ci.AddItem("Section", "Placekeeper", "Y");
|
||||
}
|
||||
// Phonelist (Clavert)
|
||||
if ((cbittst & PHONELIST) > 1)
|
||||
ci.AddItem("Section", "Phonelist", "Y");
|
||||
// Here are subsection flags, i.e. the following are only set if this
|
||||
// is a subsection.
|
||||
bool didsub = false;
|
||||
if (hasSubSection)
|
||||
{
|
||||
// Subsection: editable (!exist = N, i.e. default is 'not editable')
|
||||
if ((cbittst & EDDATA) > 0)
|
||||
{
|
||||
ci.AddItem("SubSection", "Edit", "Y");
|
||||
}
|
||||
// Subsection: autoindent (!exist = Y, i.e. default is 'autoindented')
|
||||
if ((cbittst & AUTOIND) > 0)
|
||||
{
|
||||
ci.AddItem("SubSection", "AutoIndent", "N");
|
||||
}
|
||||
}
|
||||
// Section: print section headers (!exist = Y, i.e. default is 'print section header')
|
||||
// Note that this can be on a section or subsection. 16bit code has this for both
|
||||
// levels and it was stored either as a bit set on seq[8] (for subsections, i.e.
|
||||
// this subsection does not have subsections under it) or was a character in seq[9] (Y or N),
|
||||
// i.e. this section has subsections. Make this just one flag now.
|
||||
if (hasSubSection && ((cbittst & PH) == 0))
|
||||
{
|
||||
didsub = true;
|
||||
ci.AddItem("Section", "PrintHdr", "N");
|
||||
}
|
||||
if (!hasSubSection && sequence.Substring(9, 1) == "N")
|
||||
{
|
||||
ci.AddItem("Section", "PrintHdr", "N");
|
||||
}
|
||||
// Save section level Checkoff information
|
||||
int chkOffType = (rid[0] & 0x007F) - '0';
|
||||
if (rid[0] == '\u2591') //for SUM,CAT,MCG with only 2 checkoff options and default checkoff is enabled
|
||||
chkOffType = 1; //this diables checkoffs for this section
|
||||
if (chkOffType > 0)
|
||||
ci.AddItem("Section", "CheckoffSelection", chkOffType.ToString());
|
||||
|
||||
if (stype.Length > 1)
|
||||
{
|
||||
int chkOffHeading = (stype[1] & 0x007F) - '0';
|
||||
if (chkOffHeading > 0)
|
||||
ci.AddItem("Section", "CheckoffHeading", chkOffHeading.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Accessory Section Format:
|
||||
// AI 1 2
|
||||
// ^^ ^ ^
|
||||
// || | |
|
||||
// || | `- # of pages (ASCII value minus 48)
|
||||
// || `--- Position within the procedure
|
||||
// |`----- Acc. page type (A,I, or F)
|
||||
// `------ Internal section number (starts at A)
|
||||
ci.AddItem("Section", "NumPages", sequence.Substring(3, 1));
|
||||
|
||||
// see if it's a libdoc too
|
||||
string mystep = null;
|
||||
try
|
||||
{
|
||||
mystep = dr["Step"].ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("testing - error = {0}", ex.Message);
|
||||
}
|
||||
string thekey = procnum.PadRight(20) + ((mystep!=null)?mystep.Substring(0,1).PadRight(10):step.Substring(0, 1).PadRight(10));
|
||||
if (dicLibDocRef.ContainsKey(thekey))
|
||||
{
|
||||
// if it is a library document, see if the section record has already been
|
||||
// saved. If it has, just use this section id, otherwise, create the
|
||||
// section record with info from the library document file.
|
||||
libDocid = dicLibDocRef[thekey];
|
||||
}
|
||||
}
|
||||
// Both step & word doc sections can be in toc
|
||||
// determine if TOC element (!exist = N)
|
||||
if ((cbittst & TOC) > 1)
|
||||
{
|
||||
ci.AddItem("Section", "TOC", "Y");
|
||||
}
|
||||
//Console.WriteLine("Before AddSection");
|
||||
Item secitem = AddSection(procitem, num, title, stype, dts, init, ci, step + sequence, fmt, libDocid, pth, FromItem, sectFormat);
|
||||
//Console.WriteLine("After AddSection");
|
||||
if (secitem == null)
|
||||
throw (new Exception("Null parameter in AddSection"));
|
||||
if (hasFloatingFoldouts)
|
||||
{
|
||||
if (FoldoutStpSeq == null) FoldoutStpSeq = new Dictionary<string, int>();
|
||||
if (step[1] == 'F') FoldoutStpSeq.Add(step, secitem.ItemID);
|
||||
}
|
||||
if (cont != null)
|
||||
{
|
||||
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
|
||||
AddPartRecursive(cont, 2, secitem);
|
||||
//if (cont.ContentParts.Contains(2))
|
||||
//{
|
||||
// foreach (ContentPart part in cont.ContentParts)
|
||||
// {
|
||||
// if (part.FromType == 2)
|
||||
// {
|
||||
// Item ii = Item.Get(part.ItemID);
|
||||
// ii.MyContent.ContentParts.Add(2, secitem);
|
||||
// ii.Save();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
// cont.ContentParts.Add(2, secitem);
|
||||
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
|
||||
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
|
||||
cont.Save();
|
||||
}
|
||||
thesectid = secitem.ItemID;
|
||||
using (ItemInfo seciteminfo = ItemInfo.Get(thesectid))
|
||||
{
|
||||
if (seciteminfo.MyContent.ContentEntryCount != 0)
|
||||
{
|
||||
using (DocumentInfo di = seciteminfo.MyContent.MyEntry.MyDocument)
|
||||
{
|
||||
bool success = MSWordToPDF.UpdateDocPdf(di, OverrideColor, seciteminfo);
|
||||
if (!success)
|
||||
{
|
||||
frmMain.AddError("Error in ", "UpdateDocPdf");
|
||||
log.Error(string.Format("UpdateDocPdf - Error creating Pdf for Word Doc: {0},{1}", procnum, secitem.MyContent.Number + secitem.MyContent.Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the editsectid hasn't been set yet, set it to this section id, i.e. the first
|
||||
// one processed. Then if this section has the original edit section flag (sequence[2])
|
||||
// save the id. The first step is necessary in case there is no original edit section
|
||||
// flag set, so that the first section is the default one to get opened in edit.
|
||||
if (EditSectId==0)EditSectId = thesectid;
|
||||
if (libDocid<1 && step[1] == '0' && (sequence[2] == 'x' || sequence[2] == 'X'))
|
||||
EditSectId = thesectid;
|
||||
// ContentType (2 in the following call) are:
|
||||
// 0 = structure,
|
||||
// 1 = procedure,
|
||||
// 2 = section,
|
||||
// 3 = step
|
||||
// 4 = branch
|
||||
|
||||
// fromtype values are (see steps.cs too)
|
||||
// 1 = procedure,
|
||||
// 2 = section,
|
||||
// 3 = caution
|
||||
// 4 = note
|
||||
// 5 = RNO
|
||||
// 6 = step
|
||||
// 7 = table
|
||||
isautogen = false; //needed for bge
|
||||
if (!isautogen)
|
||||
{
|
||||
// Process the Data Table - First look for High Level Steps
|
||||
string sQry = string.Format("Step like '[{0}]%' and Sequence='S'", dr["Step"].ToString().Substring(0, 1));
|
||||
DataView dv = new DataView(dt, sQry, "StepNo", DataViewRowState.CurrentRows);
|
||||
Item FrItem = null;
|
||||
frmMain.pbStepMaximum = dt.Rows.Count-frmMain.pbSectMaximum;
|
||||
int type = 6;
|
||||
bool sectionShowed = false;
|
||||
int firstCharSection = (int)(dr["Step"].ToString()[0]);
|
||||
foreach (DataRowView drv in dv)
|
||||
{
|
||||
int firstCharStep = (int)(drv[0].ToString()[0]);
|
||||
if (firstCharSection != firstCharStep)
|
||||
{
|
||||
if(!sectionShowed)
|
||||
Console.WriteLine("'Section','{0}','{1}','{2}',{3}", procnum,num,dr["Step"].ToString(), (int)(dr["Step"].ToString()[0]));
|
||||
sectionShowed = true;
|
||||
Console.WriteLine("'Skipping Step','{0}','{1}','{2}',{3}", procnum,num,drv["Step"].ToString(), (int)(drv["Step"].ToString()[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver, sectFormat, secitem, type);
|
||||
if (hasFloatingFoldouts && (sequence[2] == 'x' || sequence[2] == 'X'))
|
||||
{
|
||||
if (FloatingFoldoutHLS == null) FloatingFoldoutHLS = new List<int>();
|
||||
FloatingFoldoutHLS.Add(FrItem.ItemID);
|
||||
}
|
||||
type = 0; // Only add ContentPart for first child
|
||||
//if (secitem.MyContent.ContentParts.Count == 0)
|
||||
//{
|
||||
// // type 6 is step
|
||||
// secitem.MyContent.ContentParts.Add(6, FrItem);
|
||||
// if (!secitem.MyContent.IsSavable) ErrorRpt.ErrorReport(secitem.MyContent);
|
||||
// secitem.MyContent.Save();
|
||||
//}
|
||||
}
|
||||
}
|
||||
dv.Dispose();
|
||||
}
|
||||
return secitem;
|
||||
}
|
||||
|
||||
private void AddPartRecursive(Content cont, int fromType, Item secitem)
|
||||
{
|
||||
if (cont.ContentParts.Contains(fromType))
|
||||
{
|
||||
foreach (ContentPart part in cont.ContentParts)
|
||||
{
|
||||
if (part.FromType == fromType)
|
||||
{
|
||||
Item ii = Item.Get(part.ItemID);
|
||||
AddPartRecursive(ii.MyContent, fromType, secitem);
|
||||
ii.Save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
cont.ContentParts.Add(fromType, secitem);
|
||||
}
|
||||
private static Dictionary<string, string> ApplesToOranges;
|
||||
private static void ResetApplesToOranges()
|
||||
{
|
||||
ApplesToOranges = new Dictionary<string, string>();
|
||||
}
|
||||
private string AddApplicability(string recnum)
|
||||
{
|
||||
if (!MyProcAPL.ContainsKey(recnum))
|
||||
return null;
|
||||
string apple = MyProcAPL[recnum];
|
||||
return LookupOrange(apple);
|
||||
|
||||
}
|
||||
private string LookupOrange(string apple)
|
||||
{
|
||||
if (!ApplesToOranges.ContainsKey(apple))
|
||||
{
|
||||
ApplesToOranges.Add(apple, AddApplicability1(apple));
|
||||
Console.WriteLine("Apple: '{0}' - Orange: '{1}'", apple, ApplesToOranges[apple]);
|
||||
}
|
||||
return ApplesToOranges[apple];
|
||||
}
|
||||
private string AddApplicability1(string apple)
|
||||
{
|
||||
if (apple == "40000000")
|
||||
return "0";
|
||||
UInt32 mask = 0;
|
||||
foreach (int i in Old2NewApple.Keys)
|
||||
mask |= (uint)(1 << (i - 1));
|
||||
UInt32 val = UInt32.Parse(apple, System.Globalization.NumberStyles.HexNumber);
|
||||
//UInt32 val = UInt32.Parse(apple);
|
||||
if (val == 0)
|
||||
return null;
|
||||
val &= mask;
|
||||
if (val == 0)
|
||||
return "0";
|
||||
if (val == mask)
|
||||
return null;
|
||||
int j = 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string sep = string.Empty;
|
||||
while (val != 0)
|
||||
{
|
||||
if ((val & 1u) == 1u)
|
||||
{
|
||||
sb.Append(sep + Old2NewApple[j].ToString());
|
||||
sep = ",";
|
||||
}
|
||||
j++;
|
||||
val = val >> 1;
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
private void LoadSection(DataSet ds, OleDbDataAdapter da, string FileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
da.Fill(ds, "Sections");
|
||||
DataTable dt = ds.Tables["Sections"];
|
||||
dt.CaseSensitive = true;
|
||||
dt.Columns.Add("CStep", System.Type.GetType("System.String"));
|
||||
dt.Columns.Add("CSequence", System.Type.GetType("System.String"));
|
||||
// set the cstep & csequence - couldn't do it in the add because it needed a sql function
|
||||
foreach (DataRow drw in ds.Tables["Sections"].Rows)
|
||||
{
|
||||
drw["CStep"] = TextConvert.ConvertSeq(drw["Step"].ToString());
|
||||
drw["CSequence"] = TextConvert.ConvertSeq(drw["Sequence"].ToString());
|
||||
}
|
||||
dt.Columns.Add("StepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CStep,2,1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("Level", System.Type.GetType("System.Int32"), "Len(CSequence)");
|
||||
dt.Columns.Add("SubStepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,Len(CSequence),1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("locb", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,2,1),'System.Char'),'System.Int32')-48");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FileInfo fi;
|
||||
switch (ex.Message)
|
||||
{
|
||||
case "Index file not found.":// then delete inf file
|
||||
fi = new FileInfo(frmMain.ProcedureSetPath + "\\" + FileName + ".inf");
|
||||
fi.Delete();
|
||||
LoadSection(ds, da, FileName);// Try Again
|
||||
break;
|
||||
case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
|
||||
fi = new FileInfo(frmMain.ProcedureSetPath + "\\" + FileName + ".dbt");
|
||||
FileStream fs = fi.OpenWrite();
|
||||
fs.Position = fs.Length;
|
||||
byte[] buf = new byte[128];
|
||||
for (int i = 0; i < 128; i++) buf[i] = 0;
|
||||
fs.Write(buf, 0, 128);
|
||||
fs.Close();
|
||||
LoadSection(ds, da, FileName);// Try Again
|
||||
break;
|
||||
default: // Unrecognized error
|
||||
frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName);
|
||||
Console.WriteLine("Unrecognized error: error = {0}", ex.Message);
|
||||
log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,543 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private Dictionary<string, int> dicOldToNew;
|
||||
private Item AddSection(Item procitem, string Number, string Title, string SecType, DateTime Dts, string Userid, ConfigInfo ci, string stpseq, string fmt, int libdocid, string pth, Item FromItem, DocVersion docver)
|
||||
{
|
||||
frmMain.UpdateLabels(0, 1, 0);
|
||||
try
|
||||
{
|
||||
FormatInfo format = null;
|
||||
|
||||
// Tie the section to format used, this will add the format xml if it doesn't exist in
|
||||
// the database yet. Note that if there is no format at this level then none should
|
||||
// be set so that the inheritance works correctly.
|
||||
if (fmt != null && fmt != "") format = GetFormat(fmt);
|
||||
|
||||
// Find the docstyle based on the section type (step[1]) & the 'type' from the dbf
|
||||
// record sectype[0])
|
||||
string dstyleindx = ((stpseq == null || stpseq == "") ? " " : stpseq.Substring(1, 1)) + ((SecType==null||SecType == "") ? " " : SecType.Substring(0, 1));
|
||||
int docstyleindx = GetDocStyleIndx(dstyleindx, format, procitem, docver);
|
||||
|
||||
// tack on the column mode - add to config xml for node.
|
||||
if (stpseq != null && stpseq.Substring(1, 1) == "0" && stpseq.Substring(5, 1) != " ")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Section", "ColumnMode", stpseq.Substring(5, 1));
|
||||
}
|
||||
|
||||
// find rtf file (or use the library document temp file) & read it into the field
|
||||
// acccontent
|
||||
int Documentid=0;
|
||||
bool needEntry = false;
|
||||
if (libdocid != 0 || stpseq.Substring(1, 1) != "0")
|
||||
{
|
||||
needEntry = true;
|
||||
string fname = null;
|
||||
if (libdocid != 0)
|
||||
{
|
||||
Documentid = libdocid;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = Convert.ToInt32(stpseq[0]) - 64;
|
||||
string thenum = num.ToString("d2");
|
||||
fname = string.Format("{0}\\rtffiles\\{1}.A{2}", pth, ProcFileName, thenum);
|
||||
Application.DoEvents();
|
||||
SaveSectionDocument(fname, stpseq, SecType, ref Documentid);
|
||||
if (Documentid == 0)
|
||||
{
|
||||
if (MissingDocument==null) MissingDocument = Document.MakeDocument("MISSING FILE IN CONVERSION", null, null, null);
|
||||
Documentid = MissingDocument.DocID;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Userid == null || Userid == "") Userid = "Migration";
|
||||
|
||||
// test for performance
|
||||
Content cont;
|
||||
using(Format fmt2 = format == null ? null : format.Get())
|
||||
cont = Content.New(Number, Title, 10000+docstyleindx, fmt2, ci==null?null:ci.ToString(), Dts, Userid);
|
||||
Entry entry = cont.MyEntry;
|
||||
if (needEntry)
|
||||
{
|
||||
entry.MyDocument = Document.Get(Documentid);
|
||||
entry.DTS = Dts;
|
||||
entry.UserID = Userid;
|
||||
//entry = Entry.MakeEntry(cont.ContentID, Document.Get(Documentid), Dts, Userid);
|
||||
}
|
||||
cont.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq;
|
||||
Item itm = null;
|
||||
// the stpseq for section records may include a space & some other data. This
|
||||
// was not part of what is stored in the transition records, so just look at
|
||||
// the sequence before the space for section records. Then use the first character
|
||||
// with a '0'. This is what's stored in the transition record, for example, if the
|
||||
// section was BI, the transition record would have B0 (the reasoning is that
|
||||
// for steps, this is what could be stored if there were enough steps.
|
||||
int trindxsp = stpseq.IndexOf(' ');
|
||||
string trstpseq = trindxsp < 0 ? stpseq : stpseq.Substring(0, 1)+ "0";
|
||||
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + trstpseq))
|
||||
{
|
||||
itm = dicTrans_ItemIds[ProcNumber + "|" + trstpseq];
|
||||
itm.MyContent = cont;
|
||||
itm.MyPrevious = FromItem;
|
||||
itm.DTS = Dts;
|
||||
itm.UserID = Userid;
|
||||
if (!itm.IsSavable) ErrorRpt.ErrorReport(itm);
|
||||
itm.Save();
|
||||
dicTrans_ItemIds.Remove(ProcNumber + "|" + trstpseq);
|
||||
dicTrans_MigrationErrors.Remove(ProcNumber + "|" + trstpseq);
|
||||
}
|
||||
else
|
||||
itm = Item.MakeItem(FromItem, cont, Dts, Userid);
|
||||
dicTrans_ItemDone[ProcNumber+"|"+trstpseq] = itm;
|
||||
dicOldStepSequence[itm] = stpseq;
|
||||
return itm;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Save Section");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private int LookupOldToNew(string lkup)
|
||||
{
|
||||
if (dicOldToNew == null)
|
||||
{
|
||||
dicOldToNew = new Dictionary<string, int>();
|
||||
//dicOldToNew.Add("", 1);
|
||||
dicOldToNew.Add("0", 1);
|
||||
dicOldToNew.Add("0 ", 1);
|
||||
dicOldToNew.Add("00", 1);
|
||||
dicOldToNew.Add("01", 2);
|
||||
dicOldToNew.Add("02", 4);
|
||||
dicOldToNew.Add("03", 8);
|
||||
dicOldToNew.Add("04", 16);
|
||||
dicOldToNew.Add("I", 32);
|
||||
dicOldToNew.Add("I ", 32);
|
||||
dicOldToNew.Add("I0", 32);
|
||||
dicOldToNew.Add("I1", 64);
|
||||
dicOldToNew.Add("I2", 128);
|
||||
dicOldToNew.Add("I3", 256);
|
||||
dicOldToNew.Add("I4", 512);
|
||||
dicOldToNew.Add("A", 1024);
|
||||
dicOldToNew.Add("A ", 1024);
|
||||
dicOldToNew.Add("A0", 1024);
|
||||
dicOldToNew.Add("A1", 2048);
|
||||
dicOldToNew.Add("A2", 4096);
|
||||
dicOldToNew.Add("A3", 8192);
|
||||
dicOldToNew.Add("A4", 16384);
|
||||
dicOldToNew.Add("F", 32768);
|
||||
dicOldToNew.Add("F ", 32768);
|
||||
dicOldToNew.Add("F0", 32768);
|
||||
dicOldToNew.Add("F1", 65536);
|
||||
dicOldToNew.Add("F2", 131072);
|
||||
dicOldToNew.Add("F3", 262144);
|
||||
dicOldToNew.Add("F4", 524288);
|
||||
dicOldToNew.Add("05", 1048576);
|
||||
dicOldToNew.Add("06", 2097152);
|
||||
dicOldToNew.Add("07", 4194304);
|
||||
dicOldToNew.Add("08", 8388608);
|
||||
dicOldToNew.Add("09", 16777216);
|
||||
dicOldToNew.Add("0:", 33554432);
|
||||
dicOldToNew.Add("0;", 67108864);
|
||||
dicOldToNew.Add("0<", 134217728);
|
||||
dicOldToNew.Add("0=", 268435456);
|
||||
dicOldToNew.Add("0>", 536870912);
|
||||
}
|
||||
int retval = -1;
|
||||
try
|
||||
{
|
||||
retval = dicOldToNew[lkup];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(string.Format("Error in oldtonew {0}", lkup));
|
||||
Console.WriteLine(string.Format("Error = {0}", ex.Message));
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private int GetDocStyleIndx(string dstyleindx, FormatInfo format, Item procitem, DocVersion docver)
|
||||
{
|
||||
// get the format, if format is set, use it, otherwise walk
|
||||
if (format == null)
|
||||
{
|
||||
format = GetFormat(procitem, docver);
|
||||
}
|
||||
int docstyle = LookupOldToNew(dstyleindx);
|
||||
foreach (DocStyle ds in format.PlantFormat.DocStyles.DocStyleList)
|
||||
{
|
||||
if ((ds.OldToNew & docstyle)>0) return (int)ds.Index;
|
||||
}
|
||||
Console.WriteLine("Error getting docstyle index");
|
||||
return 0;
|
||||
}
|
||||
private FormatInfo GetFormat(Item procitem, DocVersion docver)
|
||||
{
|
||||
return procitem.MyItemInfo.ActiveFormat;
|
||||
//while (procitem.MyItemInfo.a .MyContent.MyFormat == null)
|
||||
//{
|
||||
// // find the first sibling
|
||||
// while (procitem.PreviousID != null)
|
||||
// procitem = procitem.MyPrevious;
|
||||
// if (procitem.ItemPartCount == 0) return docver.MyDocVersionInfo.ActiveFormat;
|
||||
// // find the parent node
|
||||
// procitem = procitem.ItemParts[0].MyContent.ContentItems[0].MyItem;
|
||||
//}
|
||||
//return procitem.MyContent.MyFormat;
|
||||
}
|
||||
//private FormatInfo GetFormat(DocVersion docver)
|
||||
//{
|
||||
// if (docver.MyDocVersionInfo.MyFormat != null) return docver.MyDocVersionInfo.MyFormat;
|
||||
// return GetFormat(docver.MyDocVersionInfo.MyFolder);
|
||||
//}
|
||||
//private FormatInfo GetFormat(FolderInfo folder)
|
||||
//{
|
||||
// if (folder.MyFormat != null) return folder.MyFolderInfo.MyFormat;
|
||||
// return GetFormat(folder.MyParent);
|
||||
//}
|
||||
private string SectTitle(OleDbConnection cn, DataRowView dr, bool UseMultiLineSectionTitle, bool ConvertCaret)
|
||||
{
|
||||
string tbuff = null;
|
||||
string menustr = null;
|
||||
|
||||
if (UseMultiLineSectionTitle)
|
||||
{
|
||||
bool titleInMemo = false;
|
||||
// for accessory pages...
|
||||
if (dr["Step"].ToString().Substring(1, 1) != "0")
|
||||
{
|
||||
// The long section title is stored on a record with the "~" character.
|
||||
// This was done since originally the actual accessory page data was stored in the memo
|
||||
// field, so the long title could not be stored there, another record had to be used.
|
||||
OleDbDataAdapter da = new OleDbDataAdapter("select * from " + ProcFileName + " where [Step] like '" + dr["Step"].ToString().Substring(0, 1) + "~';", cn);
|
||||
DataSet ds = new DataSet();
|
||||
try
|
||||
{
|
||||
da.Fill(ds);
|
||||
if (ds.Tables[0].Rows.Count == 1)
|
||||
{
|
||||
DataRow row = ds.Tables[0].Rows[0];
|
||||
tbuff = TextConvert.ConvertText(row["Textm"].ToString(),ConvertCaret);
|
||||
if (tbuff != null && tbuff != "") titleInMemo = true;
|
||||
}
|
||||
else // no long section title existed for this accessory page
|
||||
tbuff = TextConvert.ConvertText(dr["Text"].ToString().PadRight(130, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error getting long section title {0}", ex.Message);
|
||||
}
|
||||
da.Dispose();
|
||||
}
|
||||
// For step sections, the long section title is stored on the section record
|
||||
// (see above comment for accessory pages to see the difference)
|
||||
else
|
||||
{
|
||||
tbuff = TextConvert.ConvertText(dr["TextM"].ToString().Trim(), ConvertCaret);
|
||||
}
|
||||
|
||||
//// TESTS were run & it looked like that whitespace was removed before saving,
|
||||
//// so, put up a message box if find out otherwise....
|
||||
//int nl = tbuff.IndexOf("\n");
|
||||
//if (nl > -1)
|
||||
// MessageBox.Show("multiline text for section title, fix this!!");
|
||||
|
||||
//// remove newlines & any other escape/whitespace chars.
|
||||
int nl = tbuff.IndexOf("\n");
|
||||
if (nl > -1 || titleInMemo)
|
||||
{
|
||||
|
||||
string tmpstr = tbuff.Replace("\r", "");
|
||||
tmpstr = tmpstr.Replace("\t", "");
|
||||
tmpstr = tmpstr.Replace("\n", " ");
|
||||
// get rid of multiple spaces
|
||||
while (tmpstr.IndexOf(" ") > -1) tmpstr = tmpstr.Replace(" ", " ");
|
||||
tbuff = tmpstr;
|
||||
if (tbuff.Substring(tbuff.Length - 1, 1) == " ") tbuff = tbuff.Substring(0, tbuff.Length - 1);
|
||||
menustr = tbuff;
|
||||
}
|
||||
else
|
||||
{
|
||||
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // format does not include long section title
|
||||
menustr = TextConvert.ConvertText(dr["Text"].ToString().PadRight(80, ' ').Substring(0, 75).TrimEnd(), ConvertCaret);
|
||||
}
|
||||
return menustr;
|
||||
}
|
||||
private Item MigrateSection(Item procitem, string procnum, OleDbConnection cn, DataRowView dr, DataTable dt, Item FromItem, bool isSubSection, string pth, DocVersion docver)
|
||||
{
|
||||
Int32 thesectid = 0;
|
||||
bool isautogen = false;
|
||||
string stype = dr["type"].ToString();
|
||||
string s = dr["text"].ToString().PadRight(130, ' ');
|
||||
string num = s.Substring(85, 20).TrimEnd();
|
||||
string fmt = s.Substring(75, 10).TrimEnd();
|
||||
if (fmt == "") fmt = null;
|
||||
bool ismulti = false;
|
||||
bool conv_caret = true;
|
||||
|
||||
// sectFormat is a local that represents the format to be used by this section.
|
||||
// Note that if the format is set for this section, check it against what the inherited
|
||||
// value would be (for example, what the format is for the set), if they are the same
|
||||
// clear the format at the section level.
|
||||
FormatInfo sectFormat = null;
|
||||
FormatInfo docverFormat = docver.MyDocVersionInfo.ActiveFormat;
|
||||
if (fmt != null&& fmt !="") // Is there a long section title (from format flag)
|
||||
sectFormat = GetFormat(fmt);
|
||||
else // either from this format, or the plant.
|
||||
sectFormat = docverFormat;
|
||||
if (sectFormat != null)
|
||||
{
|
||||
ismulti = sectFormat.PlantFormat.FormatData.SectData.StepSectionData.UseMultiLineSectionTitle;
|
||||
conv_caret = sectFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta;
|
||||
}
|
||||
if (fmt != null && fmt != "") if (fmt == docverFormat.Name) fmt = null;
|
||||
string title = SectTitle(cn, dr, ismulti, conv_caret);
|
||||
string init = dr["initials"].ToString().Trim();
|
||||
string sequence = dr["CSequence"].ToString().PadRight(10);
|
||||
string step = dr["CStep"].ToString();
|
||||
int libDocid = 0;
|
||||
|
||||
DateTime dts = GetDTS(dr["Date"].ToString(), dr["Time"].ToString());
|
||||
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
ci.AddItem("Section", "OldType", stype);
|
||||
|
||||
|
||||
// for steps sections...
|
||||
// Step Section Header Format:
|
||||
// A0 1X2S51 &Y
|
||||
// ^^^^^^^^^^^^
|
||||
// |||||||||||||
|
||||
// ||||||||||||`- 'Y','N', or blank signals to print section header - lib/section/addsec.c
|
||||
// |||||||||||`-- (bits) Auto Indent, Editable Data, Checkoff Header Type - lib/section/addsec.c
|
||||
// ||||||||||`--- blank
|
||||
// ||||||||`----- Link With Enhanced Document ' '-Default(not determined) 0-NO 1-YES
|
||||
// |||||||`------ MetaSection - number of subsections is given
|
||||
// ||||||`------- S-Separate(PageBreak); T-Continuous; ' '-Default
|
||||
// |||||`-------- Column mode (1,2,3,' '-default)
|
||||
// ||||`--------- X -only proc section; x -orig. proc; ' ' -other
|
||||
// |||`---------- Position within the procedure
|
||||
// ||`----------- ALWAYS leave blank
|
||||
// |`------------ Step Section Header marker
|
||||
// `------------- Internal section number (starts at A)
|
||||
|
||||
if (step.Substring(1, 1) == "0")
|
||||
{
|
||||
// if this section has the original edit section flag (sequence[2]) save the id.
|
||||
|
||||
// set pagination, continuous, separate. If blank, don't create attribute - uses format default.
|
||||
if (sequence.Substring(4, 1) == "T")
|
||||
{
|
||||
ci.AddItem("Section", "Pagination", "C");
|
||||
}
|
||||
else if (sequence.Substring(4, 1) == "S")
|
||||
{
|
||||
ci.AddItem("Section", "Pagination", "S");
|
||||
}
|
||||
|
||||
// Step: linked to enhanced (!exist = N)
|
||||
if (sequence.Substring(7, 1) == "1")
|
||||
{
|
||||
ci.AddItem("Step", "LnkEnh", "Y");
|
||||
}
|
||||
char cbittst = sequence.PadRight(10)[8];
|
||||
if (cbittst == ' ')
|
||||
cbittst = '\0';
|
||||
else
|
||||
{
|
||||
// determine if TOC element (!exist = N)
|
||||
if ((cbittst & TOC) > 1)
|
||||
{
|
||||
ci.AddItem("Section", "TOC", "Y");
|
||||
}
|
||||
// determine if autogenerated section (!exist = N)
|
||||
if ((cbittst & AUTOGEN) > 1)
|
||||
{
|
||||
isautogen = true;
|
||||
ci.AddItem("Section", "AutoGen", "Y");
|
||||
}
|
||||
}
|
||||
// Here are subsection flags, i.e. the following are only set if this
|
||||
// is a subsection.
|
||||
bool didsub = false;
|
||||
if (isSubSection)
|
||||
{
|
||||
// Subsection: editable (!exist = Y)
|
||||
if ((cbittst & EDDATA) > 0)
|
||||
{
|
||||
ci.AddItem("SubSection", "Edit", "N");
|
||||
}
|
||||
|
||||
// Subsection: print section headers (!exist = Y)
|
||||
if ((cbittst & PH) > 0)
|
||||
{
|
||||
didsub = true;
|
||||
ci.AddItem("SubSection", "PH", "N");
|
||||
}
|
||||
|
||||
// Subsection: autoindent (!exist = Y)
|
||||
if ((cbittst & AUTOIND) > 0)
|
||||
{
|
||||
ci.AddItem("SubSection", "AutoIndent", "N");
|
||||
}
|
||||
}
|
||||
if (!didsub && sequence.Substring(4, 1) == "N")
|
||||
{
|
||||
ci.AddItem("SubSection", "PH", "N");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Accessory Section Format:
|
||||
// AI 1 2
|
||||
// ^^ ^ ^
|
||||
// || | |
|
||||
// || | `- # of pages (ASCII value minus 48)
|
||||
// || `--- Position within the procedure
|
||||
// |`----- Acc. page type (A,I, or F)
|
||||
// `------ Internal section number (starts at A)
|
||||
ci.AddItem("Section", "NumPages", sequence.Substring(3, 1));
|
||||
|
||||
// see if it's a libdoc too
|
||||
string thekey = procnum.PadRight(20) + step.Substring(0, 1).PadRight(10);
|
||||
if (dicLibDocRef.ContainsKey(thekey))
|
||||
{
|
||||
// if it is a library document, see if the section record has already been
|
||||
// saved. If it has, just use this section id, otherwise, create the
|
||||
// section record with info from the library document file.
|
||||
libDocid = dicLibDocRef[thekey];
|
||||
}
|
||||
}
|
||||
Item secitem = AddSection(procitem, num, title, stype, dts, init, ci, step + sequence, fmt, libDocid, pth, FromItem, docver);
|
||||
thesectid = secitem.ItemID;
|
||||
|
||||
// if the editsectid hasn't been set yet, set it to this section id, i.e. the first
|
||||
// one processed. Then if this section has the original edit section flag (sequence[2])
|
||||
// save the id. The first step is necessary in case there is no original edit section
|
||||
// flag set, so that the first section is the default one to get opened in edit.
|
||||
if (EditSectId==0)EditSectId = thesectid;
|
||||
if (libDocid<1 && step[1] == '0' && (sequence[2] == 'x' || sequence[2] == 'X'))
|
||||
EditSectId = thesectid;
|
||||
// ContentType (2 in the following call) are:
|
||||
// 0 = structure,
|
||||
// 1 = procedure,
|
||||
// 2 = section,
|
||||
// 3 = step
|
||||
// 4 = branch
|
||||
|
||||
// fromtype values are (see steps.cs too)
|
||||
// 1 = procedure,
|
||||
// 2 = section,
|
||||
// 3 = caution
|
||||
// 4 = note
|
||||
// 5 = RNO
|
||||
// 6 = step
|
||||
// 7 = table
|
||||
|
||||
if (!isautogen)
|
||||
{
|
||||
// Process the Data Table - First look for High Level Steps
|
||||
string sQry = string.Format("Step like '[{0}]%' and Sequence='S'", dr["Step"].ToString().Substring(0, 1));
|
||||
DataView dv = new DataView(dt, sQry, "StepNo", DataViewRowState.CurrentRows);
|
||||
Item FrItem = null;
|
||||
frmMain.pbStepMaximum = dt.Rows.Count;
|
||||
frmMain.pbStepValue = 0;
|
||||
foreach (DataRowView drv in dv)
|
||||
{
|
||||
FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver);
|
||||
if (secitem.MyContent.ContentParts.Count == 0)
|
||||
{
|
||||
// type 6 is step
|
||||
secitem.MyContent.ContentParts.Add(6, FrItem);
|
||||
if (!secitem.MyContent.IsSavable) ErrorRpt.ErrorReport(secitem.MyContent);
|
||||
secitem.MyContent.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
return secitem;
|
||||
}
|
||||
private void LoadSection(DataSet ds, OleDbDataAdapter da, string FileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
da.Fill(ds, "Sections");
|
||||
DataTable dt = ds.Tables["Sections"];
|
||||
dt.CaseSensitive = true;
|
||||
dt.Columns.Add("CStep", System.Type.GetType("System.String"));
|
||||
dt.Columns.Add("CSequence", System.Type.GetType("System.String"));
|
||||
// set the cstep & csequence - couldn't do it in the add because it needed a sql function
|
||||
foreach (DataRow drw in ds.Tables["Sections"].Rows)
|
||||
{
|
||||
drw["CStep"] = TextConvert.ConvertSeq(drw["Step"].ToString());
|
||||
drw["CSequence"] = TextConvert.ConvertSeq(drw["Sequence"].ToString());
|
||||
}
|
||||
dt.Columns.Add("StepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CStep,2,1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("Level", System.Type.GetType("System.Int32"), "Len(CSequence)");
|
||||
dt.Columns.Add("SubStepNo", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,Len(CSequence),1),'System.Char'),'System.Int32')-48");
|
||||
dt.Columns.Add("locb", System.Type.GetType("System.Int32"), "Convert(Convert(Substring(CSequence,2,1),'System.Char'),'System.Int32')-48");
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
FileInfo fi;
|
||||
switch (ex.Message)
|
||||
{
|
||||
case "Index file not found.":// then delete inf file
|
||||
fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf");
|
||||
fi.Delete();
|
||||
LoadSection(ds, da, FileName);// Try Again
|
||||
break;
|
||||
case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
|
||||
fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt");
|
||||
FileStream fs = fi.OpenWrite();
|
||||
fs.Position = fs.Length;
|
||||
byte[] buf = new byte[128];
|
||||
for (int i = 0; i < 128; i++) buf[i] = 0;
|
||||
fs.Write(buf, 0, 128);
|
||||
fs.Close();
|
||||
LoadSection(ds, da, FileName);// Try Again
|
||||
break;
|
||||
default: // Unrecognized error
|
||||
Console.WriteLine("Unrecognized error: error = {0}", ex.Message);
|
||||
log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
namespace DataLoader.Properties {
|
||||
|
||||
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Settings {
|
||||
|
||||
public Settings() {
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,722 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.Controls.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt,Item parentItem, int frType, string seqRoTran)
|
||||
{
|
||||
//if (ProcNumber + "|" + stpseq == "STN FP-202|Q2S2")
|
||||
// Console.WriteLine("here");
|
||||
Content content = null;
|
||||
Item item = null;
|
||||
|
||||
frmMain.UpdateLabels(0, 0, 1);
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
ci.AddItem("History", "RecID", Recid);
|
||||
ci.AddItem("History", "ProcName", ProcFileName.ToUpper());
|
||||
if (MultiUnitCount > 0)
|
||||
{
|
||||
string apple = AddApplicability(Recid);
|
||||
if(apple != null)
|
||||
ci.AddItem("MasterSlave", "Applicability", apple);
|
||||
}
|
||||
string stptext = null;
|
||||
if (userid == null || userid == "") userid = "Migration";
|
||||
int tok = -1;
|
||||
//char[] chrarr = { '\x1', '\x2', '\x3', '\x5' };
|
||||
Textm = Textm.Replace("\\", "<BackSlash>");
|
||||
char[] chrarr = { '\x1', '\x2', '\x3' };
|
||||
try
|
||||
{
|
||||
// the textm field has step text, but also may have other text stored
|
||||
// with it with a 'token' as a separator (see below).
|
||||
tok = Textm.IndexOfAny(chrarr);
|
||||
|
||||
// This will find a continuous action flag without finding a hanging indent
|
||||
if (tok == -1 && Textm.Length > 0 && Textm[Textm.Length - 1] == '\x5')
|
||||
tok = Textm.Length - 1;
|
||||
|
||||
// if this is bge, handle some special cases for bold/underline next that were not
|
||||
// getting processed from regular expression, as defined in comments for each case below:
|
||||
if (fmt.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
|
||||
{
|
||||
// get step type, and check its format for bold. BGE had data that was high5 (bolded step)
|
||||
// with the bold of the next word character, but it was redundant
|
||||
if (StepType[0] == '\u2591')
|
||||
StepType = "0" + StepType.Substring(1, StepType.Length - 1);
|
||||
if (StepType[0] == '\u2592')
|
||||
StepType = "1" + StepType.Substring(1, StepType.Length - 1);
|
||||
if (StepType[0] == '\u2524')
|
||||
StepType = "4" + StepType.Substring(1, StepType.Length - 1);
|
||||
int stptype = 0;
|
||||
try
|
||||
{
|
||||
stptype = Convert.ToInt32(StepType) + 1;
|
||||
}
|
||||
catch (Exception myex)
|
||||
{
|
||||
Console.WriteLine(myex.Message);
|
||||
}
|
||||
bool isbold = (stptype == 41); // This is hardcoded for BGE only
|
||||
if (isbold && Textm.Contains("\x13")) Textm = Textm.Replace("\x13", "");
|
||||
|
||||
// BGE was not migrating a few styles on next word correctly because of the other
|
||||
// characters after the hex, i.e. '[', '(', etc (see comments on specific cases).
|
||||
// The regular expression that handled replacing the 'style next word' hex flag was
|
||||
// not working with those. Handle those special cases here.
|
||||
|
||||
int indxH = -1;
|
||||
int indxHE = -1;
|
||||
if (Textm.Contains("\x13"))
|
||||
{
|
||||
if (Textm.Contains("\x13[")) // bold before '['
|
||||
{
|
||||
indxH = Textm.IndexOf("\x13[");
|
||||
indxHE = Textm.IndexOf("]", indxH);
|
||||
Textm = Textm.Insert(indxHE+1, @"\b0 ");
|
||||
Textm = Textm.Replace("\x13[", @"\b [");
|
||||
}
|
||||
if (Textm.Contains("\x13(")) // bold before '('
|
||||
{
|
||||
indxH = Textm.IndexOf("\x13(");
|
||||
indxHE = Textm.IndexOf(")", indxH);
|
||||
Textm = Textm.Insert(indxHE+1, @"\b0 ");
|
||||
Textm = Textm.Replace("\x13(", @"\b (");
|
||||
}
|
||||
if (Textm.Contains("\x13{")) // bold before '{'
|
||||
{
|
||||
indxH = Textm.IndexOf("\x13{");
|
||||
indxHE = Textm.IndexOf(" ", indxH);
|
||||
Textm = Textm.Insert(indxHE + 1, @"\b0 ");
|
||||
Textm = Textm.Replace("\x13{", @"\b {");
|
||||
}
|
||||
if (Textm.Contains("\x13}")) // bold before '}'
|
||||
{
|
||||
indxH = Textm.IndexOf("\x13}");
|
||||
indxHE = Textm.IndexOf(" ", indxH);
|
||||
if (indxHE == -1) // add the bold off to end of string (no space needed at end)
|
||||
Textm = Textm + @"\b0";
|
||||
else
|
||||
Textm = Textm.Insert(indxHE + 1, @"\b0 ");
|
||||
Textm = Textm.Replace("\x13}", @"\b }");
|
||||
}
|
||||
if (Textm.Contains("\x13\xa0")) // bold before hardspace
|
||||
{
|
||||
indxH = Textm.IndexOf("\x13\xa0");
|
||||
indxHE = Textm.IndexOf(" ", indxH);
|
||||
if (indxHE == -1) // add the bold off to end of string (no space needed at end)
|
||||
Textm = Textm + @"\b0";
|
||||
else
|
||||
Textm = Textm.Insert(indxHE + 1, @"\b0 ");
|
||||
Textm = Textm.Replace("\x13\xa0", "\\b \xa0");
|
||||
}
|
||||
if (Textm.Contains("\x13 ")) // bold before a space, switch bold & space
|
||||
Textm = Textm.Replace("\x13 ", " \x13");
|
||||
}
|
||||
|
||||
// BGE also had special cases for underline next word \x17
|
||||
if (Textm.Contains("\x17\\b")) // before bold on
|
||||
{
|
||||
indxH = Textm.IndexOf("\x17\\b");
|
||||
indxHE = Textm.IndexOf(@"\b0", indxH);
|
||||
Textm = Textm.Insert(indxHE+1, @"\ulnone ");
|
||||
Textm = Textm.Replace("\x17\\b", @"\ul\b");
|
||||
}
|
||||
if (Textm.Contains("\x17\x13")) // before bold next word token
|
||||
{
|
||||
indxH = Textm.IndexOf("\x17\x13");
|
||||
indxHE = Textm.IndexOf(" ", indxH);
|
||||
Textm = Textm.Insert(indxHE + 1, @"\ulnone ");
|
||||
Textm = Textm.Replace("\x17\x13", "\\ul\x13");
|
||||
}
|
||||
}
|
||||
if (tok < 0)
|
||||
stptext = TextConvert.ConvertText(Textm, conv_caret);
|
||||
else
|
||||
stptext = TextConvert.ConvertText(Textm.Substring(0, tok), conv_caret);
|
||||
//string stpTextOrg = stptext;
|
||||
|
||||
string seqcvt = stpseq;
|
||||
|
||||
//check for Placekeeper flag
|
||||
if (Recid[0] == 9617) //(Recid[0] != '0') // placekeeper Recid[0] & 0x80
|
||||
ci.AddItem("Step", "Placekeeper", "Y");
|
||||
else if (Recid[0] == 8801) // sub step Placekeeper with Continuous Action
|
||||
ci.AddItem("Step", "Placekeeper", "C");
|
||||
string newstptyp = null;
|
||||
bool ManualPagebreak = false;
|
||||
char cbittst = StepType.PadRight(2)[0];
|
||||
byte cbittstb = (byte) StepType.PadRight(2)[0];
|
||||
|
||||
//Console.WriteLine(string.Format("AddStep() StepType {0} cbitst = {1} OR'd 0x80 = {2}",StepType,Convert.ToInt16(cbittst),(cbittst & 0x80)));
|
||||
if (cbittst != ' ' && (cbittst & 0xFF80) > 1)//(cbittst & 0x80) > 1)
|
||||
{
|
||||
ManualPagebreak = true;
|
||||
ci.AddItem("Step", "ManualPagebreak", "True");
|
||||
// conversion from 16bit characters to 32bit strings handles the higher bits differently.
|
||||
// Thus we cannot do normal 'or'ing/'and'/ing of 0x7f & 0x80 to just get the step
|
||||
// type without the pagebreak bit. The following two cases 'hardcode' the steptype
|
||||
// based on that problem.
|
||||
if ((Convert.ToInt16(cbittst)) == 9508) //page break on HIGH5 step type (40)
|
||||
newstptyp = "40";
|
||||
else if ((Convert.ToInt16(cbittst)) == 9618) //page break on LOSS OF AC type
|
||||
newstptyp = "17";
|
||||
else
|
||||
newstptyp = StepType.Substring(1, 1);
|
||||
}
|
||||
// Need the content record for the RO & transitions.
|
||||
//content = Content.MakeContent(null, stptext, 20000 + int.Parse(newstptyp!=null?newstptyp:StepType),null, ManualPagebreak?ci.ToString():null, dts, userid);
|
||||
// 20000 flags step type item & 1 adjusts for 'base' in format files.
|
||||
int contenttype = (structtype == "R") ? 20040 : 20001 + int.Parse(newstptyp != null ? newstptyp : StepType);
|
||||
content = Content.New(null, stptext.Replace("<BackSlash>", "\\\\"), contenttype, null, ci.ToString(), dts, userid);
|
||||
content.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq.TrimEnd(" ".ToCharArray()); ;
|
||||
|
||||
// Before we save it, handle RO & Transitions tokens.
|
||||
int tokrt = Textm.IndexOf('\x15');
|
||||
bool txtdirty = false;
|
||||
bool isROTable = false;
|
||||
int rotype = 0;
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = MigrateRos(cn, stptext, seqRoTran, content, docver, conv_caret, ref rotype);
|
||||
stptext = stptext.TrimEnd(" ".ToCharArray());
|
||||
// if this is a table RO, then save a flag in the config
|
||||
isROTable = (rotype == 2 || rotype == 3);
|
||||
}
|
||||
tokrt = Textm.IndexOf('\x3a6');
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = MigrateRos(cn, stptext, seqRoTran, content, docver, conv_caret, ref rotype);
|
||||
stptext = stptext.TrimEnd(" ".ToCharArray());
|
||||
}
|
||||
|
||||
// 16-bit code has the following two defines.
|
||||
// #define TransitionMarker 0xC2
|
||||
// #define ReferenceMarker 0xCB
|
||||
// these two characters get converted (to unicode) from ado.net
|
||||
// use the unicode chars.
|
||||
char[] chrrotrn = { '\x252C', '\x2566' };
|
||||
tokrt = Textm.IndexOfAny(chrrotrn);
|
||||
_TransitionMigrationErrors = new List<string>();
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = MigrateTrans(cn, stptext, seqRoTran, content, pth);
|
||||
stptext = stptext.TrimEnd(" ".ToCharArray());
|
||||
}
|
||||
//string fixStpText = FixStepText(stptext,content.Type);
|
||||
string fixStpText = "";
|
||||
if (IsATable(content.Type))
|
||||
{
|
||||
bool hasBorder = !WithoutBorder(content.Type);
|
||||
fixStpText = ConvertTableToGrid(stptext, content, fmt, isROTable, hasBorder ? GridLinePattern.Single : GridLinePattern.None );
|
||||
frmMain.AddInfo("Memory After Grid Convert {0}", GC.GetTotalMemory(true)); // This will force a Garbage Collection
|
||||
frmMain.AddInfo("VlnFlexGrid Counts: {0}, {1}, {2}", VlnFlexGrid.CountCreated, VlnFlexGrid.CountNotDisposed, VlnFlexGrid.CountNotFinalized);
|
||||
frmMain.AddInfo("StepRTB Counts: {0}, {1}, {2}", StepRTB.CountCreated, StepRTB.CountNotDisposed, StepRTB.CountNotFinalized);
|
||||
int? typ = ConvertTableType(content, fmt);
|
||||
if (typ != null) content.Type = typ;
|
||||
else _ContentMigrationErrors.Add(content.ContentID, null);
|
||||
}
|
||||
else
|
||||
fixStpText = FixStepText(stptext);
|
||||
if (fixStpText != stptext)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = fixStpText;
|
||||
}
|
||||
if (txtdirty)
|
||||
{
|
||||
content.Text = stptext.Replace("<BackSlash>", "\\\\");
|
||||
//content.Save();
|
||||
}
|
||||
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||
List<string> migrationerrors = null;
|
||||
if (_ContentMigrationErrors.ContainsKey(content.ContentID))
|
||||
migrationerrors = _ContentMigrationErrors[content.ContentID];
|
||||
content = content.Save();
|
||||
// check if already created thru new during transition migration...
|
||||
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + seqRoTran))
|
||||
{
|
||||
item = dicTrans_ItemIds[ProcNumber + "|" + seqRoTran];
|
||||
item.MyPrevious = FromItem;
|
||||
item.MyContent = content;
|
||||
item.DTS = dts;
|
||||
item.UserID = userid;
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item = item.Save();
|
||||
dicTrans_ItemIds.Remove(ProcNumber + "|" + seqRoTran);
|
||||
dicTrans_MigrationErrors.Remove(ProcNumber + "|" + seqRoTran);
|
||||
}
|
||||
else
|
||||
item = Item.MakeItem(FromItem, content, content.DTS, content.UserID);
|
||||
|
||||
// If we converted a Table to a Grid, then insert an Annotation to alert the user to verify it
|
||||
if (IsATable(content.Type))//item.MyContent.MyGrid != null)
|
||||
{
|
||||
ItemAnnotation ia = item.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Verify Table Conversion";
|
||||
ia.UserID = "Migration";
|
||||
item.Save();
|
||||
}
|
||||
if (InvalidROs.Count > 0)
|
||||
{
|
||||
foreach (string str in InvalidROs)
|
||||
{
|
||||
ItemAnnotation iaro = item.ItemAnnotations.Add(MigrationErrorType);
|
||||
iaro.SearchText = str;
|
||||
iaro.UserID = "Migration";
|
||||
}
|
||||
item.Save();
|
||||
InvalidROs.Clear();
|
||||
}
|
||||
if (frType > 0)
|
||||
{
|
||||
//using (Content c = Content.Get(parentItem.ContentID))
|
||||
//{
|
||||
// c.ContentParts.Add(frType, item);
|
||||
// if (!c.IsSavable) ErrorRpt.ErrorReport(c);
|
||||
// c.Save();
|
||||
//}
|
||||
parentItem.MyContent.ContentParts.Add(frType, item);
|
||||
if (!parentItem.MyContent.IsSavable) ErrorRpt.ErrorReport(parentItem.MyContent);
|
||||
parentItem.MyContent.Save();
|
||||
}
|
||||
|
||||
// Remove styles that user entered but are automatically done via the format
|
||||
string tstr = null;
|
||||
using (ItemInfo myInfo = item.MyItemInfo) // do this so that ItemInfo doesn't stay in cache
|
||||
tstr = myInfo.RemoveRtfStyles(content.Text, fmt);
|
||||
if (tstr != content.Text)
|
||||
{
|
||||
item.MyContent.Text = tstr;
|
||||
item.Save();
|
||||
}
|
||||
|
||||
if (migrationerrors != null)
|
||||
{
|
||||
foreach (string str in migrationerrors)
|
||||
{
|
||||
ItemAnnotation ia = item.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = str;
|
||||
ia.UserID = "Migration";
|
||||
}
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item.Save();
|
||||
}
|
||||
if (_TransitionMigrationErrors.Count > 0)
|
||||
{
|
||||
foreach (string str in _TransitionMigrationErrors)
|
||||
{
|
||||
if (!dicTrans_MigrationErrors.ContainsKey(str))
|
||||
dicTrans_MigrationErrors.Add(str, new List<Item>());
|
||||
dicTrans_MigrationErrors[str].Add(item);
|
||||
}
|
||||
}
|
||||
dicTrans_ItemDone[ProcNumber + "|" + seqRoTran] = item;
|
||||
dicOldStepSequence[content] = seqcvt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddStep {0}",stpseq);
|
||||
//Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
log.Error("Save Step");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
item = null;
|
||||
}
|
||||
|
||||
// now add on any support pieces of text associated with the step.
|
||||
// These include:
|
||||
// '\1' comment
|
||||
// '\2' multiple change ids and/or change message
|
||||
// '\3' linked sequence
|
||||
// '\3\3'override tab
|
||||
// '\5' continuous action summary flag (only if last char in string)
|
||||
// This assumes that these tokens are stored in reverse order that
|
||||
// they are processed.
|
||||
|
||||
|
||||
bool recdirty = false;
|
||||
try
|
||||
{
|
||||
|
||||
if (tok >= 0 && tok != Textm.Length)
|
||||
{
|
||||
string tkstring = Textm.Substring(tok);
|
||||
int nxttok = 0;
|
||||
|
||||
if (tkstring[tkstring.Length - 1] == '\x5') // Continuous Action Summary
|
||||
{
|
||||
recdirty = true;
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Step", "ContActSum", "True");
|
||||
tkstring = tkstring.Substring(0, tkstring.Length - 1); // strip off Continuous Action Token
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x3\x3")) > -1) // Enhanced Override Tab
|
||||
{
|
||||
//Console.WriteLine("Override Tab: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "OverrideTab", tkstring.Substring(nxttok + 2));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_OVR_TAB, tkstring.Substring(nxttok + 2));
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x3")) > -1) //Linked Sequence
|
||||
{
|
||||
//Console.WriteLine("Linked Seq: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "LinkedSeq", TextConvert.ConvertSeq(tkstring.Substring(nxttok + 1)));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_LNK_SEQ, TextConvert.ConvertSeq(tkstring.Substring(nxttok + 1)));
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
// verify that there are format flags for doing multiple change ids (DoMultipleChangeIDs) &
|
||||
// getting the change bar message from the editor (ChgBarMessageFromEdit), if these
|
||||
// two flags aren't set, don't migrate the data.
|
||||
// This was put in to fix B2012-258. An extensive search/debug session was done in 16bit to
|
||||
// see how these format flags and the data interracted. For OHLP/HLP, which only has
|
||||
// ChgBarMessageFromEdit flag, the data after the Multiple change id token was not used in
|
||||
// 16bit, at least anywhere that could be found when running the program through the debugger.
|
||||
if (fmt.PlantFormat.FormatData.ProcData.ChangeBarData.ChgBarMessageFromEdit &&
|
||||
fmt.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
|
||||
{
|
||||
if ((nxttok = tkstring.IndexOf("\x2")) > -1) // Multiple Change Ids
|
||||
{
|
||||
string tmpchgid = tkstring.Substring(nxttok + 1);
|
||||
if (tmpchgid.Length > 0)
|
||||
{
|
||||
//Console.WriteLine("Multiple Change ID: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "ChangeID", tkstring.Substring(nxttok + 1));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_MULT_CHGID, tkstring.Substring(nxttok + 1));
|
||||
}
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x1")) > -1) // Comment
|
||||
{
|
||||
// add the comment to annotation table. Set type to comment.
|
||||
//log.InfoFormat("Comment text: {0}", tkstring.Substring(nxttok + 1));
|
||||
Annotation annot = Annotation.MakeAnnotation(item, CommentType, null, tkstring.Substring(nxttok + 1), null, dts, userid);
|
||||
}
|
||||
}
|
||||
|
||||
// also see if a check-off needs added.
|
||||
if (Recid[0] != '0' && Recid[0] != '@') // the @ was in some of wolf creek data - we think it's just bad data.
|
||||
{
|
||||
recdirty = true;
|
||||
string chkindx = Recid[0].ToString();
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Step", "CheckOffIndex", chkindx);
|
||||
}
|
||||
|
||||
// here's where it knows if it's a linked step (or in processstep)
|
||||
if (Recid[1] != '0')
|
||||
{
|
||||
// do linked step stuff.
|
||||
}
|
||||
|
||||
// if checkoffs or the continuous action summary flag, save the xml.
|
||||
if (recdirty)
|
||||
{
|
||||
if (ci.ItemCount != 0) content.Config = ci.ToString();
|
||||
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Console.WriteLine("Subtexts: {0} {1}", ex.GetType().Name, ex.Message);
|
||||
frmMain.AddError(ex, "AddStep 2 {0}", stpseq);
|
||||
log.Error("Save Step part 2");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
private int? ConvertTableType(Content content, FormatInfo fmt)
|
||||
{
|
||||
// set the type to the first format type from this step type walking up the stepdata format
|
||||
// data until finding a !InActive.
|
||||
bool inactive = true;
|
||||
int indx = (int)content.Type - 20000;
|
||||
while (inactive)
|
||||
{
|
||||
StepData stpData = fmt.PlantFormat.FormatData.StepDataList[indx];
|
||||
if (!stpData.Inactive) return (Convert.ToInt32(stpData.Index) + 20000);
|
||||
// find parent node, i.e. Type="parentType"
|
||||
string parType = stpData.ParentType;
|
||||
foreach (StepData sd in fmt.PlantFormat.FormatData.StepDataList)
|
||||
if (parType == sd.Type) indx = (int)sd.Index;
|
||||
inactive = stpData.Inactive;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Regex _ReplaceSpaceNewLine = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\r\n)");
|
||||
private Regex _ReplaceTokenSpaceToken = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\\)");
|
||||
private string FixStepText(string stepText)
|
||||
{
|
||||
stepText = stepText.Replace("\xF8", @"\'f8");
|
||||
stepText = stepText.Replace(@"\par ", "\r\n");
|
||||
stepText = _ReplaceTokenSpaceToken.Replace(stepText, "");
|
||||
//stepText = stepText.Replace(@"\v0 \", @"\v0\");
|
||||
//Change Token Order to match RTB output
|
||||
stepText = stepText.Replace(@"\v0\b0", @"\b0\v0");
|
||||
stepText = stepText.Replace(@"\b0\ulnone", @"\ulnone\b0");
|
||||
stepText = _ReplaceSpaceNewLine.Replace(stepText, "");
|
||||
return stepText;
|
||||
}
|
||||
|
||||
private Regex _RemoveComments = new Regex(@"\\v .*?\\v0( |$)");
|
||||
|
||||
private string ConvertTableToGrid(string stepText, Content content, FormatInfo fmt, bool isROTable, GridLinePattern border)
|
||||
{
|
||||
//string savethis = stepText;
|
||||
string strGrid = "";
|
||||
int tablerodbid = -1;
|
||||
string tableroid = "";
|
||||
string tableroprefix = "";
|
||||
string tablerosuffix = "";
|
||||
if (isROTable)
|
||||
{
|
||||
// parse out and save the ROid and ROdb information
|
||||
// We will also need to re-attach the RO link prefix and suffix
|
||||
tableroprefix = @"\v <START]\v0 ";
|
||||
tablerosuffix = stepText.Substring(stepText.IndexOf(@"\v #Link:ReferencedObject:"));
|
||||
int idx = stepText.IndexOf(":");
|
||||
idx = stepText.IndexOf(" ", idx) + 1;
|
||||
int idx2 = stepText.IndexOf(" ", idx);
|
||||
tableroid = stepText.Substring(idx, idx2 - idx);
|
||||
idx = idx2 + 1;
|
||||
idx2 = stepText.IndexOf("[", idx);
|
||||
tablerodbid = int.Parse(stepText.Substring(idx, idx2 - idx));
|
||||
}
|
||||
//MessageBox.Show("Before ConvertTableToGrid " + GC.GetTotalMemory(true).ToString());
|
||||
using (VlnFlexGrid grd = new VlnFlexGrid(1, 1))
|
||||
{
|
||||
grd.IsRoTable = isROTable;
|
||||
if (isROTable)
|
||||
{
|
||||
// put the ROID and ROdb into the grid properties
|
||||
// Bug fix B2012-270
|
||||
grd.RODbId = tablerodbid;
|
||||
grd.ROID = tableroid;
|
||||
}
|
||||
VE_Font vefont = fmt.PlantFormat.FormatData.StepDataList.Table.Font;
|
||||
Font GridFont = new Font(vefont.Family, (float)vefont.Size);
|
||||
grd.Font = GridFont; // this also changes the default Row Height "Rows.DefaultSize"
|
||||
grd.ParseTableFromText(stepText,border);
|
||||
grd.AutoSizeCols();
|
||||
grd.AutoSizeRows();
|
||||
grd.MakeRTFcells();
|
||||
grd.FixTableCellsHeightWidth();
|
||||
grd.AdjustGridControlSize();
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
grd.WriteXml(sw);
|
||||
//Console.WriteLine(sw.GetStringBuilder().ToString());
|
||||
content.MyGrid.Data = sw.GetStringBuilder().ToString();
|
||||
strGrid = grd.GetSearchableText();
|
||||
sw.Close();
|
||||
}
|
||||
if (isROTable)
|
||||
{
|
||||
// re-attach the RO Link prfix and suffix
|
||||
strGrid = tableroprefix + strGrid + tablerosuffix;
|
||||
}
|
||||
}
|
||||
return strGrid;
|
||||
}
|
||||
|
||||
private bool IsATable(int? contenttype)
|
||||
{
|
||||
bool rtnval = false;
|
||||
switch (contenttype)
|
||||
{
|
||||
case 20008: // Centered table
|
||||
case 20010: // AER table
|
||||
case 20033: // AER table without boarder
|
||||
case 20034: // Centered table without boarder
|
||||
rtnval = true;
|
||||
break;
|
||||
}
|
||||
return rtnval;
|
||||
}
|
||||
private bool WithoutBorder(int? contenttype)
|
||||
{
|
||||
bool rtnval = false;
|
||||
switch (contenttype)
|
||||
{
|
||||
case 20033: // AER table without boarder
|
||||
case 20034: // Centered table without boarder
|
||||
rtnval = true;
|
||||
break;
|
||||
}
|
||||
return rtnval;
|
||||
}
|
||||
|
||||
//private static bool AddContentDetail(Content content, int type, string strn)
|
||||
//{
|
||||
// if (strn != null && strn.Trim() != "" )
|
||||
// {
|
||||
// content.ContentDetails.Add(type, strn);
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
|
||||
private string GetParent(string s)
|
||||
{
|
||||
string retval = "S";
|
||||
if (s.Length > 1)
|
||||
{
|
||||
int l = s.Length;
|
||||
if ("!*".IndexOf(s[l - 2]) > -1)
|
||||
{
|
||||
if (l > 2) retval = s.Substring(0, l - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = s.Substring(0, l - 1);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private string GetStructType(string s)
|
||||
{
|
||||
string retval = "S";
|
||||
if (s.Length > 1)
|
||||
{
|
||||
int l = s.Length;
|
||||
if ("!*".IndexOf(s[l - 2]) > -1)
|
||||
{
|
||||
if (s[l - 2] == '!') retval = "C";
|
||||
else retval = "N";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s[l - 1] == '$') retval = "R";
|
||||
if (s[l - 1] == '#') retval = "T";
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret, string pth, DocVersion docver, FormatInfo fmt, Item parentItem, int frTypeParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
string sType = GetStructType(drv["CSequence"].ToString());
|
||||
Item item = AddStep(cn, drv["Type"].ToString()
|
||||
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", FromItem // was str
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret, pth, docver, fmt, parentItem, frTypeParam
|
||||
, drv["Step"].ToString() + drv["CSequence"].ToString());
|
||||
|
||||
//Content cont = Content.MakeContent(null,(drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString()),drv["Type"]+20000,null,null,
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Item item = Item.MakeItem(FromItem, cont, cont.DTS, cont.UserID);
|
||||
//Structure str = AddStructure(FromType, FromID, 3, tmpid, drv["CStep"].ToString() + drv["CSequence"].ToString(),
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Step stp = AddStep(cn, drv["Type"].ToString()
|
||||
// , (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
// , drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", str
|
||||
// , GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
Dictionary<string, Item> dicStep = new Dictionary<string, Item>();
|
||||
dicStep[drv["CSequence"].ToString()] = item;
|
||||
Dictionary<string, Dictionary<string, Item>> dicStruct = new Dictionary<string, Dictionary<string, Item>>();
|
||||
Dictionary<string, Item> dicBase = new Dictionary<string, Item>();
|
||||
dicStruct[drv["CSequence"].ToString()] = dicBase;
|
||||
dicBase[""] = item;
|
||||
// Logic to add Sub-steps
|
||||
string sQry = "CStep = '" + drv["CStep"].ToString() + "' and CSequence <> 'S'";
|
||||
// sort order - for sections use currentrows.
|
||||
DataView dv = new DataView(dt, sQry, "StepNo,Level,SubStepNo", DataViewRowState.CurrentRows);
|
||||
//dataGrid1.DataSource=dv;
|
||||
//Loop through DataView and add Steps one at a time
|
||||
//Console.WriteLine("={0}",drv["Step"]);
|
||||
int FrType = 0; // type of relationship (not type of step)
|
||||
Item FrItem = item;
|
||||
foreach (DataRowView drvs in dv)
|
||||
{
|
||||
//Console.WriteLine(">{0}",drvs["CStep"]);
|
||||
|
||||
string sParent = GetParent(drvs["CSequence"].ToString());
|
||||
if (dicStep.ContainsKey(sParent))
|
||||
{
|
||||
if (dicStep[sParent] == null) Console.WriteLine("jcb");
|
||||
Item itemp = dicStep[sParent];
|
||||
sType = GetStructType(drvs["CSequence"].ToString());
|
||||
Dictionary<string,Item> dicStr = dicStruct[sParent];
|
||||
// check if a step type of 'sType' exists to see if child/sibling
|
||||
//Content contc = Content.MakeContent(null,(drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString()),drvs["Type"]+20000,null,null,
|
||||
// GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString()));
|
||||
Item itemc = null;
|
||||
if (dicStr.ContainsKey(sType)) // next sibling
|
||||
{
|
||||
FrItem = dicStr[sType];
|
||||
FrType = 0;
|
||||
}
|
||||
else // child of a node
|
||||
{
|
||||
FrItem = null;
|
||||
FrType = (3 + ("CNRST".IndexOf(sType)));
|
||||
}
|
||||
|
||||
itemc = AddStep(cn, drvs["Type"].ToString()
|
||||
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
||||
, drvs["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString()
|
||||
, GetStructType(drvs["sequence"].ToString()), FrItem
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret, pth, docver, fmt, itemp, FrType
|
||||
, drvs["Step"].ToString() + drvs["CSequence"].ToString());
|
||||
//if (FrType > 0 )
|
||||
//{
|
||||
// itemp.MyContent.ContentParts.Add(FrType, itemc);
|
||||
// if (!itemp.MyContent.IsSavable) ErrorRpt.ErrorReport(itemp.MyContent);
|
||||
// itemp.MyContent.Save();
|
||||
//}
|
||||
dicStr[sType] = itemc;
|
||||
dicStruct[drvs["CSequence"].ToString()] = new Dictionary<string, Item>();
|
||||
dicStep[drvs["CSequence"].ToString()] = itemc;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.ErrorFormat("Parent {0} Could not be found for {1}", sParent, drvs["sequence"].ToString());
|
||||
}
|
||||
}
|
||||
dv.Dispose();
|
||||
return item;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
frmMain.AddError(ex, "MigrateStep");
|
||||
log.Error("PROCESS STEP");
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,422 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret, string pth, DocVersion docver)
|
||||
{
|
||||
string whereami = "1";
|
||||
Content content = null;
|
||||
Item item = null;
|
||||
|
||||
frmMain.UpdateLabels(0, 0, 1);
|
||||
ConfigInfo ci = new ConfigInfo(null);
|
||||
string stptext = null;
|
||||
if (userid == null || userid == "") userid = "Migration";
|
||||
int tok = -1;
|
||||
//char[] chrarr = { '\x1', '\x2', '\x3', '\x5' };
|
||||
char[] chrarr = { '\x1', '\x2', '\x3' };
|
||||
try
|
||||
{
|
||||
// the textm field has step text, but also may have other text stored
|
||||
// with it with a 'token' as a separator (see below).
|
||||
tok = Textm.IndexOfAny(chrarr);
|
||||
|
||||
// This will find a continuous action flag without finding a hanging indent
|
||||
if (tok == 0 && Textm[Textm.Length - 1] == '\x5')
|
||||
tok = Textm.Length - 1;
|
||||
|
||||
if (tok < 0)
|
||||
stptext = TextConvert.ConvertText(Textm, conv_caret);
|
||||
else
|
||||
stptext = TextConvert.ConvertText(Textm.Substring(0, tok), conv_caret);
|
||||
|
||||
string seqcvt = TextConvert.ConvertSeq(stpseq);
|
||||
|
||||
// Figure marker - it should NEVER get here!!!
|
||||
int tokfig = Textm.IndexOf('\xE8');
|
||||
if (tokfig > -1)
|
||||
{
|
||||
log.Error("Found a old style figure!");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
}
|
||||
string newstptyp = null;
|
||||
bool ManualPagebreak = false;
|
||||
char cbittst = StepType.PadRight(2)[0];
|
||||
if (cbittst != ' ' && (cbittst & 0x80) > 1)
|
||||
{
|
||||
ManualPagebreak = true;
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Step", "ManualPagebreak", "True");
|
||||
newstptyp = StepType.Substring(1, 1);
|
||||
}
|
||||
if (InES32 && stpseq == "A3S11")
|
||||
Console.WriteLine("here");
|
||||
whereami = "2";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
// Need the content record for the RO & transitions.
|
||||
//content = Content.MakeContent(null, stptext, 20000 + int.Parse(newstptyp!=null?newstptyp:StepType),null, ManualPagebreak?ci.ToString():null, dts, userid);
|
||||
// 20000 flags step type item & 1 adjusts for 'base' in format files.
|
||||
int contenttype = (structtype == "R") ? 20040 : 20001 + int.Parse(newstptyp != null ? newstptyp : StepType);
|
||||
whereami = "2.1";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
content = Content.New(null, stptext, contenttype, null, ManualPagebreak ? ci.ToString() : null, dts, userid);
|
||||
whereami = "2.1.1";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
content.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq;
|
||||
whereami = "2.1.2";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
// Before we save it, handle RO & Transitions tokens.
|
||||
int tokrt = Textm.IndexOf('\x15');
|
||||
bool txtdirty = false;
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
whereami = "2.2";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
stptext = MigrateRos(cn, stptext, seqcvt, content, docver, conv_caret);
|
||||
whereami = "2.3";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}, stepseq = {1}", whereami, stpseq);
|
||||
stptext = stptext.TrimEnd(" ".ToCharArray());
|
||||
}
|
||||
whereami = "3";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
// 16-bit code has the following two defines.
|
||||
// #define TransitionMarker 0xC2
|
||||
// #define ReferenceMarker 0xCB
|
||||
// these two characters get converted (to unicode) from ado.net
|
||||
// use the unicode chars.
|
||||
char[] chrrotrn = { '\x252C', '\x2566' };
|
||||
tokrt = Textm.IndexOfAny(chrrotrn);
|
||||
_TransitionMigrationErrors = new List<string>();
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = MigrateTrans(cn, stptext, seqcvt, content, pth);
|
||||
stptext = stptext.TrimEnd(" ".ToCharArray());
|
||||
}
|
||||
if (txtdirty)
|
||||
{
|
||||
content.Text = stptext;
|
||||
//content.Save();
|
||||
}
|
||||
whereami = "4";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||
List<string> migrationerrors = null;
|
||||
if (_ContentMigrationErrors.ContainsKey(content.ContentID))
|
||||
migrationerrors = _ContentMigrationErrors[content.ContentID];
|
||||
content.Save();
|
||||
whereami = "5";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
// check if already created thru new during transition migration...
|
||||
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + seqcvt))
|
||||
{
|
||||
item = dicTrans_ItemIds[ProcNumber + "|" + seqcvt];
|
||||
item.MyPrevious = FromItem;
|
||||
item.MyContent = content;
|
||||
item.DTS = dts;
|
||||
item.UserID = userid;
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item.Save();
|
||||
dicTrans_ItemIds.Remove(ProcNumber + "|" + seqcvt);
|
||||
dicTrans_MigrationErrors.Remove(ProcNumber + "|" + seqcvt);
|
||||
}
|
||||
else
|
||||
item = Item.MakeItem(FromItem, content, content.DTS, content.UserID);
|
||||
if (migrationerrors != null)
|
||||
{
|
||||
foreach (string str in migrationerrors)
|
||||
{
|
||||
ItemAnnotation ia = item.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = str;
|
||||
}
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item.Save();
|
||||
}
|
||||
if (_TransitionMigrationErrors.Count > 0)
|
||||
{
|
||||
foreach (string str in _TransitionMigrationErrors)
|
||||
{
|
||||
if (!dicTrans_MigrationErrors.ContainsKey(str))
|
||||
dicTrans_MigrationErrors.Add(str, new List<Item>());
|
||||
dicTrans_MigrationErrors[str].Add(item);
|
||||
}
|
||||
}
|
||||
dicTrans_ItemDone[ProcNumber + "|" + seqcvt] = item;
|
||||
dicOldStepSequence[content] = seqcvt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
log.Error("Save Step");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
item = null;
|
||||
}
|
||||
|
||||
// now add on any support pieces of text associated with the step.
|
||||
// These include:
|
||||
// '\1' comment
|
||||
// '\2' multiple change ids and/or change message
|
||||
// '\3' linked sequence
|
||||
// '\3\3'override tab
|
||||
// '\5' continuous action summary flag (only if last char in string)
|
||||
// This assumes that these tokens are stored in reverse order that
|
||||
// they are processed.
|
||||
|
||||
|
||||
bool recdirty = false;
|
||||
try
|
||||
{
|
||||
whereami = "6";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
if (tok >= 0 && tok != Textm.Length)
|
||||
{
|
||||
string tkstring = Textm.Substring(tok);
|
||||
int nxttok = 0;
|
||||
|
||||
if (tkstring[tkstring.Length - 1] == '\x5') // Continuous Action Summary
|
||||
{
|
||||
recdirty = true;
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Step", "ContActSum", "True");
|
||||
tkstring = tkstring.Substring(0, tkstring.Length - 1); // strip off Continuous Action Token
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x3\x3")) > -1) // Enhanced Override Tab
|
||||
{
|
||||
Console.WriteLine("Override Tab: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "OverrideTab", tkstring.Substring(nxttok + 2));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_OVR_TAB, tkstring.Substring(nxttok + 2));
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x3")) > -1) //Linked Sequence
|
||||
{
|
||||
Console.WriteLine("Linked Seq: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "LinkedSeq", TextConvert.ConvertSeq(tkstring.Substring(nxttok + 1)));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_LNK_SEQ, TextConvert.ConvertSeq(tkstring.Substring(nxttok + 1)));
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x2")) > -1) // Multiple Change Ids
|
||||
{
|
||||
//Console.WriteLine("Multiple Change ID: {0}", tkstring.Substring(nxttok + 1));
|
||||
ci.AddItem("Step", "MultipleChangeID", tkstring.Substring(nxttok + 1));
|
||||
recdirty = true;
|
||||
//recdirty |= AddContentDetail(content, STP_MULT_CHGID, tkstring.Substring(nxttok + 1));
|
||||
tkstring = tkstring.Substring(0, nxttok);
|
||||
}
|
||||
|
||||
if ((nxttok = tkstring.IndexOf("\x1")) > -1) // Comment
|
||||
{
|
||||
// add the comment to annotation table. Set type to comment.
|
||||
Console.WriteLine("Comment text: {0}", tkstring.Substring(nxttok + 1));
|
||||
Annotation annot = Annotation.MakeAnnotation(item, CommentType, null, tkstring.Substring(nxttok + 1), null, dts, userid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// also see if a check-off needs added.
|
||||
if (Recid[0] != '0')
|
||||
{
|
||||
recdirty = true;
|
||||
string chkindx = Recid[0].ToString();
|
||||
//if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Step", "CheckOffIndex", chkindx);
|
||||
}
|
||||
|
||||
// here's where it knows if it's a linked step (or in processstep)
|
||||
if (Recid[1] != '0')
|
||||
{
|
||||
// do linked step stuff.
|
||||
}
|
||||
|
||||
// if checkoffs or the continuous action summary flag, save the xml.
|
||||
if (recdirty)
|
||||
{
|
||||
if (ci.ItemCount != 0) content.Config = ci.ToString();
|
||||
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||
whereami = "7";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
content.Save();
|
||||
whereami = "8";
|
||||
if (InES32) Console.WriteLine("Addstep whereami {0}", whereami);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Subtexts: {0} {1}", ex.GetType().Name, ex.Message);
|
||||
log.Error("Save Step part 2");
|
||||
log.ErrorFormat("oldstepsequence = {0}", stpseq);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//private static bool AddContentDetail(Content content, int type, string strn)
|
||||
//{
|
||||
// if (strn != null && strn.Trim() != "" )
|
||||
// {
|
||||
// content.ContentDetails.Add(type, strn);
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
|
||||
private string GetParent(string s)
|
||||
{
|
||||
string retval = "S";
|
||||
if (s.Length > 1)
|
||||
{
|
||||
int l = s.Length;
|
||||
if ("!*".IndexOf(s[l - 2]) > -1)
|
||||
{
|
||||
if (l > 2) retval = s.Substring(0, l - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = s.Substring(0, l - 1);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private string GetStructType(string s)
|
||||
{
|
||||
string retval = "S";
|
||||
if (s.Length > 1)
|
||||
{
|
||||
int l = s.Length;
|
||||
if ("!*".IndexOf(s[l - 2]) > -1)
|
||||
{
|
||||
if (s[l - 2] == '!') retval = "C";
|
||||
else retval = "N";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s[l - 1] == '$') retval = "R";
|
||||
if (s[l - 1] == '#') retval = "T";
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
public bool InES32 = false;
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret, string pth, DocVersion docver)
|
||||
{
|
||||
//string whereami = "1";
|
||||
try
|
||||
{
|
||||
string sType = GetStructType(drv["CSequence"].ToString());
|
||||
//whereami = "2";
|
||||
//if (InES32) Console.WriteLine("MigrateStep whereami {0}", whereami);
|
||||
Item item = AddStep(cn, drv["Type"].ToString()
|
||||
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", FromItem // was str
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret, pth, docver);
|
||||
//whereami = "3";
|
||||
//if (InES32) Console.WriteLine("MigrateStep whereami {0}", whereami);
|
||||
//Content cont = Content.MakeContent(null,(drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString()),drv["Type"]+20000,null,null,
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Item item = Item.MakeItem(FromItem, cont, cont.DTS, cont.UserID);
|
||||
//Structure str = AddStructure(FromType, FromID, 3, tmpid, drv["CStep"].ToString() + drv["CSequence"].ToString(),
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Step stp = AddStep(cn, drv["Type"].ToString()
|
||||
// , (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
// , drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", str
|
||||
// , GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
Dictionary<string, Item> dicStep = new Dictionary<string, Item>();
|
||||
dicStep[drv["CSequence"].ToString()] = item;
|
||||
Dictionary<string, Dictionary<string, Item>> dicStruct = new Dictionary<string, Dictionary<string, Item>>();
|
||||
Dictionary<string, Item> dicBase = new Dictionary<string, Item>();
|
||||
dicStruct[drv["CSequence"].ToString()] = dicBase;
|
||||
dicBase[""] = item;
|
||||
// Logic to add Sub-steps
|
||||
string sQry = "CStep = '" + drv["CStep"].ToString() + "' and CSequence <> 'S'";
|
||||
// sort order - for sections use currentrows.
|
||||
//whereami = "4";
|
||||
//if (InES32) Console.WriteLine("MigrateStep whereami {0}", whereami);
|
||||
DataView dv = new DataView(dt, sQry, "StepNo,Level,SubStepNo", DataViewRowState.CurrentRows);
|
||||
//dataGrid1.DataSource=dv;
|
||||
//Loop through DataView and add Steps one at a time
|
||||
//Console.WriteLine("={0}",drv["Step"]);
|
||||
int FrType = 0; // type of relationship (not type of step)
|
||||
Item FrItem = item;
|
||||
foreach (DataRowView drvs in dv)
|
||||
{
|
||||
//Console.WriteLine(">{0}",drvs["CStep"]);
|
||||
|
||||
string sParent = GetParent(drvs["CSequence"].ToString());
|
||||
if (dicStep.ContainsKey(sParent))
|
||||
{
|
||||
Item itemp = dicStep[sParent];
|
||||
sType = GetStructType(drvs["CSequence"].ToString());
|
||||
Dictionary<string,Item> dicStr = dicStruct[sParent];
|
||||
// check if a step type of 'sType' exists to see if child/sibling
|
||||
//Content contc = Content.MakeContent(null,(drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString()),drvs["Type"]+20000,null,null,
|
||||
// GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString()));
|
||||
Item itemc = null;
|
||||
if (dicStr.ContainsKey(sType)) // next sibling
|
||||
{
|
||||
FrItem = dicStr[sType];
|
||||
FrType = 0;
|
||||
}
|
||||
else // child of a node
|
||||
{
|
||||
FrItem = null;
|
||||
FrType = (3 + ("CNRST".IndexOf(sType)));
|
||||
}
|
||||
//whereami = "5";
|
||||
itemc = AddStep(cn, drvs["Type"].ToString()
|
||||
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString()
|
||||
, GetStructType(drvs["sequence"].ToString()), FrItem
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret, pth, docver);
|
||||
|
||||
if (FrType > 0 )
|
||||
{
|
||||
itemp.MyContent.ContentParts.Add(FrType, itemc);
|
||||
if (!itemp.MyContent.IsSavable) ErrorRpt.ErrorReport(itemp.MyContent);
|
||||
itemp.MyContent.Save();
|
||||
}
|
||||
//whereami = "6";
|
||||
dicStr[sType] = itemc;
|
||||
dicStruct[drvs["CSequence"].ToString()] = new Dictionary<string, Item>();
|
||||
dicStep[drvs["CSequence"].ToString()] = itemc;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.ErrorFormat("Parent {0} Could not be found for {1}", sParent, drvs["sequence"].ToString());
|
||||
}
|
||||
}
|
||||
//if (InES32) Console.WriteLine("MigrateStep end");
|
||||
return item;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
log.Error("PROCESS STEP");
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
log.ErrorFormat(ex.StackTrace);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,521 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public static class TextConvert
|
||||
{
|
||||
static TextConvert()
|
||||
{
|
||||
BuildDictionarySeq();
|
||||
BuildDictionaryText();
|
||||
}
|
||||
|
||||
private static Dictionary<int, int> dicChar;
|
||||
public static void BuildDictionarySeq()
|
||||
{
|
||||
dicChar = new Dictionary<int, int>();
|
||||
for (int i = 0; i < 128; i++) dicChar[i] = i;
|
||||
dicChar[199] = 128; dicChar[252] = 129; dicChar[233] = 130; dicChar[226] = 131;
|
||||
dicChar[228] = 132; dicChar[224] = 133; dicChar[229] = 134; dicChar[231] = 135;
|
||||
dicChar[234] = 136; dicChar[235] = 137; dicChar[232] = 138; dicChar[239] = 139;
|
||||
dicChar[238] = 140; dicChar[236] = 141; dicChar[196] = 142; dicChar[197] = 143;
|
||||
dicChar[201] = 144; dicChar[230] = 145; dicChar[198] = 146; dicChar[244] = 147;
|
||||
dicChar[246] = 148; dicChar[242] = 149; dicChar[251] = 150; dicChar[249] = 151;
|
||||
dicChar[255] = 152; dicChar[214] = 153; dicChar[220] = 154; dicChar[162] = 155;
|
||||
dicChar[163] = 156; dicChar[165] = 157; dicChar[8359] = 158; dicChar[402] = 159;
|
||||
dicChar[225] = 160; dicChar[237] = 161; dicChar[243] = 162; dicChar[250] = 163;
|
||||
dicChar[241] = 164; dicChar[209] = 165; dicChar[170] = 166; dicChar[186] = 167;
|
||||
dicChar[191] = 168; dicChar[8976] = 169; dicChar[172] = 170; dicChar[189] = 171;
|
||||
dicChar[188] = 172; dicChar[161] = 173; dicChar[171] = 174; dicChar[187] = 175;
|
||||
dicChar[9617] = 176; dicChar[9618] = 177; dicChar[9619] = 178; dicChar[9474] = 179;
|
||||
dicChar[9508] = 180; dicChar[9569] = 181; dicChar[9570] = 182; dicChar[9558] = 183;
|
||||
dicChar[9557] = 184; dicChar[9571] = 185; dicChar[9553] = 186; dicChar[9559] = 187;
|
||||
dicChar[9565] = 188; dicChar[9564] = 189; dicChar[9563] = 190; dicChar[9488] = 191;
|
||||
dicChar[9492] = 192; dicChar[9524] = 193; dicChar[9516] = 194; dicChar[9500] = 195;
|
||||
dicChar[9472] = 196; dicChar[9532] = 197; dicChar[9566] = 198; dicChar[9567] = 199;
|
||||
dicChar[9562] = 200; dicChar[9556] = 201; dicChar[9577] = 202; dicChar[9574] = 203;
|
||||
dicChar[9568] = 204; dicChar[9552] = 205; dicChar[9580] = 206; dicChar[9575] = 207;
|
||||
dicChar[9576] = 208; dicChar[9572] = 209; dicChar[9573] = 210; dicChar[9561] = 211;
|
||||
dicChar[9560] = 212; dicChar[9554] = 213; dicChar[9555] = 214; dicChar[9579] = 215;
|
||||
dicChar[9578] = 216; dicChar[9496] = 217; dicChar[9484] = 218; dicChar[9608] = 219;
|
||||
dicChar[9604] = 220; dicChar[9612] = 221; dicChar[9616] = 222; dicChar[9600] = 223;
|
||||
dicChar[945] = 224; dicChar[223] = 225; dicChar[915] = 226; dicChar[960] = 227;
|
||||
dicChar[931] = 228; dicChar[963] = 229; dicChar[181] = 230; dicChar[964] = 231;
|
||||
dicChar[934] = 232; dicChar[920] = 233; dicChar[937] = 234; dicChar[948] = 235;
|
||||
dicChar[8734] = 236; dicChar[966] = 237; dicChar[949] = 238; dicChar[8745] = 239;
|
||||
dicChar[8801] = 240; dicChar[177] = 241; dicChar[8805] = 242; dicChar[8804] = 243;
|
||||
dicChar[8992] = 244; dicChar[8993] = 245; dicChar[247] = 246; dicChar[8776] = 247;
|
||||
dicChar[176] = 248; dicChar[8729] = 249; dicChar[183] = 250; dicChar[8730] = 251;
|
||||
dicChar[8319] = 252; dicChar[178] = 253; dicChar[9632] = 254; dicChar[160] = 255;
|
||||
}
|
||||
public static string ConvertSeq(string s1)
|
||||
{
|
||||
Encoding Eibm437 = Encoding.GetEncoding(437);
|
||||
Encoding Eunicode = Encoding.Unicode;
|
||||
Decoder d = Eibm437.GetDecoder();
|
||||
Byte[] bs1 = Eunicode.GetBytes(s1);
|
||||
Byte[] bs2 = Encoding.Convert(Eunicode, Eibm437, bs1);
|
||||
char[] cs2 = new char[Eibm437.GetCharCount(bs2)];
|
||||
for (int i = 0; i < cs2.Length; i++) cs2[i] = (char)bs2[i];
|
||||
return new string(cs2);
|
||||
}
|
||||
|
||||
public static Regex Reg2;
|
||||
public static void BuildDictionaryText()
|
||||
{
|
||||
dicChar = new Dictionary<int, int>();
|
||||
dicChar[966] = 216;
|
||||
dicChar[201] = 274;
|
||||
dicChar[127] = 916;
|
||||
dicChar[964] = 947;
|
||||
dicChar[920] = 952;
|
||||
dicChar[915] = 961;
|
||||
dicChar[191] = 964;
|
||||
dicChar[8801] = 8773;
|
||||
dicChar[8734] = 8857;
|
||||
dicChar[7] = 9679;
|
||||
dicChar[8976] = 9830;
|
||||
dicChar[9632] = 9604;
|
||||
//dicChar[236] = 38914;
|
||||
char[] creg = new char[dicChar.Count];
|
||||
int i = 0;
|
||||
foreach (int ic in dicChar.Keys)
|
||||
{
|
||||
creg[i] = (char)ic;
|
||||
i++;
|
||||
}
|
||||
Reg2 = new Regex("[" + new string(creg) + "]");
|
||||
}
|
||||
public static string ReplaceChars(Match m)
|
||||
{
|
||||
char[] cs = m.Value.ToCharArray();
|
||||
for (int i = 0; i < cs.Length; i++)
|
||||
{
|
||||
if (dicChar.ContainsKey((int)(cs[i])))
|
||||
{
|
||||
int iKey = (int)cs[i];
|
||||
int iValue = dicChar[iKey];
|
||||
cs[i] = (char)iValue;
|
||||
}
|
||||
}
|
||||
return new string(cs);
|
||||
}
|
||||
public static string ConvertText(string s1, bool DoCaret)
|
||||
{
|
||||
string s2 = s1;
|
||||
if (DoCaret) s2 = s2.Replace("^", @"\u916?");
|
||||
return ConvertText(s2);
|
||||
}
|
||||
private static void ShowRawString(string str, string title)
|
||||
{
|
||||
Console.WriteLine("Raw Start --{0}:\n", title);
|
||||
foreach (char c in str)
|
||||
{
|
||||
int ic = (int)c;
|
||||
if (c != '\n' && (ic > 126 || ic < 32))
|
||||
Console.Write("<<{0:x4}>>", ic);
|
||||
else
|
||||
Console.Write(c);
|
||||
}
|
||||
Console.WriteLine("\n-- Raw End:{0}", title);
|
||||
}
|
||||
|
||||
public static string ReplaceUnicode(string s2)
|
||||
{
|
||||
return ReplaceUnicode(s2, false);
|
||||
}
|
||||
public static string ReplaceUnicode(string s2, bool DoCaret)
|
||||
{
|
||||
//char[] tmp;
|
||||
//tmp = s2.ToCharArray();
|
||||
string orig = s2;
|
||||
//ShowRawString(s2, "ReplaceUnicode");
|
||||
s2 = s2.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days.
|
||||
s2 = s2.Replace("\xa0",@"\u160?"); // hardspace
|
||||
s2 = s2.Replace("\xb0", @"\'b0"); // degree
|
||||
s2 = s2.Replace("\x7f", @"\u916?"); // delta
|
||||
s2 = s2.Replace("\x2265",@"\u8805?"); // greater than or equal
|
||||
s2 = s2.Replace("\x2264",@"\u8804?"); // less than or equal
|
||||
s2 = s2.Replace("\xB1",@"\'b1"); // plus minus
|
||||
s2 = s2.Replace("\x3A3",@"\u931?"); // sigma
|
||||
s2 = s2.Replace("\x3C4",@"\u947?"); // gamma
|
||||
s2 = s2.Replace("\xBD",@"\'bd"); // half
|
||||
s2 = s2.Replace("\x25A0",@"\u9604?"); // accum 2584
|
||||
s2 = s2.Replace("\x7",@"\u9679?"); // bullet 25CF
|
||||
s2 = s2.Replace("\x2248",@"\u8776?"); // approx eq
|
||||
s2 = s2.Replace("\x2261",@"\u8773?"); // similar eq 2245
|
||||
s2 = s2.Replace("\xF7",@"\'f7"); // division
|
||||
s2 = s2.Replace("\x221A",@"\u8730?"); // square root
|
||||
s2 = s2.Replace("\x393",@"\u961?"); // rho 3C1
|
||||
s2 = s2.Replace("\x3C0",@"\u960?"); // pi
|
||||
s2 = s2.Replace("\xb5", @"\u956?"); // micro 3BC (try e6, if not work try 109)
|
||||
s2 = s2.Replace("\x3B4", @"\u948?"); // lower case delta
|
||||
s2 = s2.Replace("\x3C3", @"\u963?"); // lower case sigma
|
||||
s2 = s2.Replace("\xBC", @"\'bc"); // quarter
|
||||
s2 = s2.Replace("\x256A", @"\'d8"); // dist zero, D8
|
||||
s2 = s2.Replace("\x3C6", @"\'d8"); // dist zero, D8
|
||||
s2 = s2.Replace("\xC9", @"\u274?"); // energy, 112
|
||||
s2 = s2.Replace("\xEC", @"\'ec"); // grave
|
||||
s2 = s2.Replace("\x2502", @"\u9474?"); // bar
|
||||
s2 = s2.Replace("\x3B5", @"\u949?"); // epsilon
|
||||
s2 = s2.Replace("\x398", @"\u952?"); // theta, 3B8
|
||||
s2 = s2.Replace("\x221E", @"\u8857?"); // dot in oval, 2299
|
||||
s2 = s2.Replace("\xBF", @"\u964?"); // tau, 3C4
|
||||
s2 = s2.Replace("\x2310", @"\u9830?"); // diamond, 2666
|
||||
s2 = s2.Replace("\x2192", @"\u8594?");
|
||||
s2 = s2.Replace("\x2190", @"\u8592?");
|
||||
s2 = s2.Replace("\x2191", @"\u8593?");
|
||||
s2 = s2.Replace("\x2193", @"\u8595?");
|
||||
s2 = s2.Replace("\x2207", @"\u8711?");
|
||||
s2 = s2.Replace("\x2591", @"\'b0"); // Degree Symbol
|
||||
s2 = s2.Replace("\xFF", @"\u8593?"); // Up Arrow
|
||||
s2 = s2.Replace("\xD6", @"\u8595?"); // Down Arrow
|
||||
|
||||
if (DoCaret) s2 = s2.Replace("^", @"\u916?");
|
||||
//s2 = s2.Replace("^", @"\u916");
|
||||
|
||||
//s2 = ConvertDOSSuperAndSubScripts(s2);
|
||||
string sBefore = s2;
|
||||
s2 = ConvertFortranFormatToScienctificNotation(s2);
|
||||
if (sBefore != s2)
|
||||
MyGlitches.Add("ConvertFortranFormatToScienctificNotation", sBefore, s2);
|
||||
// Convert dash to a non-breaking dash. This is a unicode character.
|
||||
// This character will be used in veproms rather than a dash.
|
||||
//if the dash is preceeded byte a token remove the space following the token
|
||||
//#if DEBUG
|
||||
if (VlnSettings.DebugMode)
|
||||
{
|
||||
if (s2.Contains(@"\super "))
|
||||
Console.WriteLine("RTF Super token");
|
||||
}
|
||||
//#endif
|
||||
s2 = Regex.Replace(s2, @"(\\[^ \\?]*) \-", @"$1\u8209?");
|
||||
//KBR s2 = s2.Replace("-", @"\u8209?");
|
||||
//Remove spaces between comment end nad Next token
|
||||
s2 = s2.Replace(@"\v0 \", @"\v0\");
|
||||
//Change Token Order to match RTB output
|
||||
s2 = s2.Replace(@"\v0\b0", @"\b0\v0");
|
||||
s2 = s2.Replace(@"\b0\ulnone", @"\ulnone\b0");
|
||||
s2 = s2.Replace(@"\par ", "\r\n");
|
||||
return s2;
|
||||
}
|
||||
private static DataLoaderGlitches _MyGlitches;
|
||||
public static DataLoaderGlitches MyGlitches
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyGlitches == null)
|
||||
_MyGlitches = new DataLoaderGlitches();
|
||||
return _MyGlitches;
|
||||
}
|
||||
set { _MyGlitches = value; }
|
||||
}
|
||||
public static string ConvertFortranFormatToScienctificNotation(string str)
|
||||
{
|
||||
// Convert E style numbers to RTF with \super and \nosupersub
|
||||
string retval = Regex.Replace(str, "([+-]?)([0-9]+)[.]([0-9]*?)0*E([+-]?[0-9]+)", new MatchEvaluator(FixFortranNumber));
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static string ConvertDOSSuperAndSubScripts(string instr)
|
||||
{
|
||||
try
|
||||
{
|
||||
string retval = Regex.Replace(instr, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript
|
||||
retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript
|
||||
return retval;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Error in ConvertDOSSuperAndSubScripts");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
private static string FixFortranNumber(Match match)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(match.Groups[1].Value);
|
||||
if (match.Groups[3].Length == 0) // Nothing to the right of the decimal
|
||||
if (match.Groups[2].Value != "1") // Other than "1", multiply it times 10 raised to a power
|
||||
sb.Append(match.Groups[2].Value + "x10");
|
||||
else // The number is simply 1 so it can be ignored and 10 can be raised to a power
|
||||
sb.Append("10");
|
||||
else // A number with a decimal point
|
||||
sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10");
|
||||
// Add the exponent as superscript
|
||||
return sb.ToString() + "\\up2 " + match.Groups[4].Value + "\\up0 ";
|
||||
}
|
||||
#region CommentedOut
|
||||
//private static string ConvertFortranFormatToScienctificNotation(string str)
|
||||
//{
|
||||
// string outstr = "";
|
||||
// int orglen = str.Length;
|
||||
// int cnt = 0;
|
||||
// int ptr;
|
||||
|
||||
// int nbytes;
|
||||
// int tstr, tstr2, rptr, start = 0;
|
||||
|
||||
// while (cnt < orglen)
|
||||
// {
|
||||
// // position up to the the next number, sign, or period
|
||||
// ptr = str.IndexOfAny("+-0123456789.".ToCharArray(), cnt);
|
||||
// if (ptr == -1)
|
||||
// {
|
||||
// outstr += str.Substring(cnt);
|
||||
// break; // jump out of while loop - nothing else to process
|
||||
// }
|
||||
// if ((ptr - cnt) > 0)
|
||||
// {
|
||||
// outstr += str.Substring(cnt, ptr - cnt);
|
||||
// cnt = ptr;
|
||||
// }
|
||||
|
||||
// if (cnt > start && str[cnt - 1] == '\'')
|
||||
// {
|
||||
// //B2003-053: only remove the single quote character
|
||||
// // if str ptr is not at the end of the string or
|
||||
// // the next char (after the str ptr) is not a space
|
||||
// // or newline... (as per Paul Linn on 7/17/03)
|
||||
// int len = orglen - cnt;
|
||||
// if (len <= 1 || str[cnt + 1] == ' ' || str[cnt + 1] == '\n')
|
||||
// start = cnt;
|
||||
// else
|
||||
// start = cnt - 1;
|
||||
// }
|
||||
// else start = cnt;
|
||||
// tstr = cnt;
|
||||
|
||||
// //Skip preceeding signs
|
||||
// if (str[cnt] == '+' || str[cnt] == '-')
|
||||
// cnt++;
|
||||
|
||||
// cnt = NextNonNumber(str, cnt);
|
||||
// if ((cnt < str.Length -1) && str[cnt] == '.')
|
||||
// {
|
||||
// cnt = NextNonNumber(str, cnt + 1);
|
||||
// if (str[start] == '\'')
|
||||
// {
|
||||
// start++;
|
||||
// }
|
||||
// else if ((cnt < str.Length -1) && (str[cnt] == 'E') && (cnt > tstr))
|
||||
// {
|
||||
// nbytes = (cnt - tstr); // don't include the 'E'
|
||||
// outstr += str.Substring(tstr, nbytes);
|
||||
// cnt++;
|
||||
|
||||
// rptr = outstr.Length - 1;
|
||||
// while (outstr[rptr] == '0') rptr--;
|
||||
// if (outstr[rptr] != '.') rptr++;
|
||||
// if (rptr < (outstr.Length - 1))
|
||||
// outstr = outstr.Substring(0, rptr + 1); // trim trailing 0's
|
||||
|
||||
// int poutstr = 0;
|
||||
// if (outstr[poutstr] == '+' || outstr[poutstr] == '-') poutstr++;
|
||||
// if (!outstr[poutstr].Equals("1"))
|
||||
// {
|
||||
// outstr += "x1";
|
||||
// }
|
||||
// outstr += "0\\super ";
|
||||
|
||||
// tstr2 = cnt;
|
||||
// if (str[cnt] == '+' || str[cnt] == '-') cnt++;
|
||||
// cnt = NextNonNumber(str, cnt);
|
||||
|
||||
// if (str[cnt] == '.' && char.IsDigit(str, cnt + 1))
|
||||
// cnt = NextNonNumber(str, cnt + 1);
|
||||
|
||||
// nbytes = cnt - tstr2; // +1;
|
||||
// outstr += str.Substring(tstr2, nbytes);
|
||||
// outstr += "\\nosupersub ";
|
||||
|
||||
// if (!char.IsLetterOrDigit(str, cnt) && !char.IsWhiteSpace(str, cnt))
|
||||
// return (str.Substring(tstr));
|
||||
// }
|
||||
// else if (cnt > 0)
|
||||
// {
|
||||
// outstr += str.Substring(start, cnt - start + ((cnt < str.Length) ? 1 : 0));
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// outstr += str.Substring(start, cnt - start + ((cnt < str.Length)?1:0));
|
||||
// cnt++;
|
||||
// }
|
||||
// }
|
||||
// return (outstr);
|
||||
//}
|
||||
|
||||
//private static int NextNonNumber(string str, int cnt)
|
||||
//{
|
||||
// int rtn = 0;
|
||||
// string tstr = str.Substring(cnt);
|
||||
// int len = tstr.Length;
|
||||
// while (rtn < len && char.IsDigit(tstr, rtn)) rtn++;
|
||||
// return rtn + cnt;
|
||||
//}
|
||||
|
||||
//public static string ConvertDOSSuperAndSubScripts(string instr)
|
||||
//{
|
||||
// string outstr = "";
|
||||
// string tstr = instr;
|
||||
// int cnt = 0;
|
||||
// int ptr = 0;
|
||||
// bool issupper = false, issub = false;
|
||||
|
||||
// while (tstr != null && (ptr = tstr.IndexOfAny("#~".ToCharArray(), cnt)) >= 0)
|
||||
// {
|
||||
// if (ptr > cnt)
|
||||
// outstr += tstr.Substring(cnt, ptr - cnt);
|
||||
// switch (tstr[ptr])
|
||||
// {
|
||||
// case '#':
|
||||
// if (issub || issupper)
|
||||
// outstr += "\\nosupersub ";
|
||||
// else
|
||||
// outstr += "\\super ";
|
||||
// issupper = !issupper;
|
||||
// issub = false;
|
||||
// break;
|
||||
// case '~':
|
||||
// if (issupper || issub)
|
||||
// outstr += "\\nosupersub ";
|
||||
// else
|
||||
// outstr += "\\sub ";
|
||||
// issub = !issub;
|
||||
// issupper = false;
|
||||
// break;
|
||||
// }
|
||||
// cnt = ptr + 1;
|
||||
// if (cnt >= tstr.Length)
|
||||
// tstr = null;
|
||||
// else
|
||||
// tstr = instr.Substring(cnt);
|
||||
// cnt = 0;
|
||||
// }
|
||||
// if (tstr != null)
|
||||
// outstr += tstr;
|
||||
// return outstr;
|
||||
//}
|
||||
#endregion
|
||||
public static string ConvertText(string s1)
|
||||
{
|
||||
string s2 = s1;
|
||||
//CompareBeforeAndAfter(s1);
|
||||
s2 = ReplaceUnicode(s2);
|
||||
// now replace underline on/off (AE,AF), super on/off (C6,C7)
|
||||
// bold on/off (D5, D6), subscript on/off (D1 A6), and
|
||||
// italics on/off (B2, DD)
|
||||
//s2 = s2.Replace("\xAB", "\\ul ");
|
||||
//s2 = s2.Replace("\xBB", "\\ulnone ");
|
||||
//s2 = s2.Replace("\x255E", "\\super ");
|
||||
//s2 = s2.Replace("\x255F", "\\nosupersub ");
|
||||
//\xAB -> \\ul and \xBB -> \\ulnone - look for pairs:
|
||||
s2 = Regex.Replace(s2, @"\xAB([^\xBB]*?)\xBB", @"\ul $1\ulnone ");
|
||||
// if there is an underline on without underline off or vice versa, just remove it.
|
||||
if (s2.Contains("\xAB") || s2.Contains("\xBB")) s2 = s2.Replace("\xAB", "").Replace("\xBB", "");
|
||||
s2 = s2.Replace("\x255E", "\\up2 ");
|
||||
s2 = s2.Replace("\x255F", "\\up0 ");
|
||||
s2 = s2.Replace("\x2552", "\\b ");
|
||||
s2 = s2.Replace("\x2553", "\\b0 ");
|
||||
//s2 = s2.Replace("\x2564", "\\sub ");
|
||||
//s2 = s2.Replace("\xAA", "\\nosupersub ");
|
||||
s2 = s2.Replace("\x2564", "\\dn2 ");
|
||||
s2 = s2.Replace("\xAA", "\\up0 ");
|
||||
s2 = s2.Replace("\x2593", "\\i ");
|
||||
s2 = s2.Replace("\x258C", "\\i0 ");
|
||||
s2 = s2.Replace("\x2559", "\\ul\\b ");
|
||||
s2 = s2.Replace("\x2558", "\\b0\\ulnone ");
|
||||
|
||||
// underline next word is 0x17
|
||||
// superscript next is 0x18
|
||||
// subscript next is 0x19
|
||||
// bold next is 0x13
|
||||
|
||||
// \x18([A-Za-z0-9]+)(?:[\x18]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)
|
||||
s2 = Regex.Replace(s2, @"\x18([A-Za-z0-9\-]+)(?:[\x18]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\up2 $1\up0 $2");
|
||||
s2 = Regex.Replace(s2, @"\x19([A-Za-z0-9\-]+)(?:[\x19]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\dn2 $1\up0 $2");
|
||||
s2 = Regex.Replace(s2, @"\x13([A-Za-z0-9\-]+)(?:[\x13]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\b $1\b0 $2");
|
||||
s2 = s2.Replace("\x11", ""); // this was an 'end' string for the above, 16bit just removed this char
|
||||
s2 = s2.Replace("-", @"\u8209?"); // do this here so that super/sub & bold next work.
|
||||
// if the underline is at beginning of text, don't replace the underline token with a space:
|
||||
s2 = Regex.Replace(s2, @"^\x17(([A-Za-z0-9]|\\u[0-9]+\?)+)", @"\ul $1\ulnone ");
|
||||
s2 = Regex.Replace(s2, @"\x17(([A-Za-z0-9]|\\u[0-9]+\?)+)", @" \ul $1\ulnone ");
|
||||
|
||||
s2 = Reg2.Replace(s2, new MatchEvaluator(ReplaceChars));
|
||||
|
||||
// Now prepend an escape character, '\', to any curly brace. The curly brace
|
||||
// is used in rtf land.
|
||||
s2 = s2.Replace(@"{", @"\{");
|
||||
s2 = s2.Replace(@"}", @"\}");
|
||||
s2 = s2.Replace("\n", @"\par "); // line break in tables
|
||||
s2 = s2.Replace(@"\up0 \up2 ", @"\up2 "); //jsj - 18MAR2010 - rbt.Save() seems to do this automatically
|
||||
s2 = s2.Replace(@"\up0 \dn2 ", @"\dn2 "); //jsj - 18MAR2010 - rbt.Save() seems to do this automatically
|
||||
return s2;
|
||||
}
|
||||
|
||||
private static void CompareBeforeAndAfter(string txtBefore)
|
||||
{
|
||||
string txtAfter = ConvertSeq(txtBefore);
|
||||
if (txtAfter != txtBefore)
|
||||
{
|
||||
ListDifference(txtBefore, txtAfter);
|
||||
}
|
||||
}
|
||||
private static Dictionary<int, int> _SpecialChars = new Dictionary<int, int>();
|
||||
private static void ListDifference(string txtBefore, string txtAfter)
|
||||
{
|
||||
int nBefore = txtBefore.Length;
|
||||
int nAfter = txtAfter.Length;
|
||||
int n = nBefore > nAfter ? nAfter : nBefore;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
int chrBefore = (int)(txtBefore[i]);
|
||||
int chrAfter = (int)(txtAfter[i]);
|
||||
if (chrBefore != chrAfter)
|
||||
{
|
||||
if (_SpecialChars.ContainsKey(chrBefore))
|
||||
_SpecialChars[chrBefore]++;
|
||||
else
|
||||
{
|
||||
_SpecialChars.Add(chrBefore, 1);
|
||||
Console.WriteLine("Character Difference 0x{0:X0000} 0x{1:X0000} @ {2}", chrBefore, chrAfter, i);
|
||||
//Console.WriteLine("Text Difference\r\nBefore '{0}'\r\nAfter '{0}'", txtBefore, txtAfter);
|
||||
string prefix = i == 0 ? "" : txtBefore.Substring(0, i - 1);
|
||||
string suffix = i == txtBefore.Length - 1 ? "" : txtBefore.Substring(i + 1);
|
||||
Console.WriteLine("Found in '{0}' 0x{1:X} '{2}'", prefix, chrBefore, suffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nBefore != nAfter)
|
||||
{
|
||||
Console.WriteLine("Length Difference\r\nBefore '{0}'\r\nAfter '{0}'", txtBefore, txtAfter);
|
||||
}
|
||||
}
|
||||
public static void ListSpecialCharacters()
|
||||
{
|
||||
Console.WriteLine("Special Characters");
|
||||
foreach (int chr in _SpecialChars.Keys)
|
||||
{
|
||||
Console.WriteLine("0x{0:X0000} - {1} occurances", chr, _SpecialChars[chr]);
|
||||
}
|
||||
}
|
||||
public static void ResetSpecialCharacters()
|
||||
{
|
||||
_SpecialChars = new Dictionary<int, int>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Volian.Controls.Library;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.Base.Library;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public delegate void TransitionFixerEvent(object sender, TransitionFixerEventArgs args);
|
||||
public class TransitionFixerEventArgs
|
||||
{
|
||||
private string _MyStatus;
|
||||
|
||||
public string MyStatus
|
||||
{
|
||||
get { return _MyStatus; }
|
||||
set { _MyStatus = value; }
|
||||
}
|
||||
public TransitionFixerEventArgs(string myStatus)
|
||||
{
|
||||
_MyStatus = myStatus;
|
||||
}
|
||||
}
|
||||
class TransitionFixer
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public event TransitionFixerEvent StatusChanged;
|
||||
private void OnStatusChanged(object sender, TransitionFixerEventArgs args)
|
||||
{
|
||||
if (StatusChanged != null)
|
||||
StatusChanged(sender, args);
|
||||
}
|
||||
private string _Status;
|
||||
|
||||
public string Status
|
||||
{
|
||||
get { return _Status; }
|
||||
set
|
||||
{
|
||||
_Status = value;
|
||||
OnStatusChanged(this, new TransitionFixerEventArgs(_Status));
|
||||
}
|
||||
}
|
||||
private int _ErrorCount = 0;
|
||||
|
||||
public int ErrorCount
|
||||
{
|
||||
get { return _ErrorCount; }
|
||||
set { _ErrorCount = value; }
|
||||
}
|
||||
|
||||
private StepRTB _MyStepRTB;
|
||||
|
||||
public StepRTB MyStepRTB
|
||||
{
|
||||
get { return _MyStepRTB; }
|
||||
}
|
||||
private string _LogPath;
|
||||
private frmLoader _MyLoader;
|
||||
public TransitionFixer(StepRTB myStepRTB,string logpath, frmLoader myLoader)
|
||||
{
|
||||
_MyStepRTB = myStepRTB;
|
||||
_LogPath = logpath;
|
||||
_MyLoader = myLoader;
|
||||
}
|
||||
public TimeSpan Process(bool checkRTF)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange);
|
||||
ProcessTransitions(checkRTF);
|
||||
ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
|
||||
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||
{
|
||||
_MyLoader.AddInfo("'Fixed Transition for ',{0},' changed from ','T-{1}',' to ','T-{2}'", (sender as ContentInfo).ContentID, args.OldValue, args.NewValue);
|
||||
}
|
||||
private void ProcessTransitions(bool checkRTF)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
// Loop through all Items and check before and after text
|
||||
ItemInfoList myListFrom = ItemInfoList.GetListTranFrom(); //ItemInfoList.GetByContentID(99732);//
|
||||
ItemInfoList myListTo = ItemInfoList.GetListTranTo(); //ItemInfoList.GetByContentID(99732); //
|
||||
ConversionRTBProblems myProblems = new ConversionRTBProblems();
|
||||
int i = 0;
|
||||
foreach (ItemInfo item in myListFrom)
|
||||
{
|
||||
Status = string.Format("Processing {0} of {1} steps", ++i, myListFrom.Count);
|
||||
//MyStepRTB.ViewRTB = false;
|
||||
string originalText = item.MyContent.Text;
|
||||
string updatedText = item.MyContent.Text;
|
||||
if (item.MyContent.MyGrid != null)
|
||||
{
|
||||
originalText = item.MyContent.MyGrid.Data;
|
||||
updatedText = (item.MyContent.MyGrid.Data.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
}
|
||||
// Exclude items that are not connected (Dummy steps for invalid transition destinations)
|
||||
if (item.ItemDocVersionCount != 0 || item.MyPrevious != null || item.MyParent != null)
|
||||
{
|
||||
if (item.MyContent.ContentTransitionCount > 0)
|
||||
{
|
||||
//updatedText = Volian.Controls.Library.DisplayText.StaticRemoveRtfStyles(updatedText, item);
|
||||
foreach (TransitionInfo tran in item.MyContent.ContentTransitions)
|
||||
{
|
||||
try
|
||||
{
|
||||
string oldtext = item.MyContent.Text;
|
||||
item.MyContent.FixTransitionText(tran,item);
|
||||
string newtext = item.MyContent.Text;
|
||||
if (newtext != oldtext)
|
||||
{
|
||||
using (Content c = item.MyContent.Get())
|
||||
{
|
||||
c.FixTransitionText(tran);
|
||||
c.Save();
|
||||
|
||||
}
|
||||
}
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
//_MyLoader.AddInfo("{0}", item.MyContent.MyContentMessage);
|
||||
//if (item.MyContent.MyGridMessage != string.Empty)
|
||||
// _MyLoader.AddInfo("{0}", item.MyContent.MyGridMessage);
|
||||
// updatedText = FixTransitionText(originalText, tran, item.MyContent.ContentID);
|
||||
//if (item.MyContent.MyGrid != null)
|
||||
// updatedText = FixTableTransitionText(originalText, tran, item.MyContent.Get());
|
||||
//else
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
_MyLog.WarnFormat("Transition Conversion Error: {0}", ex.Message);
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
//if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
||||
}
|
||||
}
|
||||
//if (updatedText.EndsWith(" ")) updatedText = updatedText.Substring(0, updatedText.Length - 1);
|
||||
//if (item.MyContent.MyGrid != null)
|
||||
//{
|
||||
// using (Item itm = item.Get())
|
||||
// {
|
||||
// updatedText = (updatedText.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
// string sstring = AdjustSizeAndGetSearchString(updatedText, itm);
|
||||
// itm.MyContent.Text = sstring;
|
||||
// if (item.NewTransToUnNumberedItem)
|
||||
// {
|
||||
// ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
// ia.SearchText = "Transition to un-numbered step";
|
||||
// ia.UserID = "Migration";
|
||||
// }
|
||||
// itm.Save();
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (item.NewTransToUnNumberedItem)
|
||||
// {
|
||||
// using (Item itm = item.Get())
|
||||
// {
|
||||
// ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
// ia.SearchText = "Transition to un-numbered step";
|
||||
// ia.UserID = "Migration";
|
||||
// itm.Save();
|
||||
// }
|
||||
// }
|
||||
// using (Content c = item.MyContent.Get())
|
||||
// {
|
||||
// c.Text = updatedText;
|
||||
// c.Save();
|
||||
// }
|
||||
//}
|
||||
//// Added for transitions to un-numbered steps
|
||||
if (checkRTF)
|
||||
{
|
||||
MyStepRTB.MyItemInfo = item;
|
||||
// Force Save - This will put change bars on everything
|
||||
if (MyStepRTB.Text.Contains("(Resolved Transition Text)") != false) MyStepRTB.OrigDisplayText.Save(MyStepRTB);
|
||||
string afterText = item.MyContent.Text;
|
||||
// aftertext is 'newrtf'
|
||||
if (afterText != updatedText)
|
||||
myProblems.RTBProblems.Add(item.ItemID, item.MyContent.ContentID, originalText, updatedText, MyStepRTB.Rtf, afterText, item.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (checkRTF)
|
||||
{
|
||||
Status = "Saving problems";
|
||||
string logFile = _LogPath + @"\RTBProblems.xml";
|
||||
ErrorCount = myProblems.RTBProblems.Count;
|
||||
myProblems.Save(logFile);
|
||||
if (ErrorCount > 0)
|
||||
{
|
||||
System.Windows.Forms.DialogResult answer = System.Windows.Forms.MessageBox.Show(
|
||||
string.Format("{0} Differences found in Transition Text\r\nResults in {1}\r\n\r\nOpen Log File?",
|
||||
ErrorCount, logFile), "Transitions Different", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
|
||||
if(answer == System.Windows.Forms.DialogResult.Yes)
|
||||
System.Diagnostics.Process.Start(logFile);
|
||||
}
|
||||
}
|
||||
Status = "Done comparing";
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
private AnnotationType _VerificationRequiredType; // Using this to flag table to grid conversions
|
||||
public AnnotationType VerificationRequiredType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_VerificationRequiredType == null)
|
||||
_VerificationRequiredType = AnnotationType.GetByName("Verification Required");
|
||||
return _VerificationRequiredType;
|
||||
}
|
||||
}
|
||||
public string FixTransitionText(string Text, TransitionInfo tran, int contentID)
|
||||
{
|
||||
string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1}( [0-9]*){2}\[END>", tran.TranType, tran.TransitionID, "{1,2}");
|
||||
string transText = tran.ResolvePathTo();
|
||||
//Console.WriteLine(">>>>> FixTransitionText");
|
||||
//Console.WriteLine("Text = {0}", Text);
|
||||
//Console.WriteLine("lookFor = {0}", lookFor);
|
||||
//Console.WriteLine("TransText = {0}", transText);
|
||||
Match m = Regex.Match(Text, lookFor);
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
_MyLoader.AddInfo("DataLoader.TransitionFixer:Content:{0}, {1}, {2}", contentID, tran.TransitionID, g.ToString());
|
||||
//Console.WriteLine("DataLoader.TransitionFixer:Content:{0}, {1}", tran.TransitionID, g.ToString());
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Transition not Found");
|
||||
return Text;
|
||||
}
|
||||
public string FixTableTransitionText(string Text, TransitionInfo tran, Content content)
|
||||
{
|
||||
string lookFor = string.Format(@"<START\]\\cf1\\v0 ([^#]*?)\\cf0\\v #Link:Transition[^:]*?:{0} {1}( [0-9]*){2}\[END>", tran.TranType, tran.TransitionID, "{1,2}");
|
||||
string transText = tran.ResolvePathTo();
|
||||
//Console.WriteLine(">>>>> FixTransitionText");
|
||||
//Console.WriteLine("Text = {0}", Text);
|
||||
//Console.WriteLine("lookFor = {0}", lookFor);
|
||||
//Console.WriteLine("TransText = {0}", transText);
|
||||
Match m = Regex.Match(Text, lookFor);
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
_MyLoader.AddInfo("DataLoader.TransitionFixer:Grid:{0}, {1}, {2}", content.ContentID, tran.TransitionID, g.ToString());
|
||||
// Console.WriteLine("DataLoader.TransitionFixer:Grid:{0}, {1}", tran.TransitionID, g.ToString());
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Transition not Found");
|
||||
|
||||
//VlnFlexGrid grd = new VlnFlexGrid(1, 1);
|
||||
//XmlDocument xd = new XmlDocument();
|
||||
//xd.LoadXml(Text);
|
||||
//grd.ReadXml(xd);
|
||||
//grd.FixTableCellsHeightWidth(); // resize the column width/height
|
||||
//using (StringWriter sw = new StringWriter())
|
||||
//{
|
||||
// grd.WriteXml(sw);
|
||||
// //Console.WriteLine(sw.GetStringBuilder().ToString());
|
||||
// content.MyGrid.Data = sw.GetStringBuilder().ToString();
|
||||
// sw.Close();
|
||||
//}
|
||||
return Text;
|
||||
}
|
||||
private string AdjustSizeAndGetSearchString(string strXML, Item itm)
|
||||
{
|
||||
string rstring = "";
|
||||
VlnFlexGrid grd = new VlnFlexGrid(1, 1);
|
||||
XmlDocument xd = new XmlDocument();
|
||||
xd.LoadXml(strXML);
|
||||
grd.ReadXml(xd);
|
||||
//using (StringReader sr = new StringReader(strXML))
|
||||
//{
|
||||
// grd.ReadXml(sr);
|
||||
// sr.Close();
|
||||
//}
|
||||
grd.FixTableCellsHeightWidth(); // resize the column width/height
|
||||
rstring = grd.GetSearchableText();
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
grd.WriteXml(sw);
|
||||
itm.MyContent.MyGrid.Data = sw.GetStringBuilder().ToString();
|
||||
sw.Close();
|
||||
}
|
||||
return rstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Volian.Controls.Library;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.Text.RegularExpressions;
|
||||
using Volian.Base.Library;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public delegate void TransitionFixerEvent(object sender, TransitionFixerEventArgs args);
|
||||
public class TransitionFixerEventArgs
|
||||
{
|
||||
private string _MyStatus;
|
||||
|
||||
public string MyStatus
|
||||
{
|
||||
get { return _MyStatus; }
|
||||
set { _MyStatus = value; }
|
||||
}
|
||||
public TransitionFixerEventArgs(string myStatus)
|
||||
{
|
||||
_MyStatus = myStatus;
|
||||
}
|
||||
}
|
||||
class TransitionFixer
|
||||
{
|
||||
public event TransitionFixerEvent StatusChanged;
|
||||
private void OnStatusChanged(object sender, TransitionFixerEventArgs args)
|
||||
{
|
||||
if (StatusChanged != null)
|
||||
StatusChanged(sender, args);
|
||||
}
|
||||
private string _Status;
|
||||
|
||||
public string Status
|
||||
{
|
||||
get { return _Status; }
|
||||
set
|
||||
{
|
||||
_Status = value;
|
||||
OnStatusChanged(this, new TransitionFixerEventArgs(_Status));
|
||||
}
|
||||
}
|
||||
private int _ErrorCount = 0;
|
||||
|
||||
public int ErrorCount
|
||||
{
|
||||
get { return _ErrorCount; }
|
||||
set { _ErrorCount = value; }
|
||||
}
|
||||
|
||||
private StepRTB _MyStepRTB;
|
||||
|
||||
public StepRTB MyStepRTB
|
||||
{
|
||||
get { return _MyStepRTB; }
|
||||
}
|
||||
private string _LogPath;
|
||||
public TransitionFixer(StepRTB myStepRTB,string logpath)
|
||||
{
|
||||
_MyStepRTB = myStepRTB;
|
||||
_LogPath = logpath;
|
||||
}
|
||||
public TimeSpan Process(bool checkRTF)
|
||||
{
|
||||
DateTime tstart = DateTime.Now;
|
||||
ProcessTransitions(checkRTF);
|
||||
return DateTime.Now - tstart;
|
||||
}
|
||||
private void ProcessTransitions(bool checkRTF)
|
||||
{
|
||||
Status = "Getting List...";
|
||||
// Loop through all Items and check before and after text
|
||||
ItemInfoList myListFrom = ItemInfoList.GetListTranFrom();
|
||||
ItemInfoList myListTo = ItemInfoList.GetListTranTo();
|
||||
ConversionRTBProblems myProblems = new ConversionRTBProblems();
|
||||
int i = 0;
|
||||
foreach (ItemInfo item in myListFrom)
|
||||
{
|
||||
if (item.MyContent.ContentID == 311)
|
||||
Console.WriteLine();
|
||||
Status = string.Format("Processing {0} of {1} steps", ++i, myListFrom.Count);
|
||||
//MyStepRTB.ViewRTB = false;
|
||||
string originalText = item.MyContent.Text;
|
||||
string updatedText = item.MyContent.Text;
|
||||
if (item.MyContent.MyGrid != null)
|
||||
{
|
||||
originalText = item.MyContent.MyGrid.Data;
|
||||
updatedText = (item.MyContent.MyGrid.Data.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
}
|
||||
// Exclude items that are not connected (Dummy steps for invalid transition destinations)
|
||||
if (item.ItemDocVersionCount != 0 || item.MyPrevious != null || item.MyParent != null)
|
||||
{
|
||||
if (item.MyContent.ContentTransitionCount > 0)
|
||||
{
|
||||
//updatedText = Volian.Controls.Library.DisplayText.StaticRemoveRtfStyles(updatedText, item);
|
||||
foreach (TransitionInfo tran in item.MyContent.ContentTransitions)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (item.MyContent.MyGrid != null)
|
||||
updatedText = FixTableTransitionText(updatedText, tran, item.MyContent.Get());
|
||||
else
|
||||
updatedText = FixTransitionText(updatedText, tran);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
||||
}
|
||||
}
|
||||
if (updatedText.EndsWith(" ")) updatedText = updatedText.Substring(0, updatedText.Length - 1);
|
||||
if (item.MyContent.MyGrid != null)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
updatedText = (updatedText.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
string sstring = AdjustSizeAndGetSearchString(updatedText, itm);
|
||||
itm.MyContent.Text = sstring;
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
}
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
using (Content c = item.MyContent.Get())
|
||||
{
|
||||
c.Text = updatedText;
|
||||
c.Save();
|
||||
}
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
if (checkRTF)
|
||||
{
|
||||
MyStepRTB.MyItemInfo = item;
|
||||
// Force Save - This will put change bars on everything
|
||||
if (MyStepRTB.Text.Contains("(Resolved Transition Text)") != false) MyStepRTB.OrigDisplayText.Save(MyStepRTB);
|
||||
string afterText = item.MyContent.Text;
|
||||
// aftertext is 'newrtf'
|
||||
if (afterText != updatedText)
|
||||
myProblems.RTBProblems.Add(item.ItemID, item.MyContent.ContentID, originalText, updatedText, MyStepRTB.Rtf, afterText, item.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (checkRTF)
|
||||
{
|
||||
Status = "Saving problems";
|
||||
string logFile = _LogPath + @"\RTBProblems.xml";
|
||||
ErrorCount = myProblems.RTBProblems.Count;
|
||||
myProblems.Save(logFile);
|
||||
if (ErrorCount > 0)
|
||||
{
|
||||
System.Windows.Forms.DialogResult answer = System.Windows.Forms.MessageBox.Show(
|
||||
string.Format("{0} Differences found in Transition Text\r\nResults in {1}\r\n\r\nOpen Log File?",
|
||||
ErrorCount, logFile), "Transitions Different", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
|
||||
if(answer == System.Windows.Forms.DialogResult.Yes)
|
||||
System.Diagnostics.Process.Start(logFile);
|
||||
}
|
||||
}
|
||||
Status = "Done comparing";
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
private AnnotationType _VerificationRequiredType; // Using this to flag table to grid conversions
|
||||
public AnnotationType VerificationRequiredType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_VerificationRequiredType == null)
|
||||
_VerificationRequiredType = AnnotationType.GetByName("Verification Required");
|
||||
return _VerificationRequiredType;
|
||||
}
|
||||
}
|
||||
public string FixTransitionText(string Text, TransitionInfo tran)
|
||||
{
|
||||
if (tran.MyItemToID.ToString().Contains("diamond"))
|
||||
Console.WriteLine();
|
||||
string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1}( [0-9]*){2}\[END>", tran.TranType, tran.TransitionID, "{1,2}");
|
||||
string transText = tran.ResolvePathTo();
|
||||
//Console.WriteLine(">>>>> FixTransitionText");
|
||||
//Console.WriteLine("Text = {0}", Text);
|
||||
//Console.WriteLine("lookFor = {0}", lookFor);
|
||||
//Console.WriteLine("TransText = {0}", transText);
|
||||
Match m = Regex.Match(Text, lookFor);
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Transition not Found");
|
||||
return Text;
|
||||
}
|
||||
public string FixTableTransitionText(string Text, TransitionInfo tran, Content content)
|
||||
{
|
||||
string lookFor = string.Format(@"<START\]\\cf1\\v0 ([^#]*?)\\cf0\\v #Link:Transition[^:]*?:{0} {1}( [0-9]*){2}\[END>", tran.TranType, tran.TransitionID, "{1,2}");
|
||||
string transText = tran.ResolvePathTo();
|
||||
//Console.WriteLine(">>>>> FixTransitionText");
|
||||
//Console.WriteLine("Text = {0}", Text);
|
||||
//Console.WriteLine("lookFor = {0}", lookFor);
|
||||
//Console.WriteLine("TransText = {0}", transText);
|
||||
Match m = Regex.Match(Text, lookFor);
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Transition not Found");
|
||||
|
||||
//VlnFlexGrid grd = new VlnFlexGrid(1, 1);
|
||||
//XmlDocument xd = new XmlDocument();
|
||||
//xd.LoadXml(Text);
|
||||
//grd.ReadXml(xd);
|
||||
//grd.FixTableCellsHeightWidth(); // resize the column width/height
|
||||
//using (StringWriter sw = new StringWriter())
|
||||
//{
|
||||
// grd.WriteXml(sw);
|
||||
// //Console.WriteLine(sw.GetStringBuilder().ToString());
|
||||
// content.MyGrid.Data = sw.GetStringBuilder().ToString();
|
||||
// sw.Close();
|
||||
//}
|
||||
return Text;
|
||||
}
|
||||
private string AdjustSizeAndGetSearchString(string strXML, Item itm)
|
||||
{
|
||||
string rstring = "";
|
||||
VlnFlexGrid grd = new VlnFlexGrid(1, 1);
|
||||
XmlDocument xd = new XmlDocument();
|
||||
xd.LoadXml(strXML);
|
||||
grd.ReadXml(xd);
|
||||
//using (StringReader sr = new StringReader(strXML))
|
||||
//{
|
||||
// grd.ReadXml(sr);
|
||||
// sr.Close();
|
||||
//}
|
||||
grd.FixTableCellsHeightWidth(); // resize the column width/height
|
||||
rstring = grd.GetSearchableText();
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
grd.WriteXml(sw);
|
||||
itm.MyContent.MyGrid.Data = sw.GetStringBuilder().ToString();
|
||||
sw.Close();
|
||||
}
|
||||
return rstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,427 +0,0 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
Dictionary<int, List<string>> _ContentMigrationErrors = new Dictionary<int,List<string>>();
|
||||
List<string> _TransitionMigrationErrors = null;
|
||||
//private void AddContentMigrationError(Content fromCon,string errorMsg)
|
||||
//{
|
||||
// if (!_ContentMigrationErrors.ContainsKey(fromCon.ContentID))
|
||||
// _ContentMigrationErrors.Add(fromCon.ContentID,new List<string>());
|
||||
// _ContentMigrationErrors[fromCon.ContentID].Add(errorMsg);
|
||||
//}
|
||||
|
||||
private string AddTrans(OleDbConnection cn, Content fromCon, DataRow dr, DataRow dr2, string pth)
|
||||
{
|
||||
List<string> migrationErrors = new List<string>();
|
||||
string thekey = dr["TONUMBER"].ToString() + "|" + TextConvert.ConvertSeq(dr["TOSEQUENCE"].ToString());
|
||||
if (thekey.EndsWith("0S"))
|
||||
thekey = thekey.Substring(0, thekey.Length - 1);
|
||||
string dti = dr["DTI"].ToString().PadRight(18, ' ');
|
||||
string userid = dti.Substring(13, 5).Trim();
|
||||
int itype = 0;
|
||||
ConfigInfo ci = null;
|
||||
//string otranskey = null;
|
||||
// The transition type was stored as a character & also, when read in thru
|
||||
// ado.net may have been converted into unicode. So in order to get the
|
||||
// correct type, first, use the TextConvert to eliminate the conversion done
|
||||
// by ado.net. Then convert to a number. The 'anding of 0x80' flags that it
|
||||
// is a formatted transition (i.e. this was done for byron/braidwood to
|
||||
// show the transition with a page number or not). The 'anding of 0x7f' gets
|
||||
// the actual number when subtracted from 0x30 (the value of the 0 character).
|
||||
try
|
||||
{
|
||||
char typech = TextConvert.ConvertSeq(dr["TYPE"].ToString())[0];
|
||||
int tmpitype = Convert.ToInt32(typech);
|
||||
if ((tmpitype & 0x80) > 0)
|
||||
{
|
||||
ci = new ConfigInfo(null);
|
||||
ci.AddItem("Transition", "Formatted", "True");
|
||||
}
|
||||
itype = (tmpitype&0x7F) - 0x30;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex,"Error converting transition type '{0}'",dr["TYPE"].ToString());
|
||||
log.Error("Error converting transition type");
|
||||
log.ErrorFormat("type from database = {0}", dr["TYPE"].ToString());
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
itype = -1;
|
||||
}
|
||||
DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).TrimEnd());
|
||||
|
||||
// if it's in the dictionary of structure elements already migrated, just use this
|
||||
// structure id, or if it's in the dictionary of structure elements that have
|
||||
// not been migrated but a record was created from this code, use it. Otherwise
|
||||
// create a new structure record and use its id, its data will be updated later.
|
||||
// a structure record.
|
||||
Item toItem = null;
|
||||
Item toItem2 = null;
|
||||
if (itype == 6) // Outside Transition
|
||||
{
|
||||
ItemInfo tmp = _OutTran.GetItem(thekey, migrationErrors);
|
||||
if (tmp != null)
|
||||
toItem = tmp.Get();
|
||||
else
|
||||
{
|
||||
//toItem = Item.New(null, TransDummyCont, DateTime.Now, "Migration");
|
||||
fromCon.Save();
|
||||
migrationErrors.Add("Transition Error: Missing Data - " + _OutTran.GetDescription(thekey) + ". Converted to text");
|
||||
if (!_ContentMigrationErrors.ContainsKey(fromCon.ContentID))
|
||||
_ContentMigrationErrors.Add(fromCon.ContentID, migrationErrors);
|
||||
return _OutTran.GetTransitionText(thekey);
|
||||
}
|
||||
toItem2 = toItem;
|
||||
// the 32-bit program will no longer have a special type for outside transitions - make it a
|
||||
// type of 0 (procedure with optional step).
|
||||
itype = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (itype > 6) itype--; // Corrected to match transformat table (16-bit skips type 6 because it's an outside transition)
|
||||
if (dicTrans_ItemDone.ContainsKey(thekey))
|
||||
{
|
||||
toItem = dicTrans_ItemDone[thekey];
|
||||
if (toItem.ContentID == TransDummyCont.ContentID)
|
||||
_TransitionMigrationErrors.Add(thekey);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dicTrans_ItemIds.ContainsKey(thekey))
|
||||
{
|
||||
toItem = dicTrans_ItemIds[thekey];
|
||||
if (toItem.ContentID == TransDummyCont.ContentID)
|
||||
_TransitionMigrationErrors.Add(thekey);
|
||||
}
|
||||
else
|
||||
{
|
||||
// note that parent is null right now - it will be filled in later.
|
||||
//toItem = Item.MakeItem(null, fromCon, DateTime.Now, "Migration");
|
||||
toItem = Item.New(null, TransDummyCont, DateTime.Now, "Migration");
|
||||
dicTrans_ItemIds.Add(thekey, toItem);
|
||||
_TransitionMigrationErrors.Add(thekey);
|
||||
}
|
||||
}
|
||||
|
||||
// if there is data in dr2, it means that it is a range transition. Get its item
|
||||
// data too.
|
||||
toItem2 = toItem;
|
||||
if (dr2 != null)
|
||||
{
|
||||
string thekey2 = dr2["TONUMBER"].ToString() + "|" + TextConvert.ConvertSeq(dr2["TOSEQUENCE"].ToString());
|
||||
|
||||
// Range transitions that are type 2 are called 'AND' transitions.
|
||||
// Example: Continue with steps 5b, 5c and 5d.
|
||||
// if the second key is greater than the first key, then the transition terminates
|
||||
// at the location specified in the second key.
|
||||
// If the second key is less than or equal the first key, the transition extends
|
||||
// to the last sibling of the first key.
|
||||
// In data, these are represented with the SQL database field in the transitions
|
||||
// table 'IsRange' == 2, toid and rangeid. In the content record, the link is
|
||||
// TransitionRange:[type] [tranid] [toid] [rangeid].
|
||||
|
||||
if (itype == 2 && thekey.CompareTo(thekey2) >= 0) thekey2 = thekey;
|
||||
if (dicTrans_ItemDone.ContainsKey(thekey2))
|
||||
{
|
||||
toItem2 = dicTrans_ItemDone[thekey2];
|
||||
if (toItem2.ContentID == TransDummyCont.ContentID)
|
||||
_TransitionMigrationErrors.Add(thekey2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dicTrans_ItemIds.ContainsKey(thekey2))
|
||||
{
|
||||
toItem2 = dicTrans_ItemIds[thekey2];
|
||||
if (toItem2.ContentID == TransDummyCont.ContentID)
|
||||
_TransitionMigrationErrors.Add(thekey2);
|
||||
}
|
||||
else
|
||||
{
|
||||
toItem2 = Item.MakeItem(null, TransDummyCont, DateTime.Now, "Migration");
|
||||
dicTrans_ItemIds.Add(thekey2, toItem2);
|
||||
_TransitionMigrationErrors.Add(thekey2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (userid == null || userid == "") userid = "Migration";
|
||||
string results = null;
|
||||
try
|
||||
{
|
||||
int isRange = 0;
|
||||
if (toItem.ItemID != toItem2.ItemID)
|
||||
isRange = 1;
|
||||
else if (itype == 2)
|
||||
isRange = 2;
|
||||
using (Transition tr = Transition.New(fromCon, toItem, toItem2, isRange, itype, ci != null ? ci.ToString() : null, dts, userid))
|
||||
{
|
||||
//if (otranskey != null)
|
||||
// tr.MyZTransition.Oldto = otranskey; // info to finish outside transition processing later
|
||||
//else
|
||||
tr.MyZTransition.Oldto = dr["OLDTO"].ToString();
|
||||
if (!tr.IsSavable) ErrorRpt.ErrorReport(tr);
|
||||
tr.Save();
|
||||
if (migrationErrors.Count > 0)
|
||||
_ContentMigrationErrors.Add(fromCon.ContentID, migrationErrors);
|
||||
if (toItem.ItemID == toItem2.ItemID && itype != 2)
|
||||
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:Transition:{0} {1} {2}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID);
|
||||
else
|
||||
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:TransitionRange:{0} {1} {2} {3}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID, tr.RangeID);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "Error addition transition record");
|
||||
log.Error("Error addition transition record");
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private string MigrateTrans(OleDbConnection cn, string textm, string seqcvt, Content content, string pth)
|
||||
{
|
||||
// TODO: BYRON DATA WILL GENERATE A TRANSITION ERROR WHEN IT IS USED IN PROMS 2010
|
||||
StringBuilder trtxt = new StringBuilder();
|
||||
int instance = 0;
|
||||
int beg = 0;
|
||||
DataTable dt = null;
|
||||
DataSet ds = null;
|
||||
OleDbDataAdapter da = null;
|
||||
|
||||
char[] chrtrn = { '\x252C', '\x2566' };
|
||||
int tok = textm.IndexOfAny(chrtrn);
|
||||
if (tok > -1)
|
||||
{
|
||||
string cmd = "SELECT * FROM [tran] WHERE [FROMNUMBER]='" + ProcNumber.Replace("'", "''") + "' AND [FROMSEQUEN] ='" + seqcvt + "' ORDER BY [FROMINSTAN]";
|
||||
da = new OleDbDataAdapter(cmd, cn);
|
||||
// get transition records for this step.
|
||||
ds = new DataSet();
|
||||
try
|
||||
{
|
||||
da.Fill(ds);
|
||||
dt = ds.Tables[0];
|
||||
dt.CaseSensitive = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "Error getting transitions '{0}' '{1}'", ProcNumber, seqcvt);
|
||||
log.Error("Error getting transitions");
|
||||
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
return textm;
|
||||
}
|
||||
}
|
||||
while (tok > -1)
|
||||
{
|
||||
// found a transition token, add the token and transition id into the string and
|
||||
// add an transition record for it. Later there may be text added.
|
||||
trtxt.Append(textm.Substring(beg, tok - beg));
|
||||
// we have too many tokens and not enough usage records - report an error...
|
||||
if (instance >= dt.Rows.Count)
|
||||
{
|
||||
log.ErrorFormat("Error - ran out of transition records for step, check data ");
|
||||
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
||||
}
|
||||
else
|
||||
{
|
||||
DataRow dr = dt.Rows[instance];
|
||||
|
||||
// if type is 2 or 3, this is a range transition, need to get the next
|
||||
// record too
|
||||
bool trange = false;
|
||||
if (dr["Type"].ToString() == "2" || dr["Type"].ToString() == "3")
|
||||
trange = true;
|
||||
|
||||
string rectxt = null;
|
||||
if (trange)
|
||||
{
|
||||
instance++;
|
||||
DataRow dr2 = dt.Rows[instance];
|
||||
rectxt = AddTrans(cn, content, dr, dr2, pth);
|
||||
}
|
||||
else
|
||||
rectxt = AddTrans(cn, content, dr, null, pth);
|
||||
//trtxt.Append(textm[tok]);
|
||||
trtxt.Append(rectxt);
|
||||
}
|
||||
instance++;
|
||||
beg = tok + 1;
|
||||
if (beg > textm.Length)
|
||||
{
|
||||
tok = -1;
|
||||
da.Dispose();
|
||||
}
|
||||
else
|
||||
tok = textm.IndexOfAny(chrtrn, beg);
|
||||
}
|
||||
if (beg < textm.Length)
|
||||
trtxt.Append(textm.Substring(beg, textm.Length - beg));
|
||||
if (dt.Rows.Count > instance + 1)
|
||||
{
|
||||
log.ErrorFormat("Error - extra transition records for step, check data ");
|
||||
log.ErrorFormat("from number = {0} oldstepsequence = {1}", ProcNumber, seqcvt);
|
||||
}
|
||||
ds.Dispose();
|
||||
da.Dispose();
|
||||
return trtxt.ToString();
|
||||
}
|
||||
private void ShowMissingTransitions(DocVersion docver)
|
||||
{
|
||||
if (dicTrans_ItemIds.Keys.Count > 0)
|
||||
{
|
||||
// see if any end in |A0, if so, point these to the procedure associated with it.
|
||||
CleanupTransToNonExistentSectionA0(docver);
|
||||
foreach (string s in dicTrans_ItemIds.Keys)
|
||||
{
|
||||
//log.WarnFormat("{0} - {1}", s, dicTrans_ItemIds[s]);
|
||||
frmMain.AddError("Missing Transition Destination {0} - {1}", s, dicTrans_ItemIds[s].ItemID);
|
||||
//AddItemAnnotation(dicTrans_ItemIds[s]);
|
||||
}
|
||||
}
|
||||
foreach (string s in dicTrans_MigrationErrors.Keys)
|
||||
{
|
||||
foreach (Item itm in dicTrans_MigrationErrors[s])
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = "Transition Error: Destination Missing - " + s;
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
|
||||
if (TransDummyCont.ContentItemCount > 0)
|
||||
log.Warn("Bad transitions to 'dummy' content");
|
||||
foreach (ContentItem itm in TransDummyCont.ContentItems)
|
||||
{
|
||||
log.WarnFormat("ItemID = {0}", itm.ItemID);
|
||||
//AddItemAnnotation(itm.MyItem);
|
||||
}
|
||||
|
||||
log.Info("End of Missing Transitions");
|
||||
}
|
||||
|
||||
private void CleanupTransToNonExistentSectionA0(DocVersion docver)
|
||||
{
|
||||
|
||||
List<string> RemoveFromDicTrans = new List<string>();
|
||||
// see if any end in |A0, if so, point these to the procedure associated with it.
|
||||
foreach (string s in dicTrans_ItemIds.Keys)
|
||||
{
|
||||
if (s.EndsWith("|A0"))
|
||||
{
|
||||
// make a list to store those that need changed because can't change data in
|
||||
// a foreach:
|
||||
RemoveFromDicTrans.Add(s);
|
||||
Item item = dicTrans_ItemIds[s]; // to or range id.
|
||||
//ItemInfo ii = ItemInfo.Get(item.ItemID);
|
||||
|
||||
//get the proc id that will become the new to or range id.
|
||||
string procnum = s.Substring(0, s.IndexOf("|"));
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
IList iprcs = dvi.GetChildren();
|
||||
ItemInfo prc = null;
|
||||
foreach (ItemInfo ii in iprcs)
|
||||
{
|
||||
if (ii.DisplayNumber == procnum)
|
||||
{
|
||||
prc = ii;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (prc != null)
|
||||
{
|
||||
// For each transition that points to the A0, make it point to the proc.
|
||||
// First, find all of them by getting transitions with the A0 (dummy
|
||||
// transition record). Then update the to or range id in the transition
|
||||
// record & then update the content/from part.
|
||||
List<int> transToChg = new List<int>();
|
||||
List<int> transRgChg = new List<int>();
|
||||
TransitionInfoList til = TransitionInfoList.GetByToID(item.ItemID);
|
||||
foreach (TransitionInfo ti in til) UpdateTranDataForA0(prc, ti.TransitionID, false);
|
||||
til = TransitionInfoList.GetByRangeID(item.ItemID);
|
||||
foreach (TransitionInfo tir in til) UpdateTranDataForA0(prc, tir.TransitionID, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (string str in RemoveFromDicTrans)
|
||||
{
|
||||
dicTrans_ItemIds.Remove(str);
|
||||
dicTrans_MigrationErrors.Remove(str);
|
||||
}
|
||||
}
|
||||
private static void UpdateTranDataForA0(ItemInfo procItem, int transid, bool isRange)
|
||||
{
|
||||
int type;
|
||||
int oldto;
|
||||
int oldrg;
|
||||
int oldfrom;
|
||||
using (Transition t = Transition.Get(transid))
|
||||
{
|
||||
type = t.TranType;
|
||||
oldto = t.ToID;
|
||||
oldrg = t.RangeID;
|
||||
oldfrom = t.FromID;
|
||||
if (!isRange)
|
||||
{
|
||||
t.MyItemToID = procItem.Get();
|
||||
t.MyItemRangeID = procItem.Get();
|
||||
}
|
||||
else
|
||||
t.MyItemRangeID = procItem.Get();
|
||||
t.Save();
|
||||
}
|
||||
using (Content c = Content.Get(oldfrom))
|
||||
{
|
||||
string lookFor = (isRange || oldto != oldrg) ? string.Format(@"#Link:TransitionRange:{0} {1} {2} {3}", type, transid, oldto, oldrg) :
|
||||
string.Format(@"#Link:Transition:{0} {1} {2}", type, transid, oldto);
|
||||
string replaceWith = isRange ? string.Format(@"#Link:TransitionRange:{0} {1} {2} {3}", type, transid, oldto, procItem.ItemID) :
|
||||
oldto != oldrg ? string.Format(@"#Link:TransitionRange:{0} {1} {2} {3}", type, transid, procItem.ItemID, oldrg) :
|
||||
string.Format(@"#Link:Transition:{0} {1} {2}", type, transid, procItem.ItemID);
|
||||
c.Text = c.Text.Replace(lookFor, replaceWith);
|
||||
c.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddItemAnnotation(Item itm)
|
||||
{
|
||||
foreach (ItemTransition_ToID tmp in itm.ItemTransitions_ToID)
|
||||
{
|
||||
foreach (ContentItem ci in tmp.MyContent.ContentItems)
|
||||
{
|
||||
ItemAnnotation ia = ci.MyItem.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = "Transition Error: Missing end point";
|
||||
ia.UserID = "Migration";
|
||||
ci.MyItem.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
//using System.Runtime.CompilerServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
|
||||
public class UIFilenameEditor : System.Drawing.Design.UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
if (context != null && context.Instance != null)
|
||||
{
|
||||
if (!context.PropertyDescriptor.IsReadOnly)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
}
|
||||
return UITypeEditorEditStyle.None;
|
||||
}
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
|
||||
{
|
||||
if (context == null || provider == null || context.Instance == null)
|
||||
{
|
||||
return base.EditValue(provider, value);
|
||||
}
|
||||
FileDialog fileDlg;
|
||||
if (context.PropertyDescriptor.Attributes[typeof(SaveFileAttribute)] == null)
|
||||
{
|
||||
fileDlg = new OpenFileDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
fileDlg = new SaveFileDialog();
|
||||
}
|
||||
fileDlg.Title = "Select " + context.PropertyDescriptor.DisplayName;
|
||||
fileDlg.FileName = (string)value;
|
||||
FileDialogFilterAttribute filterAtt = (FileDialogFilterAttribute)context.PropertyDescriptor.Attributes[typeof(FileDialogFilterAttribute)];
|
||||
if (filterAtt != null)
|
||||
{
|
||||
fileDlg.Filter = filterAtt.Filter;
|
||||
}
|
||||
if (fileDlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
value = fileDlg.FileName;
|
||||
}
|
||||
fileDlg.Dispose();
|
||||
return value;
|
||||
}
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class FileDialogFilterAttribute : Attribute
|
||||
{
|
||||
private string _filter;
|
||||
|
||||
public string Filter
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._filter;
|
||||
}
|
||||
}
|
||||
public FileDialogFilterAttribute(string filter)
|
||||
{
|
||||
this._filter = filter;
|
||||
}
|
||||
}
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class SaveFileAttribute : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
public enum FileDialogType
|
||||
{
|
||||
LoadFileDialog,
|
||||
SaveFileDialog
|
||||
}
|
||||
}
|
||||
public class UIFolderEditor : System.Drawing.Design.UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
if (context != null && context.Instance != null)
|
||||
{
|
||||
if (!context.PropertyDescriptor.IsReadOnly)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
}
|
||||
return UITypeEditorEditStyle.None;
|
||||
}
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
|
||||
{
|
||||
if (context == null || provider == null || context.Instance == null)
|
||||
{
|
||||
return base.EditValue(provider, value);
|
||||
}
|
||||
FolderBrowserDialog folderDlg=new FolderBrowserDialog();
|
||||
folderDlg.SelectedPath = (string)value;
|
||||
if (folderDlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
value = folderDlg.SelectedPath;
|
||||
}
|
||||
folderDlg.Dispose();
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Volian.MSWord;
|
||||
using LBWordLibrary;
|
||||
using System.Threading;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
class WordDocument
|
||||
{
|
||||
private string _FileName;
|
||||
public string FileName
|
||||
{
|
||||
get { return _FileName; }
|
||||
set { _FileName = value; }
|
||||
}
|
||||
private string _ASCII = null;
|
||||
public string ASCII
|
||||
{
|
||||
get { return _ASCII; }
|
||||
set { _ASCII = value; }
|
||||
}
|
||||
private float _DocLen = 1.0F;
|
||||
public float DocLen
|
||||
{
|
||||
get { return _DocLen; }
|
||||
set { _DocLen = value; }
|
||||
}
|
||||
private string _Stype;
|
||||
/// <summary>
|
||||
/// 16-bit's type[1] used the following codes to represent the respective lpi setting
|
||||
///
|
||||
/// char far typestr[] = "*pP46f7L";
|
||||
///
|
||||
/// char * far printtypes[] = {
|
||||
/// "Compressed, 8 lines per inch",
|
||||
/// "Elite, 6 lines per inch",
|
||||
/// "Pica, 6 lines per inch",
|
||||
/// "Default font, 4 Lines Per Inch",
|
||||
/// "Default font, 6 Lines Per Inch",
|
||||
/// "Compressed 6 LPI",
|
||||
/// "Default font, 7 Lines Per Inch",
|
||||
/// "Special Landscape, Elite, 6 lines per inch"
|
||||
/// </summary>
|
||||
public string Stype
|
||||
{
|
||||
get { return _Stype; }
|
||||
set
|
||||
{
|
||||
_Stype = value;
|
||||
if (_Stype != null)
|
||||
{
|
||||
if (_Stype != null)
|
||||
{
|
||||
// stype[1] == 'p' or 'P' or '6' 'f' or 'L' get spc = 6
|
||||
if (_Stype[1] == '*') LPI = 8;
|
||||
else if (_Stype[1] == '4') LPI = 4;
|
||||
else if (_Stype[1] == '7') LPI = 7;
|
||||
// if need landscape set too: bool landscape = (stype[1] == 'L');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private int _LPI = 6;
|
||||
public int LPI
|
||||
{
|
||||
get { return _LPI; }
|
||||
set { _LPI = value; }
|
||||
}
|
||||
private string _OutFileName;
|
||||
public string OutFileName
|
||||
{
|
||||
get { return _OutFileName; }
|
||||
set { _OutFileName = value; }
|
||||
}
|
||||
private bool _IsLandscape;
|
||||
public bool IsLandscape
|
||||
{
|
||||
get { return _IsLandscape; }
|
||||
set { _IsLandscape = value; }
|
||||
}
|
||||
public WordDocument(string fileName, string stype, string outFileName, bool isLandscape)
|
||||
{
|
||||
FileName = fileName;
|
||||
Stype = stype;
|
||||
OutFileName = outFileName;
|
||||
IsLandscape = isLandscape;
|
||||
}
|
||||
public void GetAsciiFromWord()
|
||||
{
|
||||
WordDoc myWordDoc = null;
|
||||
try
|
||||
{
|
||||
myWordDoc = new WordDoc(FileName);
|
||||
myWordDoc.SetLineSpacing(LPI);
|
||||
if (IsLandscape)
|
||||
{
|
||||
myWordDoc.MyWordDoc.PageSetup.Orientation = LBWdOrientation.wdOrientLandscape;
|
||||
}
|
||||
try
|
||||
{
|
||||
DocLen = myWordDoc.Length;
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Console.WriteLine("{0} - {0}\r\n\r\n{1}", ex1.GetType().Name, ex1.Message);
|
||||
}
|
||||
ASCII = myWordDoc.MyWordDoc.Ascii;
|
||||
myWordDoc.Save(OutFileName);
|
||||
myWordDoc.Close();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Could not get Ascii", ex);
|
||||
WordDoc.CloseApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-413
@@ -1,413 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class dlgExportImport
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pnlExport = new System.Windows.Forms.Panel();
|
||||
this.lblExportStatus = new System.Windows.Forms.Label();
|
||||
this.pbExportStep = new System.Windows.Forms.ProgressBar();
|
||||
this.lblExportStep = new System.Windows.Forms.Label();
|
||||
this.pbExportSection = new System.Windows.Forms.ProgressBar();
|
||||
this.lblExportSection = new System.Windows.Forms.Label();
|
||||
this.pbExportProcedure = new System.Windows.Forms.ProgressBar();
|
||||
this.lblExportProcedure = new System.Windows.Forms.Label();
|
||||
this.btnDoExport = new System.Windows.Forms.Button();
|
||||
this.btnExport = new System.Windows.Forms.Button();
|
||||
this.txtExport = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.pnlImport = new System.Windows.Forms.Panel();
|
||||
this.lblImportStatus = new System.Windows.Forms.Label();
|
||||
this.pbImportStep = new System.Windows.Forms.ProgressBar();
|
||||
this.lblImportStep = new System.Windows.Forms.Label();
|
||||
this.pbImportSection = new System.Windows.Forms.ProgressBar();
|
||||
this.lblImportSection = new System.Windows.Forms.Label();
|
||||
this.pbImportProcedure = new System.Windows.Forms.ProgressBar();
|
||||
this.lblImportProcedure = new System.Windows.Forms.Label();
|
||||
this.btnDoImport = new System.Windows.Forms.Button();
|
||||
this.btnImport = new System.Windows.Forms.Button();
|
||||
this.txtImport = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.ofd = new System.Windows.Forms.OpenFileDialog();
|
||||
this.sfd = new System.Windows.Forms.SaveFileDialog();
|
||||
this.btnCloseExport = new System.Windows.Forms.Button();
|
||||
this.btnCloseImport = new System.Windows.Forms.Button();
|
||||
this.lblExportTime = new System.Windows.Forms.Label();
|
||||
this.lblImportTime = new System.Windows.Forms.Label();
|
||||
this.pnlExport.SuspendLayout();
|
||||
this.pnlImport.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlExport
|
||||
//
|
||||
this.pnlExport.Controls.Add(this.btnCloseExport);
|
||||
this.pnlExport.Controls.Add(this.lblExportTime);
|
||||
this.pnlExport.Controls.Add(this.lblExportStatus);
|
||||
this.pnlExport.Controls.Add(this.pbExportStep);
|
||||
this.pnlExport.Controls.Add(this.lblExportStep);
|
||||
this.pnlExport.Controls.Add(this.pbExportSection);
|
||||
this.pnlExport.Controls.Add(this.lblExportSection);
|
||||
this.pnlExport.Controls.Add(this.pbExportProcedure);
|
||||
this.pnlExport.Controls.Add(this.lblExportProcedure);
|
||||
this.pnlExport.Controls.Add(this.btnDoExport);
|
||||
this.pnlExport.Controls.Add(this.btnExport);
|
||||
this.pnlExport.Controls.Add(this.txtExport);
|
||||
this.pnlExport.Controls.Add(this.label1);
|
||||
this.pnlExport.Location = new System.Drawing.Point(12, 12);
|
||||
this.pnlExport.Name = "pnlExport";
|
||||
this.pnlExport.Size = new System.Drawing.Size(618, 199);
|
||||
this.pnlExport.TabIndex = 0;
|
||||
//
|
||||
// lblExportStatus
|
||||
//
|
||||
this.lblExportStatus.AutoSize = true;
|
||||
this.lblExportStatus.Location = new System.Drawing.Point(140, 30);
|
||||
this.lblExportStatus.Name = "lblExportStatus";
|
||||
this.lblExportStatus.Size = new System.Drawing.Size(133, 13);
|
||||
this.lblExportStatus.TabIndex = 10;
|
||||
this.lblExportStatus.Text = "Awaiting Export File Name:";
|
||||
//
|
||||
// pbExportStep
|
||||
//
|
||||
this.pbExportStep.Location = new System.Drawing.Point(15, 155);
|
||||
this.pbExportStep.Name = "pbExportStep";
|
||||
this.pbExportStep.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbExportStep.Step = 1;
|
||||
this.pbExportStep.TabIndex = 9;
|
||||
//
|
||||
// lblExportStep
|
||||
//
|
||||
this.lblExportStep.AutoSize = true;
|
||||
this.lblExportStep.Location = new System.Drawing.Point(12, 139);
|
||||
this.lblExportStep.Name = "lblExportStep";
|
||||
this.lblExportStep.Size = new System.Drawing.Size(34, 13);
|
||||
this.lblExportStep.TabIndex = 8;
|
||||
this.lblExportStep.Text = "Steps";
|
||||
//
|
||||
// pbExportSection
|
||||
//
|
||||
this.pbExportSection.Location = new System.Drawing.Point(15, 116);
|
||||
this.pbExportSection.Name = "pbExportSection";
|
||||
this.pbExportSection.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbExportSection.Step = 1;
|
||||
this.pbExportSection.TabIndex = 7;
|
||||
//
|
||||
// lblExportSection
|
||||
//
|
||||
this.lblExportSection.AutoSize = true;
|
||||
this.lblExportSection.Location = new System.Drawing.Point(12, 100);
|
||||
this.lblExportSection.Name = "lblExportSection";
|
||||
this.lblExportSection.Size = new System.Drawing.Size(48, 13);
|
||||
this.lblExportSection.TabIndex = 6;
|
||||
this.lblExportSection.Text = "Sections";
|
||||
//
|
||||
// pbExportProcedure
|
||||
//
|
||||
this.pbExportProcedure.Location = new System.Drawing.Point(15, 77);
|
||||
this.pbExportProcedure.Name = "pbExportProcedure";
|
||||
this.pbExportProcedure.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbExportProcedure.Step = 1;
|
||||
this.pbExportProcedure.TabIndex = 5;
|
||||
//
|
||||
// lblExportProcedure
|
||||
//
|
||||
this.lblExportProcedure.AutoSize = true;
|
||||
this.lblExportProcedure.Location = new System.Drawing.Point(12, 61);
|
||||
this.lblExportProcedure.Name = "lblExportProcedure";
|
||||
this.lblExportProcedure.Size = new System.Drawing.Size(61, 13);
|
||||
this.lblExportProcedure.TabIndex = 4;
|
||||
this.lblExportProcedure.Text = "Procedures";
|
||||
//
|
||||
// btnDoExport
|
||||
//
|
||||
this.btnDoExport.Enabled = false;
|
||||
this.btnDoExport.Location = new System.Drawing.Point(15, 25);
|
||||
this.btnDoExport.Name = "btnDoExport";
|
||||
this.btnDoExport.Size = new System.Drawing.Size(119, 23);
|
||||
this.btnDoExport.TabIndex = 3;
|
||||
this.btnDoExport.Text = "Process Export";
|
||||
this.btnDoExport.UseVisualStyleBackColor = true;
|
||||
this.btnDoExport.Click += new System.EventHandler(this.btnDoExport_Click);
|
||||
//
|
||||
// btnExport
|
||||
//
|
||||
this.btnExport.Location = new System.Drawing.Point(582, 3);
|
||||
this.btnExport.Name = "btnExport";
|
||||
this.btnExport.Size = new System.Drawing.Size(25, 23);
|
||||
this.btnExport.TabIndex = 2;
|
||||
this.btnExport.Text = "...";
|
||||
this.btnExport.UseVisualStyleBackColor = true;
|
||||
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
|
||||
//
|
||||
// txtExport
|
||||
//
|
||||
this.txtExport.Location = new System.Drawing.Point(141, 6);
|
||||
this.txtExport.Name = "txtExport";
|
||||
this.txtExport.ReadOnly = true;
|
||||
this.txtExport.Size = new System.Drawing.Size(435, 20);
|
||||
this.txtExport.TabIndex = 1;
|
||||
this.txtExport.TextChanged += new System.EventHandler(this.txtExport_TextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(123, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Select Export File Name:";
|
||||
//
|
||||
// pnlImport
|
||||
//
|
||||
this.pnlImport.Controls.Add(this.btnCloseImport);
|
||||
this.pnlImport.Controls.Add(this.lblImportTime);
|
||||
this.pnlImport.Controls.Add(this.lblImportStatus);
|
||||
this.pnlImport.Controls.Add(this.pbImportStep);
|
||||
this.pnlImport.Controls.Add(this.lblImportStep);
|
||||
this.pnlImport.Controls.Add(this.pbImportSection);
|
||||
this.pnlImport.Controls.Add(this.lblImportSection);
|
||||
this.pnlImport.Controls.Add(this.pbImportProcedure);
|
||||
this.pnlImport.Controls.Add(this.lblImportProcedure);
|
||||
this.pnlImport.Controls.Add(this.btnDoImport);
|
||||
this.pnlImport.Controls.Add(this.btnImport);
|
||||
this.pnlImport.Controls.Add(this.txtImport);
|
||||
this.pnlImport.Controls.Add(this.label2);
|
||||
this.pnlImport.Location = new System.Drawing.Point(12, 217);
|
||||
this.pnlImport.Name = "pnlImport";
|
||||
this.pnlImport.Size = new System.Drawing.Size(618, 225);
|
||||
this.pnlImport.TabIndex = 1;
|
||||
//
|
||||
// lblImportStatus
|
||||
//
|
||||
this.lblImportStatus.AutoSize = true;
|
||||
this.lblImportStatus.Location = new System.Drawing.Point(137, 31);
|
||||
this.lblImportStatus.Name = "lblImportStatus";
|
||||
this.lblImportStatus.Size = new System.Drawing.Size(132, 13);
|
||||
this.lblImportStatus.TabIndex = 16;
|
||||
this.lblImportStatus.Text = "Awaiting Import File Name:";
|
||||
//
|
||||
// pbImportStep
|
||||
//
|
||||
this.pbImportStep.Location = new System.Drawing.Point(15, 156);
|
||||
this.pbImportStep.Name = "pbImportStep";
|
||||
this.pbImportStep.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbImportStep.Step = 1;
|
||||
this.pbImportStep.TabIndex = 15;
|
||||
//
|
||||
// lblImportStep
|
||||
//
|
||||
this.lblImportStep.AutoSize = true;
|
||||
this.lblImportStep.Location = new System.Drawing.Point(12, 140);
|
||||
this.lblImportStep.Name = "lblImportStep";
|
||||
this.lblImportStep.Size = new System.Drawing.Size(34, 13);
|
||||
this.lblImportStep.TabIndex = 14;
|
||||
this.lblImportStep.Text = "Steps";
|
||||
//
|
||||
// pbImportSection
|
||||
//
|
||||
this.pbImportSection.Location = new System.Drawing.Point(14, 117);
|
||||
this.pbImportSection.Name = "pbImportSection";
|
||||
this.pbImportSection.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbImportSection.Step = 1;
|
||||
this.pbImportSection.TabIndex = 13;
|
||||
//
|
||||
// lblImportSection
|
||||
//
|
||||
this.lblImportSection.AutoSize = true;
|
||||
this.lblImportSection.Location = new System.Drawing.Point(12, 101);
|
||||
this.lblImportSection.Name = "lblImportSection";
|
||||
this.lblImportSection.Size = new System.Drawing.Size(48, 13);
|
||||
this.lblImportSection.TabIndex = 12;
|
||||
this.lblImportSection.Text = "Sections";
|
||||
//
|
||||
// pbImportProcedure
|
||||
//
|
||||
this.pbImportProcedure.Location = new System.Drawing.Point(14, 78);
|
||||
this.pbImportProcedure.Name = "pbImportProcedure";
|
||||
this.pbImportProcedure.Size = new System.Drawing.Size(561, 20);
|
||||
this.pbImportProcedure.Step = 1;
|
||||
this.pbImportProcedure.TabIndex = 11;
|
||||
//
|
||||
// lblImportProcedure
|
||||
//
|
||||
this.lblImportProcedure.AutoSize = true;
|
||||
this.lblImportProcedure.Location = new System.Drawing.Point(12, 62);
|
||||
this.lblImportProcedure.Name = "lblImportProcedure";
|
||||
this.lblImportProcedure.Size = new System.Drawing.Size(61, 13);
|
||||
this.lblImportProcedure.TabIndex = 10;
|
||||
this.lblImportProcedure.Text = "Procedures";
|
||||
//
|
||||
// btnDoImport
|
||||
//
|
||||
this.btnDoImport.Enabled = false;
|
||||
this.btnDoImport.Location = new System.Drawing.Point(15, 26);
|
||||
this.btnDoImport.Name = "btnDoImport";
|
||||
this.btnDoImport.Size = new System.Drawing.Size(119, 23);
|
||||
this.btnDoImport.TabIndex = 5;
|
||||
this.btnDoImport.Text = "Process Import";
|
||||
this.btnDoImport.UseVisualStyleBackColor = true;
|
||||
this.btnDoImport.Click += new System.EventHandler(this.btnDoImport_Click);
|
||||
//
|
||||
// btnImport
|
||||
//
|
||||
this.btnImport.Location = new System.Drawing.Point(581, 4);
|
||||
this.btnImport.Name = "btnImport";
|
||||
this.btnImport.Size = new System.Drawing.Size(25, 23);
|
||||
this.btnImport.TabIndex = 4;
|
||||
this.btnImport.Text = "...";
|
||||
this.btnImport.UseVisualStyleBackColor = true;
|
||||
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
|
||||
//
|
||||
// txtImport
|
||||
//
|
||||
this.txtImport.Location = new System.Drawing.Point(140, 7);
|
||||
this.txtImport.Name = "txtImport";
|
||||
this.txtImport.ReadOnly = true;
|
||||
this.txtImport.Size = new System.Drawing.Size(435, 20);
|
||||
this.txtImport.TabIndex = 3;
|
||||
this.txtImport.TextChanged += new System.EventHandler(this.txtImport_TextChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 10);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(122, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Select Import File Name:";
|
||||
//
|
||||
// ofd
|
||||
//
|
||||
this.ofd.AddExtension = false;
|
||||
this.ofd.Filter = "PROMS Export Files|*.expx";
|
||||
this.ofd.Title = "Import File Name";
|
||||
//
|
||||
// sfd
|
||||
//
|
||||
this.sfd.DefaultExt = "expx";
|
||||
this.sfd.Filter = "PROMS Export Files|*.expx";
|
||||
this.sfd.Title = "Export File Name";
|
||||
//
|
||||
// lblExportTime
|
||||
//
|
||||
this.lblExportTime.AutoSize = true;
|
||||
this.lblExportTime.Location = new System.Drawing.Point(392, 29);
|
||||
this.lblExportTime.Name = "lblExportTime";
|
||||
this.lblExportTime.Size = new System.Drawing.Size(28, 13);
|
||||
this.lblExportTime.TabIndex = 11;
|
||||
this.lblExportTime.Text = "0:00";
|
||||
this.lblExportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// lblImportTime
|
||||
//
|
||||
this.lblImportTime.AutoSize = true;
|
||||
this.lblImportTime.Location = new System.Drawing.Point(392, 30);
|
||||
this.lblImportTime.Name = "lblImportTime";
|
||||
this.lblImportTime.Size = new System.Drawing.Size(28, 13);
|
||||
this.lblImportTime.TabIndex = 17;
|
||||
this.lblImportTime.Text = "0.00";
|
||||
this.lblImportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// btnCloseExport
|
||||
//
|
||||
this.btnCloseExport.Enabled = false;
|
||||
this.btnCloseExport.Location = new System.Drawing.Point(562, 32);
|
||||
this.btnCloseExport.Name = "btnCloseExport";
|
||||
this.btnCloseExport.Size = new System.Drawing.Size(53, 23);
|
||||
this.btnCloseExport.TabIndex = 12;
|
||||
this.btnCloseExport.Text = "Close";
|
||||
this.btnCloseExport.UseVisualStyleBackColor = true;
|
||||
this.btnCloseExport.Click += new System.EventHandler(this.btnCloseExport_Click);
|
||||
//
|
||||
// btnCloseImport
|
||||
//
|
||||
this.btnCloseImport.Enabled = false;
|
||||
this.btnCloseImport.Location = new System.Drawing.Point(562, 33);
|
||||
this.btnCloseImport.Name = "btnCloseImport";
|
||||
this.btnCloseImport.Size = new System.Drawing.Size(53, 23);
|
||||
this.btnCloseImport.TabIndex = 18;
|
||||
this.btnCloseImport.Text = "Close";
|
||||
this.btnCloseImport.UseVisualStyleBackColor = true;
|
||||
this.btnCloseImport.Click += new System.EventHandler(this.btnCloseImport_Click);
|
||||
//
|
||||
// dlgExportImport
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(634, 454);
|
||||
this.Controls.Add(this.pnlImport);
|
||||
this.Controls.Add(this.pnlExport);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "dlgExportImport";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Export Import Dialog";
|
||||
this.Load += new System.EventHandler(this.dlgExportImport_Load);
|
||||
this.pnlExport.ResumeLayout(false);
|
||||
this.pnlExport.PerformLayout();
|
||||
this.pnlImport.ResumeLayout(false);
|
||||
this.pnlImport.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pnlExport;
|
||||
private System.Windows.Forms.Panel pnlImport;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button btnExport;
|
||||
private System.Windows.Forms.TextBox txtExport;
|
||||
private System.Windows.Forms.Button btnImport;
|
||||
private System.Windows.Forms.TextBox txtImport;
|
||||
private System.Windows.Forms.Button btnDoExport;
|
||||
private System.Windows.Forms.Button btnDoImport;
|
||||
private System.Windows.Forms.ProgressBar pbExportStep;
|
||||
private System.Windows.Forms.Label lblExportStep;
|
||||
private System.Windows.Forms.ProgressBar pbExportSection;
|
||||
private System.Windows.Forms.Label lblExportSection;
|
||||
private System.Windows.Forms.ProgressBar pbExportProcedure;
|
||||
private System.Windows.Forms.Label lblExportProcedure;
|
||||
private System.Windows.Forms.ProgressBar pbImportStep;
|
||||
private System.Windows.Forms.Label lblImportStep;
|
||||
private System.Windows.Forms.ProgressBar pbImportSection;
|
||||
private System.Windows.Forms.Label lblImportSection;
|
||||
private System.Windows.Forms.ProgressBar pbImportProcedure;
|
||||
private System.Windows.Forms.Label lblImportProcedure;
|
||||
private System.Windows.Forms.OpenFileDialog ofd;
|
||||
private System.Windows.Forms.SaveFileDialog sfd;
|
||||
private System.Windows.Forms.Label lblExportStatus;
|
||||
private System.Windows.Forms.Label lblImportStatus;
|
||||
private System.Windows.Forms.Label lblExportTime;
|
||||
private System.Windows.Forms.Label lblImportTime;
|
||||
private System.Windows.Forms.Button btnCloseExport;
|
||||
private System.Windows.Forms.Button btnCloseImport;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="sfd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>87, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Generated
-74
@@ -1,74 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class frmCntTkn
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button1.Location = new System.Drawing.Point(12, 8);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(132, 22);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Count Chars/Tokens";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
this.listBox1.Font = new System.Drawing.Font("Arial Unicode MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.ItemHeight = 15;
|
||||
this.listBox1.Location = new System.Drawing.Point(12, 36);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(225, 409);
|
||||
this.listBox1.TabIndex = 55;
|
||||
//
|
||||
// frmCntTkn
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(331, 486);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "frmCntTkn";
|
||||
this.Text = "frmCntTkn";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class frmCntTkn : Form
|
||||
{
|
||||
private Dictionary<char, int> dicCharCount;
|
||||
|
||||
public frmCntTkn()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CountChars(string txt)
|
||||
{
|
||||
foreach (char ch in txt)
|
||||
{
|
||||
//'A' is a newline
|
||||
int ich = Convert.ToInt32(ch);
|
||||
if (ich == 0xD) Console.WriteLine("D is {0}", txt);
|
||||
if (ich == 0x17) Console.WriteLine("17 is {0}", txt);
|
||||
if (!dicCharCount.ContainsKey(ch))
|
||||
dicCharCount[ch] = 1;
|
||||
else
|
||||
dicCharCount[ch] = dicCharCount[ch] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
//private void ProcessText()
|
||||
//{
|
||||
// TextMInfoList txtMList = TextMInfoList.Get();
|
||||
// foreach (TextMInfo txtM in txtMList)
|
||||
// {
|
||||
// string thetext = txtM.TextMValue;
|
||||
// CountChars(thetext);
|
||||
// }
|
||||
//}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Create a dictionary that stores characters
|
||||
// read in data from dbf
|
||||
// list chars
|
||||
dicCharCount = new Dictionary<char, int>();
|
||||
//ProcessText();
|
||||
|
||||
// now display dictionary results..
|
||||
Console.WriteLine("Char\t\tHex\t\tDec\t\tCount");
|
||||
foreach (char ch in dicCharCount.Keys)
|
||||
{
|
||||
// if character is a 'token' and not a hardspace (A0), linefeed (A), RO token (15)
|
||||
// Transition tokens (0x252c & -x2566) then show it.
|
||||
if ((ch < 0x20 || ch > 0x7E) && ch!= 0xA0 && ch != 0xA && ch != 0x15 && ch != 0x252C && ch != 0x2566)
|
||||
{
|
||||
int ich = Convert.ToInt32(ch);
|
||||
string cntstr = String.Format("{0}\t\t{1}\t\t{2}\t\t{3}", ch, ich.ToString("X4"), ich.ToString(), dicCharCount[ch]);
|
||||
listBox1.Items.Add(cntstr);
|
||||
Console.WriteLine(cntstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-62
@@ -1,62 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class frmErrors
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tbErrors = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tbErrors
|
||||
//
|
||||
this.tbErrors.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbErrors.Location = new System.Drawing.Point(0, 0);
|
||||
this.tbErrors.Multiline = true;
|
||||
this.tbErrors.Name = "tbErrors";
|
||||
this.tbErrors.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.tbErrors.Size = new System.Drawing.Size(548, 264);
|
||||
this.tbErrors.TabIndex = 0;
|
||||
//
|
||||
// frmErrors
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(548, 264);
|
||||
this.Controls.Add(this.tbErrors);
|
||||
this.Name = "frmErrors";
|
||||
this.Text = "Data Loader Errors";
|
||||
this.Load += new System.EventHandler(this.frmErrors_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox tbErrors;
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class frmErrors : Form
|
||||
{
|
||||
private Form _MyParent;
|
||||
public frmErrors(Form myParent)
|
||||
{
|
||||
InitializeComponent();
|
||||
_MyParent = myParent;
|
||||
_MyParent.Move += new EventHandler(_MyParent_Move);
|
||||
}
|
||||
void _MyParent_Move(object sender, EventArgs e)
|
||||
{
|
||||
AdjustLocation();
|
||||
}
|
||||
private int _ErrorCount = 0;
|
||||
public int ErrorCount
|
||||
{
|
||||
get { return _ErrorCount; }
|
||||
set { _ErrorCount = value; }
|
||||
}
|
||||
private int _WarningCount = 0;
|
||||
public int WarningCount
|
||||
{
|
||||
get { return _WarningCount; }
|
||||
set { _WarningCount = value; }
|
||||
}
|
||||
private int _InfoCount = 0;
|
||||
public int InfoCount
|
||||
{
|
||||
get { return _InfoCount; }
|
||||
set { _InfoCount = value; }
|
||||
}
|
||||
string sep = "";
|
||||
public void Add(string err, MessageType messageType)
|
||||
{
|
||||
switch (messageType)
|
||||
{
|
||||
case MessageType.Information:
|
||||
_InfoCount++;
|
||||
break;
|
||||
case MessageType.Warning:
|
||||
_WarningCount++;
|
||||
break;
|
||||
case MessageType.Error:
|
||||
_ErrorCount++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//tbErrors.SelectionStart = tbErrors.TextLength;
|
||||
//tbErrors.SelectedText = sep + err;
|
||||
tbErrors.AppendText(sep + err);
|
||||
sep = "\r\n";
|
||||
Show();
|
||||
Application.DoEvents();
|
||||
}
|
||||
public void Clear()
|
||||
{
|
||||
tbErrors.Text = "";
|
||||
sep = "";
|
||||
Hide();
|
||||
}
|
||||
private void frmErrors_Load(object sender, EventArgs e)
|
||||
{
|
||||
AdjustLocation();
|
||||
}
|
||||
private void AdjustLocation()
|
||||
{
|
||||
int maxRight = Screen.GetWorkingArea(this).Right;
|
||||
if (Screen.AllScreens.Length > 1)
|
||||
{
|
||||
foreach (Screen sc in Screen.AllScreens)
|
||||
if (sc.WorkingArea.Right > maxRight) maxRight = sc.WorkingArea.Right;
|
||||
}
|
||||
Top = _MyParent.Top;
|
||||
Left = _MyParent.Right + Width > maxRight ? maxRight - Width : _MyParent.Right;
|
||||
}
|
||||
public void Save(string path)
|
||||
{
|
||||
StreamWriter fs = new StreamWriter(path, false);
|
||||
fs.Write(tbErrors.Text);
|
||||
fs.Close();
|
||||
}
|
||||
}
|
||||
public enum MessageType
|
||||
{
|
||||
Information,
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
}
|
||||
Generated
-615
@@ -1,615 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class frmLoader
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
Volian.MSWord.WordDoc.CloseApp();
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.sc = new System.Windows.Forms.SplitContainer();
|
||||
this.lblCurSetFolder = new System.Windows.Forms.Label();
|
||||
this.lblProcessing = new System.Windows.Forms.Label();
|
||||
this.lblTime = new System.Windows.Forms.Label();
|
||||
this.pbStep = new System.Windows.Forms.ProgressBar();
|
||||
this.pbSect = new System.Windows.Forms.ProgressBar();
|
||||
this.pbProc = new System.Windows.Forms.ProgressBar();
|
||||
this.lblStep = new System.Windows.Forms.Label();
|
||||
this.lblSection = new System.Windows.Forms.Label();
|
||||
this.lblProc = new System.Windows.Forms.Label();
|
||||
this.tv = new System.Windows.Forms.TreeView();
|
||||
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tsslError = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.completeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.formatOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToChangeManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToApprovalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.load16BitApprovalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixROValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.oldToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertTopFoldersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadTreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadVETreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.countTokensToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.approvalDatabasesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.updateFormatsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixROsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixROsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.importDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportProcedureOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.importProcedureOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sc.Panel1.SuspendLayout();
|
||||
this.sc.Panel2.SuspendLayout();
|
||||
this.sc.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// sc
|
||||
//
|
||||
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.sc.Location = new System.Drawing.Point(0, 24);
|
||||
this.sc.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.sc.Name = "sc";
|
||||
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// sc.Panel1
|
||||
//
|
||||
this.sc.Panel1.Controls.Add(this.lblCurSetFolder);
|
||||
this.sc.Panel1.Controls.Add(this.lblProcessing);
|
||||
this.sc.Panel1.Controls.Add(this.lblTime);
|
||||
this.sc.Panel1.Controls.Add(this.pbStep);
|
||||
this.sc.Panel1.Controls.Add(this.pbSect);
|
||||
this.sc.Panel1.Controls.Add(this.pbProc);
|
||||
this.sc.Panel1.Controls.Add(this.lblStep);
|
||||
this.sc.Panel1.Controls.Add(this.lblSection);
|
||||
this.sc.Panel1.Controls.Add(this.lblProc);
|
||||
//
|
||||
// sc.Panel2
|
||||
//
|
||||
this.sc.Panel2.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.sc.Panel2.Controls.Add(this.tv);
|
||||
this.sc.Size = new System.Drawing.Size(664, 370);
|
||||
this.sc.SplitterDistance = 134;
|
||||
this.sc.SplitterWidth = 3;
|
||||
this.sc.TabIndex = 46;
|
||||
//
|
||||
// lblCurSetFolder
|
||||
//
|
||||
this.lblCurSetFolder.AutoSize = true;
|
||||
this.lblCurSetFolder.ForeColor = System.Drawing.Color.Blue;
|
||||
this.lblCurSetFolder.Location = new System.Drawing.Point(177, 97);
|
||||
this.lblCurSetFolder.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblCurSetFolder.Name = "lblCurSetFolder";
|
||||
this.lblCurSetFolder.Size = new System.Drawing.Size(16, 13);
|
||||
this.lblCurSetFolder.TabIndex = 75;
|
||||
this.lblCurSetFolder.Text = "...";
|
||||
this.lblCurSetFolder.Visible = false;
|
||||
//
|
||||
// lblProcessing
|
||||
//
|
||||
this.lblProcessing.AutoSize = true;
|
||||
this.lblProcessing.Location = new System.Drawing.Point(7, 97);
|
||||
this.lblProcessing.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblProcessing.Name = "lblProcessing";
|
||||
this.lblProcessing.Size = new System.Drawing.Size(165, 13);
|
||||
this.lblProcessing.TabIndex = 74;
|
||||
this.lblProcessing.Text = "Processing Procedure Set Folder:";
|
||||
this.lblProcessing.Visible = false;
|
||||
//
|
||||
// lblTime
|
||||
//
|
||||
this.lblTime.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblTime.Location = new System.Drawing.Point(7, 67);
|
||||
this.lblTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblTime.Name = "lblTime";
|
||||
this.lblTime.Size = new System.Drawing.Size(106, 16);
|
||||
this.lblTime.TabIndex = 58;
|
||||
//
|
||||
// pbStep
|
||||
//
|
||||
this.pbStep.Location = new System.Drawing.Point(115, 41);
|
||||
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbStep.Name = "pbStep";
|
||||
this.pbStep.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbStep.TabIndex = 57;
|
||||
//
|
||||
// pbSect
|
||||
//
|
||||
this.pbSect.Location = new System.Drawing.Point(115, 24);
|
||||
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbSect.Name = "pbSect";
|
||||
this.pbSect.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbSect.TabIndex = 56;
|
||||
//
|
||||
// pbProc
|
||||
//
|
||||
this.pbProc.Location = new System.Drawing.Point(115, 9);
|
||||
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbProc.Name = "pbProc";
|
||||
this.pbProc.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbProc.TabIndex = 55;
|
||||
//
|
||||
// lblStep
|
||||
//
|
||||
this.lblStep.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblStep.Location = new System.Drawing.Point(7, 47);
|
||||
this.lblStep.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblStep.Name = "lblStep";
|
||||
this.lblStep.Size = new System.Drawing.Size(106, 16);
|
||||
this.lblStep.TabIndex = 49;
|
||||
//
|
||||
// lblSection
|
||||
//
|
||||
this.lblSection.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblSection.Location = new System.Drawing.Point(7, 28);
|
||||
this.lblSection.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblSection.Name = "lblSection";
|
||||
this.lblSection.Size = new System.Drawing.Size(106, 15);
|
||||
this.lblSection.TabIndex = 48;
|
||||
//
|
||||
// lblProc
|
||||
//
|
||||
this.lblProc.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblProc.Location = new System.Drawing.Point(7, 9);
|
||||
this.lblProc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblProc.Name = "lblProc";
|
||||
this.lblProc.Size = new System.Drawing.Size(106, 15);
|
||||
this.lblProc.TabIndex = 47;
|
||||
//
|
||||
// tv
|
||||
//
|
||||
this.tv.CheckBoxes = true;
|
||||
this.tv.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tv.Location = new System.Drawing.Point(0, 0);
|
||||
this.tv.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.tv.Name = "tv";
|
||||
this.tv.Size = new System.Drawing.Size(664, 233);
|
||||
this.tv.TabIndex = 24;
|
||||
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);
|
||||
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1,
|
||||
this.tsslError});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 349);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(664, 45);
|
||||
this.statusStrip1.TabIndex = 47;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// toolStripStatusLabel1
|
||||
//
|
||||
this.toolStripStatusLabel1.AutoSize = false;
|
||||
this.toolStripStatusLabel1.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
||||
this.toolStripStatusLabel1.Size = new System.Drawing.Size(500, 40);
|
||||
this.toolStripStatusLabel1.Text = "Status Information";
|
||||
this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
//
|
||||
// tsslError
|
||||
//
|
||||
this.tsslError.AutoSize = false;
|
||||
this.tsslError.Name = "tsslError";
|
||||
this.tsslError.Size = new System.Drawing.Size(150, 40);
|
||||
this.tsslError.Text = "No Errors";
|
||||
this.tsslError.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.processToolStripMenuItem,
|
||||
this.settingsToolStripMenuItem,
|
||||
this.oldToolStripMenuItem,
|
||||
this.fixAllToolStripMenuItem,
|
||||
this.fixROsToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(664, 24);
|
||||
this.menuStrip1.TabIndex = 48;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.exitToolStripMenuItem,
|
||||
this.loadTreeToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// loadTreeToolStripMenuItem
|
||||
//
|
||||
this.loadTreeToolStripMenuItem.Name = "loadTreeToolStripMenuItem";
|
||||
this.loadTreeToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
|
||||
this.loadTreeToolStripMenuItem.Text = "Load Tree";
|
||||
this.loadTreeToolStripMenuItem.Click += new System.EventHandler(this.loadTreeToolStripMenuItem_Click);
|
||||
//
|
||||
// processToolStripMenuItem
|
||||
//
|
||||
this.processToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.completeToolStripMenuItem,
|
||||
this.toolStripMenuItem1,
|
||||
this.formatOnlyToolStripMenuItem,
|
||||
this.toolStripMenuItem2,
|
||||
this.convertDBToolStripMenuItem,
|
||||
this.fixTransitionsToolStripMenuItem,
|
||||
this.convertToChangeManagerToolStripMenuItem,
|
||||
this.convertToApprovalToolStripMenuItem,
|
||||
this.load16BitApprovalToolStripMenuItem,
|
||||
this.fixesToolStripMenuItem,
|
||||
this.fixROValuesToolStripMenuItem,
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem});
|
||||
this.processToolStripMenuItem.Name = "processToolStripMenuItem";
|
||||
this.processToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
|
||||
this.processToolStripMenuItem.Text = "&Process";
|
||||
//
|
||||
// completeToolStripMenuItem
|
||||
//
|
||||
this.completeToolStripMenuItem.Name = "completeToolStripMenuItem";
|
||||
this.completeToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.completeToolStripMenuItem.Text = "Complete";
|
||||
this.completeToolStripMenuItem.Click += new System.EventHandler(this.completeToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(236, 6);
|
||||
//
|
||||
// formatOnlyToolStripMenuItem
|
||||
//
|
||||
this.formatOnlyToolStripMenuItem.Name = "formatOnlyToolStripMenuItem";
|
||||
this.formatOnlyToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.formatOnlyToolStripMenuItem.Text = "Format Only";
|
||||
this.formatOnlyToolStripMenuItem.Click += new System.EventHandler(this.formatOnlyToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(236, 6);
|
||||
//
|
||||
// convertDBToolStripMenuItem
|
||||
//
|
||||
this.convertDBToolStripMenuItem.Name = "convertDBToolStripMenuItem";
|
||||
this.convertDBToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertDBToolStripMenuItem.Text = "Convert DB";
|
||||
this.convertDBToolStripMenuItem.Click += new System.EventHandler(this.convertDBToolStripMenuItem_Click);
|
||||
//
|
||||
// fixTransitionsToolStripMenuItem
|
||||
//
|
||||
this.fixTransitionsToolStripMenuItem.Name = "fixTransitionsToolStripMenuItem";
|
||||
this.fixTransitionsToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.fixTransitionsToolStripMenuItem.Text = "Fix Transitions";
|
||||
this.fixTransitionsToolStripMenuItem.Click += new System.EventHandler(this.fixTransitionsToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToChangeManagerToolStripMenuItem
|
||||
//
|
||||
this.convertToChangeManagerToolStripMenuItem.Name = "convertToChangeManagerToolStripMenuItem";
|
||||
this.convertToChangeManagerToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertToChangeManagerToolStripMenuItem.Text = "Convert to Change Manager";
|
||||
this.convertToChangeManagerToolStripMenuItem.Click += new System.EventHandler(this.convertToChangeManagerToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToApprovalToolStripMenuItem
|
||||
//
|
||||
this.convertToApprovalToolStripMenuItem.Name = "convertToApprovalToolStripMenuItem";
|
||||
this.convertToApprovalToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertToApprovalToolStripMenuItem.Text = "Convert to Approval";
|
||||
this.convertToApprovalToolStripMenuItem.Click += new System.EventHandler(this.convertToApprovalToolStripMenuItem_Click);
|
||||
//
|
||||
// load16BitApprovalToolStripMenuItem
|
||||
//
|
||||
this.load16BitApprovalToolStripMenuItem.Name = "load16BitApprovalToolStripMenuItem";
|
||||
this.load16BitApprovalToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.load16BitApprovalToolStripMenuItem.Text = "Load 16-Bit Approval";
|
||||
this.load16BitApprovalToolStripMenuItem.Click += new System.EventHandler(this.load16BitApprovalToolStripMenuItem_Click);
|
||||
//
|
||||
// fixesToolStripMenuItem
|
||||
//
|
||||
this.fixesToolStripMenuItem.Name = "fixesToolStripMenuItem";
|
||||
this.fixesToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.fixesToolStripMenuItem.Text = "Fixes";
|
||||
this.fixesToolStripMenuItem.Click += new System.EventHandler(this.fixesToolStripMenuItem_Click);
|
||||
//
|
||||
// fixROValuesToolStripMenuItem
|
||||
//
|
||||
this.fixROValuesToolStripMenuItem.Name = "fixROValuesToolStripMenuItem";
|
||||
this.fixROValuesToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.fixROValuesToolStripMenuItem.Text = "Fix RO Values";
|
||||
this.fixROValuesToolStripMenuItem.Click += new System.EventHandler(this.fixROValuesToolStripMenuItem_Click);
|
||||
//
|
||||
// createEmptyPROMSDatabaseToolStripMenuItem
|
||||
//
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Name = "createEmptyPROMSDatabaseToolStripMenuItem";
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Text = "Create Empty PROMS Database";
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Click += new System.EventHandler(this.createEmptyPROMSDatabaseToolStripMenuItem_Click);
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.settingsToolStripMenuItem.Text = "&Settings";
|
||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||
//
|
||||
// oldToolStripMenuItem
|
||||
//
|
||||
this.oldToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.convertSecurityToolStripMenuItem,
|
||||
this.toolStripMenuItem4,
|
||||
this.convertTopFoldersToolStripMenuItem,
|
||||
this.loadTreeFromCSLAToolStripMenuItem,
|
||||
this.loadVETreeFromCSLAToolStripMenuItem,
|
||||
this.groupSecurityToolStripMenuItem,
|
||||
this.countTokensToolStripMenuItem,
|
||||
this.toolStripMenuItem3,
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem});
|
||||
this.oldToolStripMenuItem.Name = "oldToolStripMenuItem";
|
||||
this.oldToolStripMenuItem.Size = new System.Drawing.Size(38, 20);
|
||||
this.oldToolStripMenuItem.Text = "Old";
|
||||
//
|
||||
// convertSecurityToolStripMenuItem
|
||||
//
|
||||
this.convertSecurityToolStripMenuItem.Name = "convertSecurityToolStripMenuItem";
|
||||
this.convertSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertSecurityToolStripMenuItem.Text = "Convert Security";
|
||||
this.convertSecurityToolStripMenuItem.Click += new System.EventHandler(this.convertSecurityToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// convertTopFoldersToolStripMenuItem
|
||||
//
|
||||
this.convertTopFoldersToolStripMenuItem.Name = "convertTopFoldersToolStripMenuItem";
|
||||
this.convertTopFoldersToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertTopFoldersToolStripMenuItem.Text = "Convert Top Folders";
|
||||
this.convertTopFoldersToolStripMenuItem.Click += new System.EventHandler(this.convertTopFoldersToolStripMenuItem_Click);
|
||||
//
|
||||
// loadTreeFromCSLAToolStripMenuItem
|
||||
//
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Name = "loadTreeFromCSLAToolStripMenuItem";
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Text = "Load Tree From CSLA";
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadTreeFromCSLAToolStripMenuItem_Click);
|
||||
//
|
||||
// loadVETreeFromCSLAToolStripMenuItem
|
||||
//
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Name = "loadVETreeFromCSLAToolStripMenuItem";
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Text = "Load VETree From CSLA";
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadVETreeFromCSLAToolStripMenuItem_Click);
|
||||
//
|
||||
// groupSecurityToolStripMenuItem
|
||||
//
|
||||
this.groupSecurityToolStripMenuItem.Name = "groupSecurityToolStripMenuItem";
|
||||
this.groupSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.groupSecurityToolStripMenuItem.Text = "Group/Security";
|
||||
this.groupSecurityToolStripMenuItem.Click += new System.EventHandler(this.groupSecurityToolStripMenuItem_Click);
|
||||
//
|
||||
// countTokensToolStripMenuItem
|
||||
//
|
||||
this.countTokensToolStripMenuItem.Name = "countTokensToolStripMenuItem";
|
||||
this.countTokensToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.countTokensToolStripMenuItem.Text = "Count Tokens";
|
||||
this.countTokensToolStripMenuItem.Click += new System.EventHandler(this.countTokensToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// convertDbfSelectedInTreeToolStripMenuItem
|
||||
//
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Name = "convertDbfSelectedInTreeToolStripMenuItem";
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Text = "Convert Dbf Selected In Tree";
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Click += new System.EventHandler(this.convertDbfSelectedInTreeToolStripMenuItem_Click);
|
||||
//
|
||||
// fixAllToolStripMenuItem
|
||||
//
|
||||
this.fixAllToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.approvalDatabasesToolStripMenuItem,
|
||||
this.updateFormatsToolStripMenuItem});
|
||||
this.fixAllToolStripMenuItem.Name = "fixAllToolStripMenuItem";
|
||||
this.fixAllToolStripMenuItem.Size = new System.Drawing.Size(50, 20);
|
||||
this.fixAllToolStripMenuItem.Text = "Fix All";
|
||||
//
|
||||
// approvalDatabasesToolStripMenuItem
|
||||
//
|
||||
this.approvalDatabasesToolStripMenuItem.Name = "approvalDatabasesToolStripMenuItem";
|
||||
this.approvalDatabasesToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
|
||||
this.approvalDatabasesToolStripMenuItem.Text = "Approval Databases";
|
||||
this.approvalDatabasesToolStripMenuItem.Click += new System.EventHandler(this.approvalDatabasesToolStripMenuItem_Click);
|
||||
//
|
||||
// updateFormatsToolStripMenuItem
|
||||
//
|
||||
this.updateFormatsToolStripMenuItem.Name = "updateFormatsToolStripMenuItem";
|
||||
this.updateFormatsToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
|
||||
this.updateFormatsToolStripMenuItem.Text = "Update Formats";
|
||||
this.updateFormatsToolStripMenuItem.Click += new System.EventHandler(this.updateFormatsToolStripMenuItem_Click);
|
||||
//
|
||||
// fixROsToolStripMenuItem
|
||||
//
|
||||
this.fixROsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fixROsToolStripMenuItem1,
|
||||
this.exportDataToolStripMenuItem,
|
||||
this.importDataToolStripMenuItem,
|
||||
this.exportProcedureOnlyToolStripMenuItem,
|
||||
this.importProcedureOnlyToolStripMenuItem});
|
||||
this.fixROsToolStripMenuItem.Name = "fixROsToolStripMenuItem";
|
||||
this.fixROsToolStripMenuItem.Size = new System.Drawing.Size(67, 20);
|
||||
this.fixROsToolStripMenuItem.Text = "Selection";
|
||||
//
|
||||
// fixROsToolStripMenuItem1
|
||||
//
|
||||
this.fixROsToolStripMenuItem1.Name = "fixROsToolStripMenuItem1";
|
||||
this.fixROsToolStripMenuItem1.Size = new System.Drawing.Size(195, 22);
|
||||
this.fixROsToolStripMenuItem1.Text = "Fix ROs";
|
||||
this.fixROsToolStripMenuItem1.Click += new System.EventHandler(this.fixROsToolStripMenuItem1_Click);
|
||||
//
|
||||
// exportDataToolStripMenuItem
|
||||
//
|
||||
this.exportDataToolStripMenuItem.Name = "exportDataToolStripMenuItem";
|
||||
this.exportDataToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.exportDataToolStripMenuItem.Text = "Export Data";
|
||||
this.exportDataToolStripMenuItem.Click += new System.EventHandler(this.exportDataToolStripMenuItem_Click);
|
||||
//
|
||||
// importDataToolStripMenuItem
|
||||
//
|
||||
this.importDataToolStripMenuItem.Name = "importDataToolStripMenuItem";
|
||||
this.importDataToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.importDataToolStripMenuItem.Text = "Import Data";
|
||||
this.importDataToolStripMenuItem.Click += new System.EventHandler(this.importDataToolStripMenuItem_Click);
|
||||
//
|
||||
// exportProcedureOnlyToolStripMenuItem
|
||||
//
|
||||
this.exportProcedureOnlyToolStripMenuItem.Name = "exportProcedureOnlyToolStripMenuItem";
|
||||
this.exportProcedureOnlyToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.exportProcedureOnlyToolStripMenuItem.Text = "Export Procedure Only";
|
||||
this.exportProcedureOnlyToolStripMenuItem.Click += new System.EventHandler(this.exportProcedureOnlyToolStripMenuItem_Click);
|
||||
//
|
||||
// importProcedureOnlyToolStripMenuItem
|
||||
//
|
||||
this.importProcedureOnlyToolStripMenuItem.Name = "importProcedureOnlyToolStripMenuItem";
|
||||
this.importProcedureOnlyToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.importProcedureOnlyToolStripMenuItem.Text = "Import Procedure Only";
|
||||
this.importProcedureOnlyToolStripMenuItem.Click += new System.EventHandler(this.importProcedureOnlyToolStripMenuItem_Click);
|
||||
//
|
||||
// frmLoader
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(664, 394);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.sc);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "frmLoader";
|
||||
this.Text = "PROMS-2010 Data Loader";
|
||||
this.Load += new System.EventHandler(this.frmLoader_Load);
|
||||
this.sc.Panel1.ResumeLayout(false);
|
||||
this.sc.Panel1.PerformLayout();
|
||||
this.sc.Panel2.ResumeLayout(false);
|
||||
this.sc.ResumeLayout(false);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer sc;
|
||||
private System.Windows.Forms.Label lblTime;
|
||||
private System.Windows.Forms.ProgressBar pbStep;
|
||||
private System.Windows.Forms.ProgressBar pbSect;
|
||||
private System.Windows.Forms.ProgressBar pbProc;
|
||||
private System.Windows.Forms.Label lblStep;
|
||||
private System.Windows.Forms.Label lblSection;
|
||||
private System.Windows.Forms.Label lblProc;
|
||||
private System.Windows.Forms.TreeView tv;
|
||||
private System.Windows.Forms.FolderBrowserDialog fbd;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel tsslError;
|
||||
private System.Windows.Forms.Label lblCurSetFolder;
|
||||
private System.Windows.Forms.Label lblProcessing;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem processToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem completeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem formatOnlyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertDBToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixTransitionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToChangeManagerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToApprovalToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem oldToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertSecurityToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertTopFoldersToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem loadTreeFromCSLAToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem loadVETreeFromCSLAToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem groupSecurityToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem countTokensToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertDbfSelectedInTreeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
|
||||
private System.Windows.Forms.ToolStripMenuItem load16BitApprovalToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixAllToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem approvalDatabasesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem updateFormatsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixROValuesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem createEmptyPROMSDatabaseToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixROsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixROsToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem loadTreeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exportDataToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem importDataToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exportProcedureOnlyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem importProcedureOnlyToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
@@ -1,545 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class frmLoader
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
Volian.MSWord.WordDoc.CloseApp();
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.sc = new System.Windows.Forms.SplitContainer();
|
||||
this.lblCurSetFolder = new System.Windows.Forms.Label();
|
||||
this.lblProcessing = new System.Windows.Forms.Label();
|
||||
this.lblTime = new System.Windows.Forms.Label();
|
||||
this.pbStep = new System.Windows.Forms.ProgressBar();
|
||||
this.pbSect = new System.Windows.Forms.ProgressBar();
|
||||
this.pbProc = new System.Windows.Forms.ProgressBar();
|
||||
this.lblStep = new System.Windows.Forms.Label();
|
||||
this.lblSection = new System.Windows.Forms.Label();
|
||||
this.lblProc = new System.Windows.Forms.Label();
|
||||
this.tv = new System.Windows.Forms.TreeView();
|
||||
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tsslError = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.completeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.formatOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToChangeManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertToApprovalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.load16BitApprovalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.oldToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.convertSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertTopFoldersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadTreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadVETreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.countTokensToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.approvalDatabasesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.updateFormatsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fixROValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sc.Panel1.SuspendLayout();
|
||||
this.sc.Panel2.SuspendLayout();
|
||||
this.sc.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// sc
|
||||
//
|
||||
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.sc.Location = new System.Drawing.Point(0, 24);
|
||||
this.sc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.sc.Name = "sc";
|
||||
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// sc.Panel1
|
||||
//
|
||||
this.sc.Panel1.Controls.Add(this.lblCurSetFolder);
|
||||
this.sc.Panel1.Controls.Add(this.lblProcessing);
|
||||
this.sc.Panel1.Controls.Add(this.lblTime);
|
||||
this.sc.Panel1.Controls.Add(this.pbStep);
|
||||
this.sc.Panel1.Controls.Add(this.pbSect);
|
||||
this.sc.Panel1.Controls.Add(this.pbProc);
|
||||
this.sc.Panel1.Controls.Add(this.lblStep);
|
||||
this.sc.Panel1.Controls.Add(this.lblSection);
|
||||
this.sc.Panel1.Controls.Add(this.lblProc);
|
||||
//
|
||||
// sc.Panel2
|
||||
//
|
||||
this.sc.Panel2.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.sc.Panel2.Controls.Add(this.tv);
|
||||
this.sc.Size = new System.Drawing.Size(664, 370);
|
||||
this.sc.SplitterDistance = 134;
|
||||
this.sc.SplitterWidth = 3;
|
||||
this.sc.TabIndex = 46;
|
||||
//
|
||||
// lblCurSetFolder
|
||||
//
|
||||
this.lblCurSetFolder.AutoSize = true;
|
||||
this.lblCurSetFolder.ForeColor = System.Drawing.Color.Blue;
|
||||
this.lblCurSetFolder.Location = new System.Drawing.Point(177, 97);
|
||||
this.lblCurSetFolder.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblCurSetFolder.Name = "lblCurSetFolder";
|
||||
this.lblCurSetFolder.Size = new System.Drawing.Size(16, 13);
|
||||
this.lblCurSetFolder.TabIndex = 75;
|
||||
this.lblCurSetFolder.Text = "...";
|
||||
this.lblCurSetFolder.Visible = false;
|
||||
//
|
||||
// lblProcessing
|
||||
//
|
||||
this.lblProcessing.AutoSize = true;
|
||||
this.lblProcessing.Location = new System.Drawing.Point(7, 97);
|
||||
this.lblProcessing.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblProcessing.Name = "lblProcessing";
|
||||
this.lblProcessing.Size = new System.Drawing.Size(165, 13);
|
||||
this.lblProcessing.TabIndex = 74;
|
||||
this.lblProcessing.Text = "Processing Procedure Set Folder:";
|
||||
this.lblProcessing.Visible = false;
|
||||
//
|
||||
// lblTime
|
||||
//
|
||||
this.lblTime.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblTime.Location = new System.Drawing.Point(7, 67);
|
||||
this.lblTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblTime.Name = "lblTime";
|
||||
this.lblTime.Size = new System.Drawing.Size(106, 16);
|
||||
this.lblTime.TabIndex = 58;
|
||||
//
|
||||
// pbStep
|
||||
//
|
||||
this.pbStep.Location = new System.Drawing.Point(115, 41);
|
||||
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbStep.Name = "pbStep";
|
||||
this.pbStep.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbStep.TabIndex = 57;
|
||||
//
|
||||
// pbSect
|
||||
//
|
||||
this.pbSect.Location = new System.Drawing.Point(115, 24);
|
||||
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbSect.Name = "pbSect";
|
||||
this.pbSect.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbSect.TabIndex = 56;
|
||||
//
|
||||
// pbProc
|
||||
//
|
||||
this.pbProc.Location = new System.Drawing.Point(115, 9);
|
||||
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pbProc.Name = "pbProc";
|
||||
this.pbProc.Size = new System.Drawing.Size(375, 12);
|
||||
this.pbProc.TabIndex = 55;
|
||||
//
|
||||
// lblStep
|
||||
//
|
||||
this.lblStep.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblStep.Location = new System.Drawing.Point(7, 47);
|
||||
this.lblStep.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblStep.Name = "lblStep";
|
||||
this.lblStep.Size = new System.Drawing.Size(106, 16);
|
||||
this.lblStep.TabIndex = 49;
|
||||
//
|
||||
// lblSection
|
||||
//
|
||||
this.lblSection.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblSection.Location = new System.Drawing.Point(7, 28);
|
||||
this.lblSection.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblSection.Name = "lblSection";
|
||||
this.lblSection.Size = new System.Drawing.Size(106, 15);
|
||||
this.lblSection.TabIndex = 48;
|
||||
//
|
||||
// lblProc
|
||||
//
|
||||
this.lblProc.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.lblProc.Location = new System.Drawing.Point(7, 9);
|
||||
this.lblProc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.lblProc.Name = "lblProc";
|
||||
this.lblProc.Size = new System.Drawing.Size(106, 15);
|
||||
this.lblProc.TabIndex = 47;
|
||||
//
|
||||
// tv
|
||||
//
|
||||
this.tv.CheckBoxes = true;
|
||||
this.tv.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tv.Location = new System.Drawing.Point(0, 0);
|
||||
this.tv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tv.Name = "tv";
|
||||
this.tv.Size = new System.Drawing.Size(664, 233);
|
||||
this.tv.TabIndex = 24;
|
||||
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);
|
||||
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1,
|
||||
this.tsslError});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 349);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(664, 45);
|
||||
this.statusStrip1.TabIndex = 47;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// toolStripStatusLabel1
|
||||
//
|
||||
this.toolStripStatusLabel1.AutoSize = false;
|
||||
this.toolStripStatusLabel1.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
||||
this.toolStripStatusLabel1.Size = new System.Drawing.Size(500, 40);
|
||||
this.toolStripStatusLabel1.Text = "Status Information";
|
||||
this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
//
|
||||
// tsslError
|
||||
//
|
||||
this.tsslError.AutoSize = false;
|
||||
this.tsslError.Name = "tsslError";
|
||||
this.tsslError.Size = new System.Drawing.Size(150, 40);
|
||||
this.tsslError.Text = "No Errors";
|
||||
this.tsslError.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.processToolStripMenuItem,
|
||||
this.settingsToolStripMenuItem,
|
||||
this.oldToolStripMenuItem,
|
||||
this.fixAllToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(664, 24);
|
||||
this.menuStrip1.TabIndex = 48;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.exitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// processToolStripMenuItem
|
||||
//
|
||||
this.processToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.completeToolStripMenuItem,
|
||||
this.toolStripMenuItem1,
|
||||
this.formatOnlyToolStripMenuItem,
|
||||
this.toolStripMenuItem2,
|
||||
this.convertDBToolStripMenuItem,
|
||||
this.fixTransitionsToolStripMenuItem,
|
||||
this.convertToChangeManagerToolStripMenuItem,
|
||||
this.convertToApprovalToolStripMenuItem,
|
||||
this.load16BitApprovalToolStripMenuItem,
|
||||
this.fixesToolStripMenuItem,
|
||||
this.fixROValuesToolStripMenuItem});
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem});
|
||||
this.processToolStripMenuItem.Name = "processToolStripMenuItem";
|
||||
this.processToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
|
||||
this.processToolStripMenuItem.Text = "&Process";
|
||||
//
|
||||
// completeToolStripMenuItem
|
||||
//
|
||||
this.completeToolStripMenuItem.Name = "completeToolStripMenuItem";
|
||||
this.completeToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.completeToolStripMenuItem.Text = "Complete";
|
||||
this.completeToolStripMenuItem.Click += new System.EventHandler(this.completeToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(236, 6);
|
||||
//
|
||||
// formatOnlyToolStripMenuItem
|
||||
//
|
||||
this.formatOnlyToolStripMenuItem.Name = "formatOnlyToolStripMenuItem";
|
||||
this.formatOnlyToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.formatOnlyToolStripMenuItem.Text = "Format Only";
|
||||
this.formatOnlyToolStripMenuItem.Click += new System.EventHandler(this.formatOnlyToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(236, 6);
|
||||
//
|
||||
// convertDBToolStripMenuItem
|
||||
//
|
||||
this.convertDBToolStripMenuItem.Name = "convertDBToolStripMenuItem";
|
||||
this.convertDBToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertDBToolStripMenuItem.Text = "Convert DB";
|
||||
this.convertDBToolStripMenuItem.Click += new System.EventHandler(this.convertDBToolStripMenuItem_Click);
|
||||
//
|
||||
// fixTransitionsToolStripMenuItem
|
||||
//
|
||||
this.fixTransitionsToolStripMenuItem.Name = "fixTransitionsToolStripMenuItem";
|
||||
this.fixTransitionsToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.fixTransitionsToolStripMenuItem.Text = "Fix Transitions";
|
||||
this.fixTransitionsToolStripMenuItem.Click += new System.EventHandler(this.fixTransitionsToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToChangeManagerToolStripMenuItem
|
||||
//
|
||||
this.convertToChangeManagerToolStripMenuItem.Name = "convertToChangeManagerToolStripMenuItem";
|
||||
this.convertToChangeManagerToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertToChangeManagerToolStripMenuItem.Text = "Convert to Change Manager";
|
||||
this.convertToChangeManagerToolStripMenuItem.Click += new System.EventHandler(this.convertToChangeManagerToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToApprovalToolStripMenuItem
|
||||
//
|
||||
this.convertToApprovalToolStripMenuItem.Name = "convertToApprovalToolStripMenuItem";
|
||||
this.convertToApprovalToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.convertToApprovalToolStripMenuItem.Text = "Convert to Approval";
|
||||
this.convertToApprovalToolStripMenuItem.Click += new System.EventHandler(this.convertToApprovalToolStripMenuItem_Click);
|
||||
//
|
||||
// load16BitApprovalToolStripMenuItem
|
||||
//
|
||||
this.load16BitApprovalToolStripMenuItem.Name = "load16BitApprovalToolStripMenuItem";
|
||||
this.load16BitApprovalToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.load16BitApprovalToolStripMenuItem.Text = "Load 16-Bit Approval";
|
||||
this.load16BitApprovalToolStripMenuItem.Click += new System.EventHandler(this.load16BitApprovalToolStripMenuItem_Click);
|
||||
//
|
||||
// fixesToolStripMenuItem
|
||||
//
|
||||
this.fixesToolStripMenuItem.Name = "fixesToolStripMenuItem";
|
||||
this.fixesToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.fixesToolStripMenuItem.Text = "Fixes";
|
||||
this.fixesToolStripMenuItem.Click += new System.EventHandler(this.fixesToolStripMenuItem_Click);
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.settingsToolStripMenuItem.Text = "&Settings";
|
||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||
//
|
||||
// oldToolStripMenuItem
|
||||
//
|
||||
this.oldToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.convertSecurityToolStripMenuItem,
|
||||
this.toolStripMenuItem4,
|
||||
this.convertTopFoldersToolStripMenuItem,
|
||||
this.loadTreeFromCSLAToolStripMenuItem,
|
||||
this.loadVETreeFromCSLAToolStripMenuItem,
|
||||
this.groupSecurityToolStripMenuItem,
|
||||
this.countTokensToolStripMenuItem,
|
||||
this.toolStripMenuItem3,
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem});
|
||||
this.oldToolStripMenuItem.Name = "oldToolStripMenuItem";
|
||||
this.oldToolStripMenuItem.Size = new System.Drawing.Size(38, 20);
|
||||
this.oldToolStripMenuItem.Text = "Old";
|
||||
//
|
||||
// convertSecurityToolStripMenuItem
|
||||
//
|
||||
this.convertSecurityToolStripMenuItem.Name = "convertSecurityToolStripMenuItem";
|
||||
this.convertSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertSecurityToolStripMenuItem.Text = "Convert Security";
|
||||
this.convertSecurityToolStripMenuItem.Click += new System.EventHandler(this.convertSecurityToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// convertTopFoldersToolStripMenuItem
|
||||
//
|
||||
this.convertTopFoldersToolStripMenuItem.Name = "convertTopFoldersToolStripMenuItem";
|
||||
this.convertTopFoldersToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertTopFoldersToolStripMenuItem.Text = "Convert Top Folders";
|
||||
this.convertTopFoldersToolStripMenuItem.Click += new System.EventHandler(this.convertTopFoldersToolStripMenuItem_Click);
|
||||
//
|
||||
// loadTreeFromCSLAToolStripMenuItem
|
||||
//
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Name = "loadTreeFromCSLAToolStripMenuItem";
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Text = "Load Tree From CSLA";
|
||||
this.loadTreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadTreeFromCSLAToolStripMenuItem_Click);
|
||||
//
|
||||
// loadVETreeFromCSLAToolStripMenuItem
|
||||
//
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Name = "loadVETreeFromCSLAToolStripMenuItem";
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Text = "Load VETree From CSLA";
|
||||
this.loadVETreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadVETreeFromCSLAToolStripMenuItem_Click);
|
||||
//
|
||||
// groupSecurityToolStripMenuItem
|
||||
//
|
||||
this.groupSecurityToolStripMenuItem.Name = "groupSecurityToolStripMenuItem";
|
||||
this.groupSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.groupSecurityToolStripMenuItem.Text = "Group/Security";
|
||||
this.groupSecurityToolStripMenuItem.Click += new System.EventHandler(this.groupSecurityToolStripMenuItem_Click);
|
||||
//
|
||||
// countTokensToolStripMenuItem
|
||||
//
|
||||
this.countTokensToolStripMenuItem.Name = "countTokensToolStripMenuItem";
|
||||
this.countTokensToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.countTokensToolStripMenuItem.Text = "Count Tokens";
|
||||
this.countTokensToolStripMenuItem.Click += new System.EventHandler(this.countTokensToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// convertDbfSelectedInTreeToolStripMenuItem
|
||||
//
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Name = "convertDbfSelectedInTreeToolStripMenuItem";
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Text = "Convert Dbf Selected In Tree";
|
||||
this.convertDbfSelectedInTreeToolStripMenuItem.Click += new System.EventHandler(this.convertDbfSelectedInTreeToolStripMenuItem_Click);
|
||||
//
|
||||
// fixAllToolStripMenuItem
|
||||
//
|
||||
this.fixAllToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.approvalDatabasesToolStripMenuItem,
|
||||
this.updateFormatsToolStripMenuItem});
|
||||
this.fixAllToolStripMenuItem.Name = "fixAllToolStripMenuItem";
|
||||
this.fixAllToolStripMenuItem.Size = new System.Drawing.Size(50, 20);
|
||||
this.fixAllToolStripMenuItem.Text = "Fix All";
|
||||
//
|
||||
// approvalDatabasesToolStripMenuItem
|
||||
//
|
||||
this.approvalDatabasesToolStripMenuItem.Name = "approvalDatabasesToolStripMenuItem";
|
||||
this.approvalDatabasesToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
|
||||
this.approvalDatabasesToolStripMenuItem.Text = "Approval Databases";
|
||||
this.approvalDatabasesToolStripMenuItem.Click += new System.EventHandler(this.approvalDatabasesToolStripMenuItem_Click);
|
||||
//
|
||||
// updateFormatsToolStripMenuItem
|
||||
//
|
||||
this.updateFormatsToolStripMenuItem.Name = "updateFormatsToolStripMenuItem";
|
||||
this.updateFormatsToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
|
||||
this.updateFormatsToolStripMenuItem.Text = "Update Formats";
|
||||
this.updateFormatsToolStripMenuItem.Click += new System.EventHandler(this.updateFormatsToolStripMenuItem_Click);
|
||||
//
|
||||
// fixROValuesToolStripMenuItem
|
||||
//
|
||||
this.fixROValuesToolStripMenuItem.Name = "fixROValuesToolStripMenuItem";
|
||||
this.fixROValuesToolStripMenuItem.Size = new System.Drawing.Size(264, 24);
|
||||
this.fixROValuesToolStripMenuItem.Text = "Fix RO Values";
|
||||
this.fixROValuesToolStripMenuItem.Click += new System.EventHandler(this.fixROValuesToolStripMenuItem_Click);
|
||||
//
|
||||
// createEmptyPROMSDatabaseToolStripMenuItem
|
||||
//
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Name = "createEmptyPROMSDatabaseToolStripMenuItem";
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Size = new System.Drawing.Size(239, 22);
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Text = "Create Empty PROMS Database";
|
||||
this.createEmptyPROMSDatabaseToolStripMenuItem.Click += new System.EventHandler(this.createEmptyPROMSDatabaseToolStripMenuItem_Click);
|
||||
//
|
||||
// frmLoader
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(664, 394);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.sc);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.Name = "frmLoader";
|
||||
this.Text = "PROMS-2010 Data Loader";
|
||||
this.Load += new System.EventHandler(this.frmLoader_Load);
|
||||
this.sc.Panel1.ResumeLayout(false);
|
||||
this.sc.Panel1.PerformLayout();
|
||||
this.sc.Panel2.ResumeLayout(false);
|
||||
this.sc.ResumeLayout(false);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer sc;
|
||||
private System.Windows.Forms.Label lblTime;
|
||||
private System.Windows.Forms.ProgressBar pbStep;
|
||||
private System.Windows.Forms.ProgressBar pbSect;
|
||||
private System.Windows.Forms.ProgressBar pbProc;
|
||||
private System.Windows.Forms.Label lblStep;
|
||||
private System.Windows.Forms.Label lblSection;
|
||||
private System.Windows.Forms.Label lblProc;
|
||||
private System.Windows.Forms.TreeView tv;
|
||||
private System.Windows.Forms.FolderBrowserDialog fbd;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel tsslError;
|
||||
private System.Windows.Forms.Label lblCurSetFolder;
|
||||
private System.Windows.Forms.Label lblProcessing;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem processToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem completeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem formatOnlyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertDBToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixTransitionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToChangeManagerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertToApprovalToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem oldToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertSecurityToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertTopFoldersToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem loadTreeFromCSLAToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem loadVETreeFromCSLAToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem groupSecurityToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem countTokensToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem convertDbfSelectedInTreeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
|
||||
private System.Windows.Forms.ToolStripMenuItem load16BitApprovalToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixAllToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem approvalDatabasesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem updateFormatsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fixROValuesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem createEmptyPROMSDatabaseToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>84, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>217, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>314, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -1,110 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
|
||||
namespace DataLoader
|
||||
{
|
||||
public partial class frmPG : Form
|
||||
{
|
||||
private object _SelectedObject;
|
||||
public object SelectedObject
|
||||
{
|
||||
get { return _SelectedObject; }
|
||||
set { _SelectedObject = value; }
|
||||
}
|
||||
|
||||
public frmPG(string title, object selectedObject)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
_SelectedObject = selectedObject;
|
||||
}
|
||||
private void CheckValidity()
|
||||
{
|
||||
if (SelectedObject.GetType().Name == "DataLoaderSettings")
|
||||
{
|
||||
DataLoaderSettings myDls = (DataLoaderSettings)SelectedObject;
|
||||
string validity = myDls.ValidityCheck;
|
||||
pg.SelectedObject = SelectedObject;
|
||||
tbError.Text = validity;
|
||||
if (validity == "")
|
||||
tbError.Visible = false;
|
||||
else
|
||||
{
|
||||
using (Graphics gr = tbError.CreateGraphics())
|
||||
{
|
||||
SizeF sf = gr.MeasureString(validity, tbError.Font,tbError.ClientRectangle.Width-10);
|
||||
tbError.Height = (int)(tbError.Font.GetHeight(gr.DpiY) + sf.Height);
|
||||
}
|
||||
tbError.Visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
tbError.Visible = false;
|
||||
btnOK.Enabled = !tbError.Visible;
|
||||
}
|
||||
private void frmPG_Load(object sender, EventArgs e)
|
||||
{
|
||||
pg.PropertyValueChanged += new PropertyValueChangedEventHandler(pg_PropertyValueChanged);
|
||||
pg.SelectedObject = SelectedObject;
|
||||
Resize += new EventHandler(frmPG_Resize);
|
||||
CheckValidity();
|
||||
MoveSplitterTo(pg, SplitterWidth);
|
||||
}
|
||||
void pg_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||
{
|
||||
if (e.ChangedItem.Label == "VEProms Exe Folder")
|
||||
{
|
||||
DataLoaderSettings dls = SelectedObject as DataLoaderSettings;
|
||||
if (dls != null)
|
||||
dls.VESamFile = dls.VEPromsPath + "\\vesam.opt";
|
||||
}
|
||||
//if (e.ChangedItem.Label == "Procedure Folder")
|
||||
//{
|
||||
// DataLoaderSettings dls = SelectedObject as DataLoaderSettings;
|
||||
// //if (dls != null)
|
||||
// // dls.PDFFolder = "";
|
||||
//}
|
||||
CheckValidity();
|
||||
}
|
||||
void frmPG_Resize(object sender, EventArgs e)
|
||||
{
|
||||
MoveSplitterTo(pg, SplitterWidth);
|
||||
}
|
||||
private int _SplitterWidth = 0;
|
||||
public int SplitterWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SplitterWidth == 0)
|
||||
{
|
||||
using (Graphics gr = this.CreateGraphics())
|
||||
_SplitterWidth = 180 * ((int)gr.DpiX) / 96;
|
||||
}
|
||||
return _SplitterWidth;
|
||||
}
|
||||
}
|
||||
static void MoveSplitterTo(PropertyGrid grid, int x)
|
||||
{
|
||||
// HEALTH WARNING: reflection can be brittle...
|
||||
FieldInfo field = typeof(PropertyGrid)
|
||||
.GetField("gridView",
|
||||
BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
field.FieldType
|
||||
.GetMethod("MoveSplitterTo",
|
||||
BindingFlags.NonPublic | BindingFlags.Instance)
|
||||
.Invoke(field.GetValue(grid), new object[] { x });
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
PropertyDescriptor pd = pg.SelectedGridItem.PropertyDescriptor;
|
||||
pd.ResetValue(pg.SelectedObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-120
@@ -1,120 +0,0 @@
|
||||
namespace DataLoader
|
||||
{
|
||||
partial class frmPG
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.pg = new System.Windows.Forms.PropertyGrid();
|
||||
this.tbError = new System.Windows.Forms.TextBox();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.btnCancel);
|
||||
this.panel1.Controls.Add(this.btnOK);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 540);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(453, 38);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(366, 6);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 1;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(285, 6);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pg
|
||||
//
|
||||
this.pg.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pg.Location = new System.Drawing.Point(0, 0);
|
||||
this.pg.Name = "pg";
|
||||
this.pg.Size = new System.Drawing.Size(453, 425);
|
||||
this.pg.TabIndex = 1;
|
||||
//
|
||||
// tbError
|
||||
//
|
||||
this.tbError.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
|
||||
this.tbError.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tbError.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.tbError.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
|
||||
this.tbError.Location = new System.Drawing.Point(0, 425);
|
||||
this.tbError.Multiline = true;
|
||||
this.tbError.Name = "tbError";
|
||||
this.tbError.Size = new System.Drawing.Size(453, 115);
|
||||
this.tbError.TabIndex = 2;
|
||||
//
|
||||
// frmPG
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(453, 578);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.pg);
|
||||
this.Controls.Add(this.tbError);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "frmPG";
|
||||
this.Text = "frmPG";
|
||||
this.Load += new System.EventHandler(this.frmPG_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.PropertyGrid pg;
|
||||
private System.Windows.Forms.TextBox tbError;
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
Computer Name: KATHY-VISTA
|
||||
Data Set: c:\16bit\debug\veaep\aop1.prc
|
||||
Bad OldToNew Document Style 001-006:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\proc013.A03
|
||||
Error in
|
||||
Bad OldToNew Document Style 002-001:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\PROC009.A03
|
||||
Bad OldToNew Document Style 012-005:Attachment C dStyleIndex = 'A '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP & AOP Single Column Attachment Pages - BOLD STEPS (AEP01) - Missing OldToNew 1024
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\proc022.A06
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\proc031.A04
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\proc031.A08
|
||||
Processing c:\16bit\debug\veaep\aop1.prc\rtffiles\proc031.A07
|
||||
Missing Transition Destination 017-001|K0 - 9464
|
||||
Missing Transition Destination 017-001|J0 - 9463
|
||||
Missing Transition Destination 001-006|A?S3 - 853
|
||||
Missing Transition Destination 017-001|F0 - 9652
|
||||
Missing Transition Destination 017-001|E0 - 9514
|
||||
Missing Transition Destination 017-001|B1S - 9584
|
||||
Missing Transition Destination 017-001|B0 - 9589
|
||||
Missing Transition Destination 016.004|J=S7 - 7979
|
||||
Missing Transition Destination 017-001|I0 - 9244
|
||||
Missing Transition Destination 016-004|AÇS - 7602
|
||||
Data Set: c:\16bit\debug\veaep\du1.prc
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\CNTRLRM1.GIF
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\CNTRLRM2.GIF
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\CNTLRM12.GIF
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\CNTLRM11.GIF
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\STMTABLE.GIF
|
||||
Cannot Find Image File c:\16bit\debug\veaep\ro\HV2.GIF
|
||||
Bad OldToNew Document Style E-0:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-0.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ES02.A05
|
||||
Bad OldToNew Document Style ES-0.2:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ES03.A03
|
||||
Bad OldToNew Document Style ES-0.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style E-1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-1.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-1.2:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-1.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style E-3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-3.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-3.2:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ES-3.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ECA00.A01
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ECA00.A04
|
||||
Bad OldToNew Document Style ECA-0.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ECA11.A03
|
||||
Bad OldToNew Document Style ECA-1.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\proc022.A03
|
||||
Bad OldToNew Document Style ECA-1.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ECA-2.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\ECA31.A03
|
||||
Bad OldToNew Document Style ECA-3.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ECA-3.2:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style ECA-3.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\proc004.A07
|
||||
MigrateRos 'F-0.5' 'A2S' 0
|
||||
ArgumentNullException - Value cannot be null.
|
||||
Parameter name: input at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)
|
||||
at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, String replacement)
|
||||
at DataLoader.TextConvert.ConvertDOSSuperAndSubScripts(String instr) in C:\Development\PROMS\DataLoader\TextConvert.cs:line 218
|
||||
at DataLoader.Loader.MigrateRos(OleDbConnection cn, String textm, String seqcvt, Content content, DocVersion docver, Boolean conv_caret) in C:\Development\PROMS\DataLoader\RefObjs.cs:line 81
|
||||
Bad OldToNew Document Style FR-C.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style FR-C.2:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style FR-C.3:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Bad OldToNew Document Style FR-H.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\FRP1.A03
|
||||
Bad OldToNew Document Style FR-P.1:FOLDOUT dStyleIndex = '0 '
|
||||
D.C. Cook EOP and AOP Format - D.C. Cook EOP - Foldout Pages (AEP00) - Missing OldToNew 1
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\FRP2.A03
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\FRI3.A03
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\FRI3.A04
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\proc009.A05
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\proc012.A02
|
||||
Processing c:\16bit\debug\veaep\du1.prc\rtffiles\proc020.A02
|
||||
Missing Transition Destination ECA-1.1|BNS36 - 15533
|
||||
Missing Transition Destination ES-3.1|BIS - 22871
|
||||
Missing Transition Destination F-0.2|D0 - 18727
|
||||
Missing Transition Destination ECA-1.3|AUS33 - 16163
|
||||
Missing Transition Destination ECA-1.3|AUS36 - 16164
|
||||
Missing Transition Destination ECA-3.3|BBS - 22594
|
||||
Missing Transition Destination F-0.5|C0 - 20949
|
||||
Missing Transition Destination ECA-1.1|BFS33 - 15441
|
||||
Missing Transition Destination ES-0.2|B;S2 - 10712
|
||||
Missing Transition Destination ECA-2.1|B9S43 - 16564
|
||||
Missing Transition Destination ES-1.3|A6SB - 12507
|
||||
Missing Transition Destination F-0.6|E0 - 21213
|
||||
Missing Transition Destination ECA-2.1|B9S46 - 16565
|
||||
Missing Transition Destination F-0.6|C0 - 21117
|
||||
Missing Transition Destination FR-C.1|BFS25 - 19037
|
||||
Missing Transition Destination FR-H.1|ABS - 20220
|
||||
Missing Transition Destination E-1|B>S32 - 11248
|
||||
Missing Transition Destination E-1|B>S34 - 11249
|
||||
Missing Transition Destination F-0.3|C0 - 19579
|
||||
Missing Transition Destination FR-C.1|BFS26 - 19048
|
||||
Missing Transition Destination ECA-3.2|B0S - 17180
|
||||
Missing Transition Destination SUP-015|C0 - 20660
|
||||
Missing Transition Destination FR-C.2|B@S36 - 19440
|
||||
Missing Transition Destination FR-C.1|B@S36 - 18954
|
||||
Missing Transition Destination F-0.4|B0 - 12823
|
||||
Missing Transition Destination ECA-1.3|ANS36 - 16076
|
||||
Missing Transition Destination ECA-0.1|A5S - 14908
|
||||
Missing Transition Destination E-3|CES - 13327
|
||||
Missing Transition Destination ECA-1.1|BFS36 - 15442
|
||||
Missing Transition Destination ECA-1.3|ANS33 - 16075
|
||||
Missing Transition Destination ECA-1.1|BNS33 - 15532
|
||||
Missing Transition Destination F-0.1|C0 - 18472
|
||||
Missing Transition Destination FR-C.1|BIS36 - 19111
|
||||
Conversion completion time: 00:10:24.74
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user