tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
using Eventech.Common;
using System;
using System.Linq;
using System.Xml;
using TProduct.Model;
 
namespace TProduct.DataFile.YwGeneralFile
{
    public class FileV1 : BaseFile
    {
 
 
        public override string CreatXmlFile(string Path, TProduct.Model.DispStautInfo infoDelegete)
        {
            XmlDocument xmlDoc = new XmlDocument();
 
            xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null));
 
            //创建根节点
            XmlNode rootNode = xmlDoc.CreateElement("Root");
 
            #region 版本信息
            //创建VersionInfo子节点
            XmlNode VersionInfoNode = xmlDoc.CreateElement("VersionInfo");
            //创建一个属性
            XmlAttribute VersionInfoNodeAttribute = xmlDoc.CreateAttribute("Description");
            VersionInfoNodeAttribute.Value = "版本信息:";
            VersionInfoNode.Attributes.Append(VersionInfoNodeAttribute);
 
            //创建VersionInfoSource子节点
            XmlNode VersionInfoSource = xmlDoc.CreateElement("Source");
            XmlAttribute VersionInfoSourceAttribute = xmlDoc.CreateAttribute("Description");
            VersionInfoSourceAttribute.Value = "来源:TProduct.DesktopV1";
            VersionInfoSource.Attributes.Append(VersionInfoSourceAttribute);
 
            //创建VersionInfoVersion子节点
            XmlNode VersionInfoVersion = xmlDoc.CreateElement("Version");
            XmlAttribute VersionInfoVersionAttribute = xmlDoc.CreateAttribute("Description");
            VersionInfoVersionAttribute.Value = "版本:V1";
            VersionInfoVersion.Attributes.Append(VersionInfoVersionAttribute);
            #endregion
 
            #region 测试项目
            //创建TestProject子节点
            XmlNode TestProjectNode = xmlDoc.CreateElement("TestProject");
            //创建一个属性
            XmlAttribute TestProjectNameAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectNameAttribute.Value = "测试项目";
            TestProjectNode.Attributes.Append(TestProjectNameAttribute);
 
            //创建TtestReportFileNO子节点
            XmlNode TtestReportFileNO = xmlDoc.CreateElement("ReportFileNO");
            XmlAttribute ReportFileNoAttribute = xmlDoc.CreateAttribute("Description");
            ReportFileNoAttribute.Value = "报告文件名";
            TtestReportFileNO.Attributes.Append(ReportFileNoAttribute);
            XmlText xmlElemTtestReportFileNO = xmlDoc.CreateTextNode(_testProject.ReportFileNO);//测试台名称
            TtestReportFileNO.AppendChild(xmlElemTtestReportFileNO);
 
            //创建TestProjectID子节点
            XmlNode TestProjectID = xmlDoc.CreateElement("ID");
            XmlAttribute TestProjectIDAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectIDAttribute.Value = "测试项目标识ID";
            TestProjectID.Attributes.Append(TestProjectIDAttribute);
            XmlText xmlElemTestProjectID = xmlDoc.CreateTextNode(_testProject.ID < 1 ? " " : _testProject.ID.ToString());//测试台ID
            TestProjectID.AppendChild(xmlElemTestProjectID);
 
            //创建TestProjectSeries子节点
            XmlNode TestProjectSeriesID = xmlDoc.CreateElement("SeriesID");
            XmlAttribute TestProjectSeriesIDAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectSeriesIDAttribute.Value = "系列ID";
            TestProjectSeriesID.Attributes.Append(TestProjectSeriesIDAttribute);
            XmlText xmlElemTestProjectSeries = xmlDoc.CreateTextNode(_testProject.SeriesID < 1 ? " " : _testProject.SeriesID.ToString());//测试台ID
            TestProjectSeriesID.AppendChild(xmlElemTestProjectSeries);
 
            //创建TestProjectProductID子节点
            XmlNode TestProjectProductID = xmlDoc.CreateElement("ProductID");
            XmlAttribute TestProjectProductIDAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectProductIDAttribute.Value = "设备型号ID";
            TestProjectProductID.Attributes.Append(TestProjectProductIDAttribute);
            XmlText xmlElemTestProjectProductID = xmlDoc.CreateTextNode(_testProject.ProductID < 1 ? " " : _testProject.ProductID.ToString());//测试台ID
            TestProjectProductID.AppendChild(xmlElemTestProjectProductID);
 
            //创建TestProjectPartID子节点
            XmlNode TestProjectPartID = xmlDoc.CreateElement("PartID");
            XmlAttribute PartIDAttribute = xmlDoc.CreateAttribute("Description");
            PartIDAttribute.Value = "产品标识ID";
            TestProjectPartID.Attributes.Append(PartIDAttribute);
            XmlText xmlElemTestProjectPartID = xmlDoc.CreateTextNode(_testProject.PartID < 1 ? " " : _testProject.PartID.ToString());//测试台ID
            TestProjectPartID.AppendChild(xmlElemTestProjectPartID);
 
            //创建TestProjectCreateUserID子节点
            XmlNode TestProjectCreateUserID = xmlDoc.CreateElement("CreateUserID");
            XmlAttribute TestProjectCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectCreateUserIDAttribute.Value = "创建人ID";
            TestProjectCreateUserID.Attributes.Append(TestProjectCreateUserIDAttribute);
            XmlText xmlElemTestProjectCreateUserID = xmlDoc.CreateTextNode(_testProject.CreateUserID < 1 ? " " : _testProject.CreateUserID.ToString());//创建名称
            TestProjectCreateUserID.AppendChild(xmlElemTestProjectCreateUserID);
 
            //创建TestProjectCreateTime子节点
            XmlNode TestProjectCreateTime = xmlDoc.CreateElement("CreateTime");
            XmlAttribute TestProjectCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
            TestProjectCreateTimeAttribute.Value = "创建时间";
            TestProjectCreateTime.Attributes.Append(TestProjectCreateTimeAttribute);
            XmlText xmlElemTestProjectCreateTime = xmlDoc.CreateTextNode(_testProject.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : _testProject.CreateTime.ToString("yyyy-MM-dd"));//创建时间
            TestProjectCreateTime.AppendChild(xmlElemTestProjectCreateTime);
 
            //创建TestProjectTestUserID子节点
            XmlNode TestProjectTestUserID = xmlDoc.CreateElement("TestUserID");
            XmlAttribute TestUserIDAttribute = xmlDoc.CreateAttribute("Description");
            TestUserIDAttribute.Value = "测试人ID";
            TestProjectTestUserID.Attributes.Append(TestUserIDAttribute);
            //XmlText xmlElemTestProjectTestUserID = xmlDoc.CreateTextNode(_testProject.TestUserID < 1 ? " " : _testProject.TestUserID.ToString());//更新人
            //TestProjectTestUserID.AppendChild(xmlElemTestProjectTestUserID);
 
            //创建TestProjectTestTime子节点
            XmlNode TestProjectTestTime = xmlDoc.CreateElement("TestTime");
            XmlAttribute TestTimeAttribute = xmlDoc.CreateAttribute("Description");
            TestTimeAttribute.Value = "测试时间";
            TestProjectTestTime.Attributes.Append(TestTimeAttribute);
            //XmlText xmlElemTestProjectTestTime = xmlDoc.CreateTextNode(_testProject.TestTime < Convert.ToDateTime("2008-1-1") ? " " : _testProject.TestTime?.ToString("yyyy-MM-dd"));//更新时间
            //TestProjectTestTime.AppendChild(xmlElemTestProjectTestTime);
 
            //创建TtestProjectCode子节点
            XmlNode TtestProjectCode = xmlDoc.CreateElement("Code");
            XmlAttribute TtestProjectCodeAttribute = xmlDoc.CreateAttribute("Description");
            TtestProjectCodeAttribute.Value = "编号";
            TtestProjectCode.Attributes.Append(TtestProjectCodeAttribute);
            XmlText xmlElemTtestProjectCode = xmlDoc.CreateTextNode(_testProject.Code?.ToString());//编号
            TtestProjectCode.AppendChild(xmlElemTtestProjectCode);
 
            //创建TtestProjectName子节点
            XmlNode TtestProjectName = xmlDoc.CreateElement("Name");
            XmlAttribute TtestProjectNameAttribute = xmlDoc.CreateAttribute("Description");
            TtestProjectNameAttribute.Value = "名称";
            TtestProjectName.Attributes.Append(TtestProjectNameAttribute);
            XmlText xmlElemTtestProjectName = xmlDoc.CreateTextNode(_testProject.Name?.ToString());//测试台名称
            TtestProjectName.AppendChild(xmlElemTtestProjectName);
 
            //创建TtestProjectRemarks子节点
            XmlNode TtestProjectRemarks = xmlDoc.CreateElement("Remarks");
            XmlAttribute RemarkAttribute = xmlDoc.CreateAttribute("Description");
            RemarkAttribute.Value = "备注";
            TtestProjectRemarks.Attributes.Append(RemarkAttribute);
            XmlText xmlElemTtestProjectRemarks = xmlDoc.CreateTextNode(_testProject.Remarks?.ToString());//测试台名称
            TtestProjectRemarks.AppendChild(xmlElemTtestProjectRemarks);
 
            //创建TtestProjectIsFixed子节点
            XmlNode TtestProjectIsFixed = xmlDoc.CreateElement("IsFixed");
            XmlAttribute IsFixedAttribute = xmlDoc.CreateAttribute("Description");
            IsFixedAttribute.Value = "是否固定";
            TtestProjectIsFixed.Attributes.Append(IsFixedAttribute);
            XmlText xmlElemTtestProjectIsFixed = xmlDoc.CreateTextNode(_testProject.IsFixed == true ? "已固定" : "未固定");//测试台名称
            TtestProjectIsFixed.AppendChild(xmlElemTtestProjectIsFixed);
 
            //创建TtestProjectUseStatus子节点
            XmlNode TtestProjectUseStatus = xmlDoc.CreateElement("UseStatus");
            XmlAttribute TtestProjectUseStatusAttribute = xmlDoc.CreateAttribute("Description");
            TtestProjectUseStatusAttribute.Value = "使用状态";
            TtestProjectUseStatus.Attributes.Append(TtestProjectUseStatusAttribute);
            XmlText xmlElemTtestUseStatus = xmlDoc.CreateTextNode(_testProject.UseStatus.GetDisplayText());//测试台名称
            TtestProjectUseStatus.AppendChild(xmlElemTtestUseStatus);
 
            //创建TtestJudgeResult子节点
            XmlNode TtestJudgeResult = xmlDoc.CreateElement("JudgeResult");
            XmlAttribute JudgeResultAttribute = xmlDoc.CreateAttribute("Description");
            JudgeResultAttribute.Value = "测试结果";
            TtestJudgeResult.Attributes.Append(JudgeResultAttribute);
            XmlText xmlElemTtestJudgeResult = xmlDoc.CreateTextNode(_testProject.JudgeResult.GetDisplayText());//测试台名称
            TtestJudgeResult.AppendChild(xmlElemTtestJudgeResult);
            #endregion
 
            #region 测试台
            //创建WorkBench子节点
            XmlNode WorkBenchNode = xmlDoc.CreateElement("WorkBench");
            //创建一个属性
            XmlAttribute WorkBenchAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchAttribute.Value = "测试台信息";
            //xml节点附件属性
            WorkBenchNode.Attributes.Append(WorkBenchAttribute);
 
            //创建WorkBenchID子节点
            XmlNode WorkBenchID = xmlDoc.CreateElement("ID");
            XmlAttribute WorkBenchIDAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchIDAttribute.Value = "测试台标识ID";
            WorkBenchID.Attributes.Append(WorkBenchIDAttribute);
            XmlText xmlElemWorkBenchID = xmlDoc.CreateTextNode(_workBench.ID < 1 ? " " : _workBench.ID.ToString());//测试台ID
            WorkBenchID.AppendChild(xmlElemWorkBenchID);
 
            //创建WorkBenchCreateUserID子节点
            XmlNode WorkBenchCreateUserID = xmlDoc.CreateElement("CreateUserID");
            XmlAttribute WorkBenchCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchCreateUserIDAttribute.Value = "创建人ID";
            WorkBenchCreateUserID.Attributes.Append(WorkBenchCreateUserIDAttribute);
            XmlText xmlElemWorkBenchCreateUserID = xmlDoc.CreateTextNode(_workBench.CreateUserID < 1 ? " " : _workBench.CreateUserID.ToString());//创建名称
            WorkBenchCreateUserID.AppendChild(xmlElemWorkBenchCreateUserID);
 
            //创建WorkBenchCreateTime子节点
            XmlNode WorkBenchCreateTime = xmlDoc.CreateElement("CreateTime");
            XmlAttribute WorkBenchCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchCreateTimeAttribute.Value = "创建时间";
            WorkBenchCreateTime.Attributes.Append(WorkBenchCreateTimeAttribute);
            XmlText xmlElemWorkBenchCreateTime = xmlDoc.CreateTextNode(_workBench.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : _workBench.CreateTime.ToString("yyyy-MM-dd"));//创建时间
            WorkBenchCreateTime.AppendChild(xmlElemWorkBenchCreateTime);
 
            //创建WorkBenchUpdateUserID子节点
            XmlNode WorkBenchUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
            XmlAttribute WorkBenchUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchUpdateUserIDAttribute.Value = "更新人ID";
            WorkBenchUpdateUserID.Attributes.Append(WorkBenchUpdateUserIDAttribute);
            XmlText xmlElemWorkBenchUpdateUserID = xmlDoc.CreateTextNode(_workBench.UpdateUserID < 1 ? " " : _workBench.UpdateUserID.ToString());//更新人
            WorkBenchUpdateUserID.AppendChild(xmlElemWorkBenchUpdateUserID);
 
            //创建WorkBenchCreateTime子节点
            XmlNode WorkBenchUpdateTime = xmlDoc.CreateElement("UpdateTime");
            XmlAttribute WorkBenchUpdateTimeAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchUpdateTimeAttribute.Value = "更新时间";
            WorkBenchUpdateUserID.Attributes.Append(WorkBenchUpdateTimeAttribute);
            XmlText xmlElemWorkBenchUpdateTime = xmlDoc.CreateTextNode(_workBench.UpdateTime < Convert.ToDateTime("2008-1-1") ? " " : _workBench.UpdateTime.ToString("yyyy-MM-dd"));//更新时间
            WorkBenchUpdateTime.AppendChild(xmlElemWorkBenchUpdateTime);
 
            //创建WorkBenchCode子节点
            XmlNode WorkBenchCode = xmlDoc.CreateElement("Code");
            XmlAttribute WorkBenchCodeAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchCodeAttribute.Value = "编号";
            WorkBenchCode.Attributes.Append(WorkBenchCodeAttribute);
            XmlText xmlElemWorkBenchCode = xmlDoc.CreateTextNode(_workBench.Code.Length < 1 ? " " : _workBench.Code.ToString());//编号
            WorkBenchCode.AppendChild(xmlElemWorkBenchCode);
 
            //创建WorkBenchName子节点
            XmlNode WorkBenchName = xmlDoc.CreateElement("Name");
            XmlAttribute WorkBenchNameAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchNameAttribute.Value = "名称";
            WorkBenchName.Attributes.Append(WorkBenchNameAttribute);
            XmlText xmlElemWorkBenchName = xmlDoc.CreateTextNode(_workBench.Name.Length < 1 ? " " : _workBench.Name.ToString());//测试台名称
            WorkBenchName.AppendChild(xmlElemWorkBenchName);
 
            //创建WorkBenchProductStyleID子节点
            XmlNode WorkBenchProductStyleID = xmlDoc.CreateElement("ProductStyleID");
            XmlAttribute ProductStyleIDAttribute = xmlDoc.CreateAttribute("Description");
            ProductStyleIDAttribute.Value = "设备分类ID";
            WorkBenchProductStyleID.Attributes.Append(ProductStyleIDAttribute);
            XmlText xmlElemWorkBenchProductStyleID = xmlDoc.CreateTextNode(_workBench.ProductStyleID.Count() < 1 ? " " : _workBench.ProductStyleID.ToString());//测试台名称
            WorkBenchProductStyleID.AppendChild(xmlElemWorkBenchProductStyleID);
 
            //创建WorkBenchLastUseUserID子节点
            XmlNode WorkBenchLastUseUserID = xmlDoc.CreateElement("LastUseUserID");
            XmlAttribute LastUseUserIDAttribute = xmlDoc.CreateAttribute("Description");
            LastUseUserIDAttribute.Value = "最后使用人ID";
            WorkBenchLastUseUserID.Attributes.Append(LastUseUserIDAttribute);
            XmlText xmlElemWorkBenchLastUseUserID = xmlDoc.CreateTextNode(_workBench.LastUseUserID < 1 ? "" : _workBench.LastUseUserID?.ToString());//测试台名称
            WorkBenchLastUseUserID.AppendChild(xmlElemWorkBenchLastUseUserID);
 
            //创建WorkBenchLastUseTime子节点
            XmlNode WorkBenchLastUseTime = xmlDoc.CreateElement("LastUseTime");
            XmlAttribute LastUseTimeAttribute = xmlDoc.CreateAttribute("Description");
            LastUseTimeAttribute.Value = "最后使用时间";
            WorkBenchLastUseTime.Attributes.Append(LastUseTimeAttribute);
            XmlText xmlElemWorkBenchLastUseTime = xmlDoc.CreateTextNode(_workBench.LastUseTime < Convert.ToDateTime("2008-1-1") ? "" : _workBench.LastUseTime?.ToString());//测试台名称
            WorkBenchLastUseTime.AppendChild(xmlElemWorkBenchLastUseTime);
 
            //创建WorkBenchUseStatus子节点
            XmlNode WorkBenchUseStatus = xmlDoc.CreateElement("UseStatus");
            XmlAttribute WorkBenchUseStatusAttribute = xmlDoc.CreateAttribute("Description");
            WorkBenchUseStatusAttribute.Value = "使用状态";
            WorkBenchUseStatus.Attributes.Append(WorkBenchUseStatusAttribute);
            XmlText xmlElemWorkBenchUseStatus = xmlDoc.CreateTextNode(_workBench.UseStatus == 0 ? "无效" : "有效");//测试台名称
            WorkBenchUseStatus.AppendChild(xmlElemWorkBenchUseStatus);
 
            //创建WorkBenchPipeParas子节点W
            XmlNode WorkBenchPipeParas = xmlDoc.CreateElement("PipeParas");
            XmlAttribute PipeParasAttribute = xmlDoc.CreateAttribute("Description");
            PipeParasAttribute.Value = "管路参数";
            WorkBenchPipeParas.Attributes.Append(PipeParasAttribute);
            XmlText xmlElemWorkBenchPipeParas = xmlDoc.CreateTextNode(_workBench.PipeParas.Length < 1 ? " " : _workBench.PipeParas.ToString());//测试台名称
            WorkBenchPipeParas.AppendChild(xmlElemWorkBenchPipeParas);
 
            //创建WorkBenchProductType子节点
            XmlNode WorkBenchProductType = xmlDoc.CreateElement("ProductType");
            XmlAttribute ProductTypeAttribute = xmlDoc.CreateAttribute("Description");
            ProductTypeAttribute.Value = "分类";
            WorkBenchProductType.Attributes.Append(ProductTypeAttribute);
            XmlText xmlElemWorkBenchProductType = xmlDoc.CreateTextNode(_workBench.ProductType.GetDisplayText());//测试台名称
            WorkBenchProductType.AppendChild(xmlElemWorkBenchProductType);
 
            #endregion
 
            #region 产品
            //创建Part子节点
            XmlNode PartNode = xmlDoc.CreateElement("PartBase");
            //创建一个属性
            XmlAttribute PartAttribute = xmlDoc.CreateAttribute("Description");
            PartAttribute.Value = "产品信息";
            //xml节点附件属性
            PartNode.Attributes.Append(PartAttribute);
 
            //创建PartID子节点
            XmlNode PartID = xmlDoc.CreateElement("ID");
            XmlAttribute PartIDttribute = xmlDoc.CreateAttribute("Description");
            PartIDttribute.Value = "产品标识ID";
            PartID.Attributes.Append(PartIDttribute);
            XmlText xmlElemPartID = xmlDoc.CreateTextNode(_currentPart.ID < 1 ? " " : _currentPart.ID.ToString());//产品ID
            PartID.AppendChild(xmlElemPartID);
 
            //创建PartCreateUserID子节点
            XmlNode PartCreateUserID = xmlDoc.CreateElement("CreateUserID");
            XmlAttribute PartCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            PartCreateUserIDAttribute.Value = "创建人ID";
            PartCreateUserID.Attributes.Append(PartCreateUserIDAttribute);
            XmlText xmlElemPartCreateUserID = xmlDoc.CreateTextNode(_currentPart.CreateUserID < 1 ? " " : _currentPart.CreateUserID.ToString());//创建名称
            PartCreateUserID.AppendChild(xmlElemPartCreateUserID);
 
            //创建PartCreateTime子节点
            XmlNode PartCreateTime = xmlDoc.CreateElement("CreateTime");
            XmlAttribute PartCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
            PartCreateTimeAttribute.Value = "创建时间";
            PartCreateTime.Attributes.Append(PartCreateTimeAttribute);
            XmlText xmlElemPartCreateTime = xmlDoc.CreateTextNode(_currentPart.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentPart.CreateTime.ToString("yyyy-MM-dd"));//创建时间
            PartCreateTime.AppendChild(xmlElemPartCreateTime);
 
            //创建PartUpdateUserID子节点
            XmlNode PartUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
            XmlAttribute PartUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            PartUpdateUserIDAttribute.Value = "更新人ID";
            PartUpdateUserID.Attributes.Append(PartUpdateUserIDAttribute);
            XmlText xmlElemPartUpdateUserID = xmlDoc.CreateTextNode(_currentPart.UpdateUserID < 1 ? " " : _currentPart.UpdateUserID.ToString());//更新人
            PartUpdateUserID.AppendChild(xmlElemPartUpdateUserID);
 
            //创建PartCreateTime子节点
            XmlNode PartUpdateTime = xmlDoc.CreateElement("UpdateTime");
            XmlAttribute PartUpdateTimeAttribute = xmlDoc.CreateAttribute("Description");
            PartUpdateTimeAttribute.Value = "更新时间";
            PartUpdateTime.Attributes.Append(PartUpdateTimeAttribute);
            XmlText xmlElemPartUpdateTime = xmlDoc.CreateTextNode(_currentPart.UpdateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentPart.UpdateTime.ToString("yyyy-MM-dd"));//更新时间
            PartUpdateTime.AppendChild(xmlElemPartUpdateTime);
 
            //创建PartCode子节点
            XmlNode PartCode = xmlDoc.CreateElement("Code");
            XmlAttribute PartCodeAttribute = xmlDoc.CreateAttribute("Description");
            PartCodeAttribute.Value = "编号";
            PartCode.Attributes.Append(PartCodeAttribute);
            XmlText xmlElemPartCode = xmlDoc.CreateTextNode(_currentPart.Code.Length < 1 ? " " : _currentPart.Code.ToString());//编号
            PartCode.AppendChild(xmlElemPartCode);
 
            //创建PartName子节点
            XmlNode PartName = xmlDoc.CreateElement("Name");
            XmlAttribute PartNameAttribute = xmlDoc.CreateAttribute("Description");
            PartNameAttribute.Value = "名称";
            PartName.Attributes.Append(PartNameAttribute);
            XmlText xmlElemPartName = xmlDoc.CreateTextNode(_currentPart.Name.Length < 1 ? " " : _currentPart.Name.ToString());//产品名称
            PartName.AppendChild(xmlElemPartName);
 
            //创建LastTestUserID子节点
            XmlNode PartLastTestUserID = xmlDoc.CreateElement("LastTestUserID");
            XmlAttribute LastTestUserIDAttribute = xmlDoc.CreateAttribute("Description");
            LastTestUserIDAttribute.Value = "最后测试人ID";
            PartLastTestUserID.Attributes.Append(LastTestUserIDAttribute);
            XmlText xmlElemPartLastTestUserID = xmlDoc.CreateTextNode(_currentPart.LastTestUserID < 1 ? " " : _currentPart.LastTestUserID.ToString());//最后测试人
            PartLastTestUserID.AppendChild(xmlElemPartLastTestUserID);
 
            //创建LastTestTime子节点
            XmlNode PartLastTestTime = xmlDoc.CreateElement("LastTestTime");
            XmlAttribute LastTestTimeAttribute = xmlDoc.CreateAttribute("Description");
            LastTestTimeAttribute.Value = "最后测试时间";
            PartLastTestTime.Attributes.Append(LastTestTimeAttribute);
            XmlText xmlElemPartLastTestTime = xmlDoc.CreateTextNode(_currentPart.LastTestTime < Convert.ToDateTime("2008-1-1") ? " " : _currentPart.LastTestTime.Value.ToString("yyyy-MM-dd"));//最后测试时间
            PartLastTestTime.AppendChild(xmlElemPartLastTestTime);
 
            //创建ProductMainID子节点
            XmlNode PartProductMainID = xmlDoc.CreateElement("ProductMainID");
            XmlAttribute PartProductMainIDAttribute = xmlDoc.CreateAttribute("Description");
            PartProductMainIDAttribute.Value = "设备型号ID";
            PartProductMainID.Attributes.Append(PartProductMainIDAttribute);
            XmlText xmlElemPartProductMainID = xmlDoc.CreateTextNode(_currentPart.ProductMainID < 1 ? " " : _currentPart.ProductMainID.ToString());//产品型号
            PartProductMainID.AppendChild(xmlElemPartProductMainID);
 
            //创建ProductMainID子节点
            XmlNode PartSenderID = xmlDoc.CreateElement("SenderID");
            XmlAttribute SenderIDAttribute = xmlDoc.CreateAttribute("Description");
            SenderIDAttribute.Value = "送检方";
            PartSenderID.Attributes.Append(SenderIDAttribute);
            XmlText xmlElemPartSenderID = xmlDoc.CreateTextNode(_currentPart.SenderID < 1 ? " " : _currentPart.SenderID.ToString());//送检方ID
            PartSenderID.AppendChild(xmlElemPartSenderID);
 
            //创建SendTime子节点
            XmlNode PartSendTime = xmlDoc.CreateElement("SendTime");
            XmlAttribute SenderTimeAttribute = xmlDoc.CreateAttribute("Description");
            SenderTimeAttribute.Value = "送检时间";
            PartSendTime.Attributes.Append(SenderTimeAttribute);
            XmlText xmlElemPartSendTime = xmlDoc.CreateTextNode(_currentPart.SendTime == " " || _currentPart.SendTime == null ? " " : _currentPart.SendTime.ToString());//送检人
            PartSendTime.AppendChild(xmlElemPartSendTime);
 
            //创建ManufacturerID子节点
            XmlNode PartManufacturerID = xmlDoc.CreateElement("ManufacturerID");
            XmlAttribute ManufacturerAttribute = xmlDoc.CreateAttribute("Description");
            ManufacturerAttribute.Value = "生产商";
            PartManufacturerID.Attributes.Append(ManufacturerAttribute);
            XmlText xmlElemPartManufacturerID = xmlDoc.CreateTextNode(_currentPart.ManufacturerID < 1 ? " " : _currentPart.ManufacturerID.ToString());//生产商ID
            PartManufacturerID.AppendChild(xmlElemPartManufacturerID);
 
            //创建ManufactureTime子节点
            XmlNode PartManufactureTime = xmlDoc.CreateElement("ManufactureTime");
            XmlAttribute ManufactureTimeAttribute = xmlDoc.CreateAttribute("Description");
            ManufactureTimeAttribute.Value = "生产时间";
            PartManufactureTime.Attributes.Append(ManufactureTimeAttribute);
            XmlText xmlElemPartManufactureTime = xmlDoc.CreateTextNode(_currentPart.ManufactureTime == " " || _currentPart.ManufactureTime == null ? " " : _currentPart.ManufactureTime.ToString());//生产时间
            PartManufactureTime.AppendChild(xmlElemPartManufactureTime);
 
            //创建Note子节点
            XmlNode PartNote = xmlDoc.CreateElement("Note");
            XmlAttribute NoteAttribute = xmlDoc.CreateAttribute("Description");
            NoteAttribute.Value = "备注";
            PartNote.Attributes.Append(NoteAttribute);
            XmlText xmlElemPartNote = xmlDoc.CreateTextNode(_currentPart.Note == " " || _currentPart.Note == null ? " " : _currentPart.Note.ToString());//备注
            PartNote.AppendChild(xmlElemPartNote);
 
 
            #endregion
 
            #region 泵信息
 
            //创建Pump子节点
            XmlNode PumpNode = xmlDoc.CreateElement("Pump");
            //创建一个属性
            XmlAttribute PumpAttribute = xmlDoc.CreateAttribute("Description");
            PumpAttribute.Value = "设备信息";
            //xml节点附件属性
            PumpNode.Attributes.Append(PumpAttribute);
 
            //创建PumpID子节点
            XmlNode PumpID = xmlDoc.CreateElement("ID");
            XmlAttribute PumpIDAttribute = xmlDoc.CreateAttribute("Description");
            PumpIDAttribute.Value = "设备标识ID";
            PumpID.Attributes.Append(PumpIDAttribute);
            XmlText xmlElemPumpID = xmlDoc.CreateTextNode(_currentPump.ID < 1 ? " " : _currentPump.ID.ToString());//泵ID
            PumpID.AppendChild(xmlElemPumpID);
 
            //创建PumpCreateUserID子节点
            XmlNode PumpCreateUserID = xmlDoc.CreateElement("CreateUserID");
            XmlAttribute PumpCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            PumpCreateUserIDAttribute.Value = "创建人ID";
            PumpCreateUserID.Attributes.Append(PumpCreateUserIDAttribute);
            XmlText xmlElemPumpCreateUserID = xmlDoc.CreateTextNode(_currentPump.CreateUserID < 1 ? " " : _currentPump.CreateUserID.ToString());//创建名称
            PumpCreateUserID.AppendChild(xmlElemPumpCreateUserID);
 
            //创建PumpCreateTime子节点
            XmlNode PumpCreateTime = xmlDoc.CreateElement("CreateTime");
            XmlAttribute PumpCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
            PumpCreateTimeAttribute.Value = "创建时间";
            PumpCreateTime.Attributes.Append(PumpCreateTimeAttribute);
            XmlText xmlElemPumpCreateTime = xmlDoc.CreateTextNode(_currentPump.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentPump.CreateTime.ToString("yyyy-MM-dd"));//创建时间
            PumpCreateTime.AppendChild(xmlElemPumpCreateTime);
 
            //创建PumpUpdateUserID子节点
            XmlNode PumpUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
            XmlAttribute PumpUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
            PumpUpdateUserIDAttribute.Value = "更新人ID";
            PumpUpdateUserID.Attributes.Append(PumpUpdateUserIDAttribute);
            XmlText xmlElemPumpUpdateUserID = xmlDoc.CreateTextNode(_currentPump.UpdateUserID < 1 ? " " : _currentPump.UpdateUserID.ToString());//更新人
            PumpUpdateUserID.AppendChild(xmlElemPumpUpdateUserID);
 
            //创建PumpUpdateTime子节点
            XmlNode PumpUpdateTime = xmlDoc.CreateElement("UpdateTime");
            XmlAttribute PumpUpdateTimeAttribute = xmlDoc.CreateAttribute("Description");
            PumpUpdateTimeAttribute.Value = "更新时间";
            PumpUpdateTime.Attributes.Append(PumpUpdateTimeAttribute);
            XmlText xmlElemPumpUpdateTime = xmlDoc.CreateTextNode(_currentPump.UpdateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentPump.UpdateTime.ToString("yyyy-MM-dd"));//更新时间
            PumpUpdateTime.AppendChild(xmlElemPumpUpdateTime);
 
            //创建PumpCode子节点
            XmlNode PumpCode = xmlDoc.CreateElement("Code");
            XmlAttribute PumpCodeAttribute = xmlDoc.CreateAttribute("Description");
            PumpCodeAttribute.Value = "编号";
            PumpCode.Attributes.Append(PumpCodeAttribute);
            XmlText xmlElemPumpCode = xmlDoc.CreateTextNode(_currentPump.Code.Length < 1 ? " " : _currentPump.Code.ToString());//编号
            PumpCode.AppendChild(xmlElemPumpCode);
 
            //创建PumpName子节点
            XmlNode PumpName = xmlDoc.CreateElement("Name");
            XmlAttribute PumpNameAttribute = xmlDoc.CreateAttribute("Description");
            PumpNameAttribute.Value = "名称";
            PumpName.Attributes.Append(PumpNameAttribute);
            XmlText xmlElemPumpName = xmlDoc.CreateTextNode(_currentPump.Name.Length < 1 ? " " : _currentPump.Name);//泵型号
            PumpName.AppendChild(xmlElemPumpName);
 
            //创建PumpSeriesID子节点
            XmlNode PumpSeriesID = xmlDoc.CreateElement("SeriesID");
            XmlAttribute PumpSeriesIDAttribute = xmlDoc.CreateAttribute("Description");
            PumpSeriesIDAttribute.Value = "系列标识ID";
            PumpSeriesID.Attributes.Append(PumpSeriesIDAttribute);
            XmlText xmlElemPumpSeriesID = xmlDoc.CreateTextNode(_currentPump.SeriesID < 1 ? " " : _currentPump.SeriesID.ToString());//系列ID
            PumpSeriesID.AppendChild(xmlElemPumpSeriesID);
 
 
 
            //创建PumpRatedn子节点
            XmlNode PumpRatedn = xmlDoc.CreateElement("Ratedn");
            XmlAttribute RatednAttribute = xmlDoc.CreateAttribute("Description");
            RatednAttribute.Value = "转速";
            PumpRatedn.Attributes.Append(RatednAttribute);
            XmlText xmlElemPumpRatedn = xmlDoc.CreateTextNode(_currentPump.Ratedn?.ToString());//转速
            PumpRatedn.AppendChild(xmlElemPumpRatedn);
 
            #region 额定参数
            //创建PumpD2子节点
            XmlNode PumpD2 = xmlDoc.CreateElement("D2");
            XmlAttribute D2Attribute = xmlDoc.CreateAttribute("Description");
            D2Attribute.Value = "叶轮外径";
            PumpD2.Attributes.Append(D2Attribute);
            XmlText xmlElemPumpD2 = xmlDoc.CreateTextNode(_currentPump.D2 < 0 ? "" : _currentPump.D2?.ToString());//叶轮外径
            PumpD2.AppendChild(xmlElemPumpD2);
 
            //创建PumpPosiAngle子节点
            XmlNode PumpPosiAngle = xmlDoc.CreateElement("PosiAngle");
            XmlAttribute PosiAngleAttribute = xmlDoc.CreateAttribute("Description");
            PosiAngleAttribute.Value = "安放角";
            PumpPosiAngle.Attributes.Append(PosiAngleAttribute);
            XmlText xmlElemPumpPosiAngle = xmlDoc.CreateTextNode(_currentPump.PosiAngle < 0 ? " " : _currentPump.PosiAngle?.ToString());//安放角
            PumpPosiAngle.AppendChild(xmlElemPumpPosiAngle);
 
            //创建PumpRatedParas子节点
            XmlElement PumpRatedParas = xmlDoc.CreateElement("RatedParas");
            XmlAttribute RatedParasAttribute = xmlDoc.CreateAttribute("Description");
            RatedParasAttribute.Value = "额定参数";
            PumpRatedParas.Attributes.Append(RatedParasAttribute);
            PumpRatedParas.SetAttribute("Description", "设备额定参数");
 
 
            //创建PumpQ子节点
            XmlNode PumpQ = xmlDoc.CreateElement("Q");
            XmlAttribute QAttribute = xmlDoc.CreateAttribute("Description");
            QAttribute.Value = "流量";
            PumpQ.Attributes.Append(QAttribute);
            XmlText xmlElemPumpQ = xmlDoc.CreateTextNode(_ratedParas.Q < 0 ? " " : _ratedParas.Q.ToString());//安放角
            PumpQ.AppendChild(xmlElemPumpQ);
 
            //创建PumpH子节点
            XmlNode PumpH = xmlDoc.CreateElement("H");
            XmlAttribute HAttribute = xmlDoc.CreateAttribute("Description");
            HAttribute.Value = "扬程";
            PumpH.Attributes.Append(HAttribute);
            XmlText xmlElemPumpH = xmlDoc.CreateTextNode(_ratedParas.H < 0 ? " " : _ratedParas.H.ToString());//安放角
            PumpH.AppendChild(xmlElemPumpH);
 
            //创建PumpP子节点
            XmlNode PumpP = xmlDoc.CreateElement("P");
            XmlAttribute PAttribute = xmlDoc.CreateAttribute("Description");
            PAttribute.Value = "功率";
            PumpP.Attributes.Append(PAttribute);
            XmlText xmlElemPumpP = xmlDoc.CreateTextNode(_ratedParas.P < 0 ? " " : _ratedParas.P.ToString());//安放角
            PumpP.AppendChild(xmlElemPumpP);
 
            //创建PumpE子节点
            XmlNode PumpE = xmlDoc.CreateElement("E");
            XmlAttribute EAttribute = xmlDoc.CreateAttribute("Description");
            EAttribute.Value = "效率";
            PumpE.Attributes.Append(EAttribute);
            XmlText xmlElemPumpE = xmlDoc.CreateTextNode(_ratedParas.E < 0 ? " " : _ratedParas.E.ToString());//安放角
            PumpE.AppendChild(xmlElemPumpE);
 
            //创建PumpNPSHr子节点
            XmlNode PumpNPSHr = xmlDoc.CreateElement("NPSHr");
            XmlAttribute NPSHrAttribute = xmlDoc.CreateAttribute("Description");
            NPSHrAttribute.Value = "汽蚀";
            PumpNPSHr.Attributes.Append(NPSHrAttribute);
            XmlText xmlElemPumpNPSHr = xmlDoc.CreateTextNode(_ratedParas.NPSHr < 0 || _ratedParas.NPSHr == null ? " " : _ratedParas.NPSHr.ToString());//安放角
            PumpNPSHr.AppendChild(xmlElemPumpNPSHr);
 
            //创建PumpIsFrequency子节点
            XmlNode PumpIsFrequency = xmlDoc.CreateElement("IsFrequency");
            XmlAttribute IsFrequencyAttribute = xmlDoc.CreateAttribute("Description");
            IsFrequencyAttribute.Value = "是否为变频泵";
            PumpIsFrequency.Attributes.Append(IsFrequencyAttribute);
            XmlText xmlElemPumpIsFrequency = xmlDoc.CreateTextNode(_ratedParas.IsFrequency == true ? "变频泵" : "非变频泵");//安放角
            PumpIsFrequency.AppendChild(xmlElemPumpIsFrequency);
 
            //创建PumpIsSxp子节点
            XmlNode PumpIsSxp = xmlDoc.CreateElement("IsSxp");
            XmlAttribute IsSxpAttribute = xmlDoc.CreateAttribute("Description");
            IsSxpAttribute.Value = "是否为双吸泵";
            PumpIsSxp.Attributes.Append(IsSxpAttribute);
            XmlText xmlElemPumpIsSxp = xmlDoc.CreateTextNode(_ratedParas.IsSxp == true ? "双吸泵" : "非双吸泵");//安放角
            PumpIsSxp.AppendChild(xmlElemPumpIsSxp);
 
            //创建PumpStageNumber子节点
            XmlNode PumpStageNumber = xmlDoc.CreateElement("StageNumber");
            XmlAttribute StageNumberAttribute = xmlDoc.CreateAttribute("Description");
            StageNumberAttribute.Value = "级数";
            PumpStageNumber.Attributes.Append(StageNumberAttribute);
            XmlText xmlElemPumpStageNumber = xmlDoc.CreateTextNode(_ratedParas.StageNumber < 0 ? " " : _ratedParas.StageNumber.ToString());//安放角
            PumpStageNumber.AppendChild(xmlElemPumpStageNumber);
 
            //创建PumpOutletCaliber子节点
            XmlNode PumpOutletCaliber = xmlDoc.CreateElement("OutletCaliber");
            XmlAttribute OutletCaliberAttribute = xmlDoc.CreateAttribute("Description");
            OutletCaliberAttribute.Value = "出口口径";
            PumpOutletCaliber.Attributes.Append(OutletCaliberAttribute);
            XmlText xmlElemPumpOutletCaliber = xmlDoc.CreateTextNode(_ratedParas.OutletDia < 0 || _ratedParas.OutletDia == null ? " " : _ratedParas.OutletDia.ToString());//安放角
            PumpOutletCaliber.AppendChild(xmlElemPumpOutletCaliber);
 
            //创建PumpInletCaliber子节点
            XmlNode PumpInletCaliber = xmlDoc.CreateElement("InletCaliber");
            XmlAttribute InletCaliberAttribute = xmlDoc.CreateAttribute("Description");
            InletCaliberAttribute.Value = "进口口径";
            PumpInletCaliber.Attributes.Append(InletCaliberAttribute);
            XmlText xmlElemPumpInletCaliber = xmlDoc.CreateTextNode(_ratedParas.InletDia < 0 || _ratedParas.InletDia == null ? " " : _ratedParas.InletDia.ToString());//安放角
            PumpInletCaliber.AppendChild(xmlElemPumpInletCaliber);
 
            //创建PumpGaoCha子节点
            XmlNode PumpGaoCha = xmlDoc.CreateElement("GaoCha");
            XmlAttribute GaoChaAttribute = xmlDoc.CreateAttribute("Description");
            GaoChaAttribute.Value = "高差";
            PumpGaoCha.Attributes.Append(GaoChaAttribute);
            XmlText xmlElemPumpGaoCha = xmlDoc.CreateTextNode(_ratedParas.NpshGaoChaZd < 0 || _ratedParas.NpshGaoChaZd < 0 ? " " : _ratedParas.NpshGaoChaZd.ToString());//安放角
            PumpGaoCha.AppendChild(xmlElemPumpGaoCha);
 
 
            #endregion
 
            //创建PumpMotorMainID子节点
            XmlNode PumpMotorMain = xmlDoc.CreateElement("MotorInfo");
            XmlAttribute MotorMainAttribute = xmlDoc.CreateAttribute("Description");
            MotorMainAttribute.Value = "电机信息";
            PumpMotorMain.Attributes.Append(MotorMainAttribute);
 
            #region 电机
            if (_currentPump?.MotorMainID > 0)
            {
 
                //创建MotorID子节点
                XmlNode MotorID = xmlDoc.CreateElement("MotorID");
                XmlAttribute MotorIDAttribute = xmlDoc.CreateAttribute("Description");
                MotorIDAttribute.Value = "电机标识ID";
                MotorID.Attributes.Append(MotorIDAttribute);
                XmlText xmlElemMotorID = xmlDoc.CreateTextNode(_currentMotor.ID < 0 ? "" : _currentMotor.ID.ToString());//叶轮外径
                MotorID.AppendChild(xmlElemMotorID);
 
 
                //创建MotorCreateUserID子节点
                XmlNode MotorCreateUserID = xmlDoc.CreateElement("CreateUserID");
                XmlAttribute MotorCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                MotorCreateUserIDAttribute.Value = "创建人ID";
                MotorCreateUserID.Attributes.Append(PumpCreateUserIDAttribute);
                XmlText xmlElemMotorCreateUserID = xmlDoc.CreateTextNode(_currentMotor.CreateUserID < 1 ? " " : _currentMotor.CreateUserID.ToString());//创建名称
                MotorCreateUserID.AppendChild(xmlElemMotorCreateUserID);
 
                //创建MotorCreateTime子节点
                XmlNode MotorCreateTime = xmlDoc.CreateElement("CreateTime");
                XmlAttribute MotorCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
                MotorCreateTimeAttribute.Value = "创建时间";
                MotorCreateTime.Attributes.Append(MotorCreateTimeAttribute);
                XmlText xmlElemMotorCreateTime = xmlDoc.CreateTextNode(_currentMotor.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentMotor.CreateTime.ToString("yyyy-MM-dd"));//创建时间
                MotorCreateTime.AppendChild(xmlElemMotorCreateTime);
 
                //创建MotorUpdateUserID子节点
                XmlNode MotorUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
                XmlAttribute MotorUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                MotorUpdateUserIDAttribute.Value = "更新人ID";
                MotorUpdateUserID.Attributes.Append(MotorUpdateUserIDAttribute);
                XmlText xmlElemMotorUpdateUserID = xmlDoc.CreateTextNode(_currentMotor.UpdateUserID < 1 ? " " : _currentMotor.UpdateUserID.ToString());//更新人
                MotorUpdateUserID.AppendChild(xmlElemMotorUpdateUserID);
 
                //创建MotorUpdateTime子节点
                XmlNode MotorUpdateTime = xmlDoc.CreateElement("UpdateTime");
                XmlAttribute MotorUpdateTimeAttribute = xmlDoc.CreateAttribute("Description");
                MotorUpdateTimeAttribute.Value = "更新时间";
                MotorUpdateTime.Attributes.Append(PumpUpdateTimeAttribute);
                XmlText xmlElemMotorUpdateTime = xmlDoc.CreateTextNode(_currentMotor.UpdateTime < Convert.ToDateTime("2008-1-1") ? " " : _currentMotor.UpdateTime.ToString("yyyy-MM-dd"));//更新时间
                MotorUpdateTime.AppendChild(xmlElemMotorUpdateTime);
 
                //创建MotorCode子节点
                XmlNode MotorCode = xmlDoc.CreateElement("Code");
                XmlAttribute MotorCodeAttribute = xmlDoc.CreateAttribute("Description");
                MotorCodeAttribute.Value = "编号";
                MotorCode.Attributes.Append(MotorCodeAttribute);
                XmlText xmlElemMotorCode = xmlDoc.CreateTextNode(_currentMotor.Code.Length < 1 ? " " : _currentMotor.Code.ToString());//编号
                MotorCode.AppendChild(xmlElemMotorCode);
 
                //创建MotorName子节点
                XmlNode MotorName = xmlDoc.CreateElement("Name");
                XmlAttribute MotorNameAttribute = xmlDoc.CreateAttribute("Description");
                MotorNameAttribute.Value = "名称";
                MotorName.Attributes.Append(MotorNameAttribute);
                XmlText xmlElemMotorName = xmlDoc.CreateTextNode(_currentMotor.Name.Length < 1 ? " " : _currentMotor.Name);//泵型号
                MotorName.AppendChild(xmlElemMotorName);
 
                //创建MotorSeriesID子节点
                XmlNode MotorSeriesID = xmlDoc.CreateElement("SeriesID");
                XmlAttribute MotorSeriesIDAttribute = xmlDoc.CreateAttribute("Description");
                MotorSeriesIDAttribute.Value = "系列标识ID";
                MotorSeriesID.Attributes.Append(MotorSeriesIDAttribute);
                XmlText xmlElemMotorSeriesID = xmlDoc.CreateTextNode(_currentMotor.SeriesID < 1 ? " " : _currentMotor.SeriesID.ToString());//系列ID
                MotorSeriesID.AppendChild(xmlElemMotorSeriesID);
 
                //创建MotorRatedPower子节点
                XmlNode MotorRatedPower = xmlDoc.CreateElement("RatedPower");
                XmlAttribute MotorRatedPowerAttribute = xmlDoc.CreateAttribute("Description");
                MotorRatedPowerAttribute.Value = "额定功率(kW)";
                MotorRatedPower.Attributes.Append(MotorRatedPowerAttribute);
                XmlText xmlElemMotorRatedPower = xmlDoc.CreateTextNode(_currentMotor.RatedPower < 0 ? " " : _currentMotor.RatedPower.ToString());//系列ID
                MotorRatedPower.AppendChild(xmlElemMotorRatedPower);
 
                //创建MotorPowerFactor子节点
                XmlNode MotorPowerFactor = xmlDoc.CreateElement("PowerFactor");
                XmlAttribute MotorPowerFactorAttribute = xmlDoc.CreateAttribute("Description");
                MotorPowerFactorAttribute.Value = "功率因子";
                MotorPowerFactor.Attributes.Append(MotorPowerFactorAttribute);
                XmlText xmlElemMotorPowerFactor = xmlDoc.CreateTextNode(_currentMotor.PowerFactor < 0 ? " " : _currentMotor.PowerFactor.ToString());//系列ID
                MotorPowerFactor.AppendChild(xmlElemMotorPowerFactor);
 
                //创建MotorRatedI子节点
                XmlNode MotorRatedI = xmlDoc.CreateElement("RatedI");
                XmlAttribute MotorRatedIAttribute = xmlDoc.CreateAttribute("Description");
                MotorRatedIAttribute.Value = "额定电流(A)";
                MotorRatedI.Attributes.Append(MotorRatedIAttribute);
                XmlText xmlElemMotorMotorRatedI = xmlDoc.CreateTextNode(_currentMotor.RatedI < 0 ? " " : _currentMotor.RatedI.ToString());//系列ID
                MotorRatedI.AppendChild(xmlElemMotorMotorRatedI);
 
                //创建MotorRatedU子节点
                XmlNode MotorRatedU = xmlDoc.CreateElement("RatedU");
                XmlAttribute MotorMotorRatedUAttribute = xmlDoc.CreateAttribute("Description");
                MotorMotorRatedUAttribute.Value = "额定电压(U)";
                MotorRatedU.Attributes.Append(MotorMotorRatedUAttribute);
                XmlText xmlElemMotorRatedU = xmlDoc.CreateTextNode(_currentMotor.RatedU < 0 ? " " : _currentMotor.RatedU.ToString());//系列ID
                MotorRatedU.AppendChild(xmlElemMotorRatedU);
 
                //创建MotorRatedN子节点
                XmlNode MotorRatedN = xmlDoc.CreateElement("RatedN");
                XmlAttribute MotorMotorRatedNAttribute = xmlDoc.CreateAttribute("Description");
                MotorMotorRatedNAttribute.Value = "额定电压(U)";
                MotorRatedN.Attributes.Append(MotorMotorRatedNAttribute);
                XmlText xmlElemMotorRatedN = xmlDoc.CreateTextNode(_currentMotor.Ratedn < 0 ? " " : _currentMotor.Ratedn.ToString());//系列ID
                MotorRatedN.AppendChild(xmlElemMotorRatedN);
 
 
                //创建MotorPhaseNum子节点
                XmlNode MotorPhaseNum = xmlDoc.CreateElement("MotorRateParas");
                XmlAttribute MotorPhaseNumAttribute = xmlDoc.CreateAttribute("Description");
                MotorPhaseNumAttribute.Value = "电机类型";
                MotorPhaseNum.Attributes.Append(MotorPhaseNumAttribute);
                XmlText xmlElemMotorPhaseNum = xmlDoc.CreateTextNode(_currentMotor.PhaseNum.GetDisplayText());//系列ID
                MotorPhaseNum.AppendChild(xmlElemMotorPhaseNum);
 
                //创建MotorRateparas子节点
                XmlElement MotorRateparas = xmlDoc.CreateElement("Motor");
                XmlAttribute MotorRateparasAttribute = xmlDoc.CreateAttribute("Description");
                MotorRateparasAttribute.Value = "电机参数";
                MotorRateparas.Attributes.Append(MotorRateparasAttribute);
                MotorRateparas.SetAttribute("Description", "电机额定参数");
 
                if (!string.IsNullOrEmpty(_currentMotor.RatedParas))
                {
                    var Paras = RatedParas4Motor.ToModel(_currentMotor.RatedParas);
                    if (Paras != null)
                    {
                        //创建MotorIsFrequency子节点
                        XmlNode MotorIsFrequency = xmlDoc.CreateElement("SeriesID");
                        XmlAttribute MotorIsFrequencyAttribute = xmlDoc.CreateAttribute("Description");
                        MotorIsFrequencyAttribute.Value = "额定电压(U)";
                        MotorIsFrequency.Attributes.Append(MotorIsFrequencyAttribute);
                        XmlText xmlElemMotorIsFrequency = xmlDoc.CreateTextNode(Paras.IsFrequency == true ? "变频泵" : "非变频泵");//系列ID
                        MotorIsFrequency.AppendChild(xmlElemMotorIsFrequency);
 
                        //创建MotorE_PLC子节点
                        XmlNode MotorE_PLC = xmlDoc.CreateElement("SeriesID");
                        XmlAttribute MotorE_PLCAttribute = xmlDoc.CreateAttribute("Description");
                        MotorE_PLCAttribute.Value = "变频器效率(%)";
                        MotorE_PLC.Attributes.Append(MotorE_PLCAttribute);
                        XmlText xmlElemMotorE_PLC = xmlDoc.CreateTextNode(Paras.E_PLC < 0 ? " " : Paras.E_PLC.ToString());//系列ID
                        MotorE_PLC.AppendChild(xmlElemMotorE_PLC);
 
                        //创建MotoE_Self子节点
                        XmlNode MotoE_Self = xmlDoc.CreateElement("SeriesID");
                        XmlAttribute MotoE_SelfAttribute = xmlDoc.CreateAttribute("Description");
                        MotoE_SelfAttribute.Value = "电机效率(%)";
                        MotoE_Self.Attributes.Append(MotoE_SelfAttribute);
                        XmlText xmlElemMotoE_Self = xmlDoc.CreateTextNode(Paras.E_Self < 0 ? " " : Paras.E_Self.ToString());//系列ID
                        MotoE_Self.AppendChild(xmlElemMotoE_Self);
 
 
                        MotorRateparas.AppendChild(MotorIsFrequency);
                        MotorRateparas.AppendChild(MotorE_PLC);
                        MotorRateparas.AppendChild(MotoE_Self);
                    }
                }
 
                PumpMotorMain.AppendChild(MotorID);
                PumpMotorMain.AppendChild(MotorCreateUserID);
                PumpMotorMain.AppendChild(MotorCreateTime);
                PumpMotorMain.AppendChild(MotorUpdateUserID);
                PumpMotorMain.AppendChild(MotorUpdateTime);
                PumpMotorMain.AppendChild(MotorCode);
                PumpMotorMain.AppendChild(MotorName);
                PumpMotorMain.AppendChild(MotorSeriesID);
                PumpMotorMain.AppendChild(MotorRatedPower);
                PumpMotorMain.AppendChild(MotorPowerFactor);
                PumpMotorMain.AppendChild(MotorRatedI);
                PumpMotorMain.AppendChild(MotorRatedU);
                PumpMotorMain.AppendChild(MotorRatedN);
                PumpMotorMain.AppendChild(MotorPhaseNum);
                PumpMotorMain.AppendChild(MotorRateparas);
            }
            #endregion
 
            #endregion
 
            #region 测试数据
            //创建TestData子节点
            XmlElement TestDataNode = xmlDoc.CreateElement("TestData");
 
 
            if (this._allRecords != null || this._allRecords.Count() != 0)
            {
                var sort_allRecords = (from x in this._allRecords orderby x.CorrectPtQ select x).ToList();
                //序号 
                foreach (var item in sort_allRecords)
                {
 
                    var xmlForm = "Record";
 
                    XmlElement xmlElementFrom = xmlDoc.CreateElement(xmlForm);
 
                    var xmlTime = "Time";
                    var xmlTestPtQ = "TestPtQ";
                    var xmlCorrectPtQ = "CorrectPtQ";
                    var xmlTestPtH = "TestPtH";
                    var xmlCorrectPtH = "CorrectPtH";
                    var xmlTestPtP = "TestPtP";
                    var xmlCorrectPtP = "CorrectPtP";
                    var xmlTestPtE = "TestPtE";
                    var xmlCorrectPtE = "CorrectPtE";
                    var xmlSpeed = "Speed";
                    //var xmlMotorEfficient = "MotorEfficient";
                    //var xmlMotorFactor = "MotorFactor";
 
                    var Time = item.Time;
 
                    var TestPtQ = item.TestPtQ.ToString();
                    var TestPtH = item.TestPtH.ToString();
                    var TestPtE = item.CorrectPtE.ToString();
                    var TestPtP = item.TestPtP.ToString();
 
                    var CorrectPtQ = item.CorrectPtQ.ToString();
                    var CorrectPtH = item.CorrectPtH.ToString();
                    var CorrectPtE = item.CorrectPtE.ToString();
                    var CorrectPtP = item.CorrectPtP.ToString();
 
                    var Speed = item.Speed.ToString();
                    //var MotorEfficient = item.MotorEfficient.ToString();
                    //var MotorFactor = item.MotorEfficient.ToString();
 
                    XmlNode xmlTimeNode = xmlDoc.CreateElement(xmlTime);
                    XmlAttribute TimeNodeAttribute = xmlDoc.CreateAttribute("Description");
                    TimeNodeAttribute.Value = "测试时间";
                    xmlTimeNode.Attributes.Append(TimeNodeAttribute);
                    XmlText xmlElemTimeNode = xmlDoc.CreateTextNode(Time.ToString("yyyy-MM-dd-HH:mm"));
                    xmlTimeNode.AppendChild(xmlElemTimeNode);
                    xmlElementFrom.AppendChild(xmlTimeNode);
 
                    XmlNode xmlTestPtQNode = xmlDoc.CreateElement(xmlTestPtQ);
                    XmlAttribute TestQNodeAttribute = xmlDoc.CreateAttribute("Description");
                    TestQNodeAttribute.Value = "流量 m³/h(换算前)";
                    xmlTestPtQNode.Attributes.Append(TestQNodeAttribute);
                    XmlText xmlElemTestQNode = xmlDoc.CreateTextNode(TestPtQ);
                    xmlTestPtQNode.AppendChild(xmlElemTestQNode);
                    xmlElementFrom.AppendChild(xmlTestPtQNode);
 
                    XmlNode xmlCorrectPtQNode = xmlDoc.CreateElement(xmlCorrectPtQ);
                    XmlAttribute CorrectPtQNodeAttribute = xmlDoc.CreateAttribute("Description");
                    CorrectPtQNodeAttribute.Value = "流量 m³/h(换算后)";
                    xmlCorrectPtQNode.Attributes.Append(CorrectPtQNodeAttribute);
                    XmlText xmlElemCorrectPtQ = xmlDoc.CreateTextNode(CorrectPtQ);
                    xmlCorrectPtQNode.AppendChild(xmlElemCorrectPtQ);
                    xmlElementFrom.AppendChild(xmlCorrectPtQNode);
 
                    XmlNode xmlTestPtHNode = xmlDoc.CreateElement(xmlTestPtH);
                    XmlAttribute TestHNodeNodeAttribute = xmlDoc.CreateAttribute("Description");
                    TestHNodeNodeAttribute.Value = "扬程 m (换算前)";
                    xmlTestPtHNode.Attributes.Append(TestHNodeNodeAttribute);
                    XmlText xmlElemTestH = xmlDoc.CreateTextNode(TestPtH);
                    xmlTestPtHNode.AppendChild(xmlElemTestH);
                    xmlElementFrom.AppendChild(xmlTestPtHNode);
 
                    XmlNode xmlCorrectPtHNode = xmlDoc.CreateElement(xmlCorrectPtH);
                    XmlAttribute CorrectPtHAttribute = xmlDoc.CreateAttribute("Description");
                    CorrectPtHAttribute.Value = "扬程 m(换算后)";
                    xmlCorrectPtHNode.Attributes.Append(CorrectPtHAttribute);
                    XmlText xmlElemCorrectP = xmlDoc.CreateTextNode(CorrectPtH);
                    xmlCorrectPtHNode.AppendChild(xmlElemCorrectP);
                    xmlElementFrom.AppendChild(xmlCorrectPtHNode);
 
                    XmlNode xmlTestPtPNode = xmlDoc.CreateElement(xmlTestPtP);
                    XmlAttribute TestPumpPAttribute = xmlDoc.CreateAttribute("Description");
                    TestPumpPAttribute.Value = "泵轴功率 kW(换算前)";
                    xmlTestPtPNode.Attributes.Append(TestPumpPAttribute);
                    XmlText xmlElemzTestPumpP = xmlDoc.CreateTextNode(TestPtP);
                    xmlTestPtPNode.AppendChild(xmlElemzTestPumpP);
                    xmlElementFrom.AppendChild(xmlTestPtPNode);
 
                    XmlNode xmlCorrectPtPNode = xmlDoc.CreateElement(xmlCorrectPtP);
                    XmlAttribute CorrectPtPumpPAttribute = xmlDoc.CreateAttribute("Description");
                    CorrectPtPumpPAttribute.Value = "泵轴功率 kW(换算后)";
                    xmlCorrectPtPNode.Attributes.Append(CorrectPtPumpPAttribute);
                    XmlText xmlElemzCorrectPtPump = xmlDoc.CreateTextNode(CorrectPtP);
                    xmlCorrectPtPNode.AppendChild(xmlElemzCorrectPtPump);
                    xmlElementFrom.AppendChild(xmlCorrectPtPNode);
 
                    XmlNode xmlTestPtENode = xmlDoc.CreateElement(xmlTestPtE);
                    XmlAttribute TestPtEAttribute = xmlDoc.CreateAttribute("Description");
                    TestPtEAttribute.Value = "泵效率 % (换算前)";
                    xmlTestPtENode.Attributes.Append(TestPtEAttribute);
                    XmlText xmlElemzTestPumpE = xmlDoc.CreateTextNode(TestPtE);
                    xmlTestPtENode.AppendChild(xmlElemzTestPumpE);
                    xmlElementFrom.AppendChild(xmlTestPtENode);
 
                    XmlNode xmlCorrectPtENode = xmlDoc.CreateElement(xmlCorrectPtE);
                    XmlAttribute xmlCorrectPtEAttribute = xmlDoc.CreateAttribute("Description");
                    xmlCorrectPtEAttribute.Value = "泵效率 %(换算后)";
                    xmlCorrectPtENode.Attributes.Append(xmlCorrectPtEAttribute);
                    XmlText xmlElemzCorrectPtE = xmlDoc.CreateTextNode(CorrectPtE);
                    xmlCorrectPtENode.AppendChild(xmlElemzCorrectPtE);
                    xmlElementFrom.AppendChild(xmlCorrectPtENode);
 
                    XmlNode xmlSpeedNode = xmlDoc.CreateElement(xmlSpeed);
                    XmlAttribute xmlSpeedNodeAttribute = xmlDoc.CreateAttribute("Description");
                    xmlSpeedNodeAttribute.Value = "转速 r/min";
                    xmlSpeedNode.Attributes.Append(xmlSpeedNodeAttribute);
                    XmlText xmlElemzSpeed = xmlDoc.CreateTextNode(Speed);
                    xmlSpeedNode.AppendChild(xmlElemzSpeed);
                    xmlElementFrom.AppendChild(xmlSpeedNode);
 
                    //XmlNode xmlMotorEfficientNode = xmlDoc.CreateElement(xmlMotorEfficient);
                    //XmlAttribute MotorEfficientAttribute = xmlDoc.CreateAttribute("Description");
                    //MotorEfficientAttribute.Value = "电机效率 %";
                    //xmlMotorEfficientNode.Attributes.Append(MotorEfficientAttribute);
                    //XmlText xmlElemzMotorEfficient = xmlDoc.CreateTextNode(MotorEfficient);
                    //xmlMotorEfficientNode.AppendChild(xmlElemzMotorEfficient);
                    //xmlElementFrom.AppendChild(xmlMotorEfficientNode);
 
                    //XmlNode xmlMotorFactorNode = xmlDoc.CreateElement(xmlMotorFactor);
                    //XmlAttribute MotorFactorAttribute = xmlDoc.CreateAttribute("Description");
                    //MotorFactorAttribute.Value = "电机功率因子";
                    //xmlMotorFactorNode.Attributes.Append(MotorFactorAttribute);
                    //XmlText xmlElemzMotorFactor = xmlDoc.CreateTextNode(MotorFactor);
                    //xmlMotorFactorNode.AppendChild(xmlElemzMotorFactor);
                    //xmlElementFrom.AppendChild(xmlMotorFactorNode);
 
                    XmlElement xmlMonitorListNode = xmlDoc.CreateElement("MonitorRecordList");
                    XmlAttribute MonitorRecordListAttribute = xmlDoc.CreateAttribute("Description");
                    MonitorRecordListAttribute.Value = "测点列表";
                    xmlMonitorListNode.Attributes.Append(MonitorRecordListAttribute);
 
                    foreach (var monitoritem in item.MonitorRecordList)
                    {
                        if (this._allMonitorPoints != null || this._allMonitorPoints.Count() != 0)
                        {
                            var monitor = _allMonitorPoints.Find(x => x.ID == monitoritem.ID);
 
                            if (monitor != null)
                            {
                                //创建MonitorID子节点
                                XmlNode Monitor = xmlDoc.CreateElement("Monitor");
                                XmlAttribute MonitorAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorAttribute.Value = "测点";
                                Monitor.Attributes.Append(MonitorAttribute);
                                xmlMonitorListNode.AppendChild(Monitor);
 
                                //创建MonitorID子节点
                                XmlNode MonitorID = xmlDoc.CreateElement("MonitorID");
                                XmlAttribute MonitorIDAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorIDAttribute.Value = "测点ID";
                                MonitorID.Attributes.Append(MonitorIDAttribute);
                                XmlText xmlElemMonitorID = xmlDoc.CreateTextNode(monitor?.ID.ToString());//测试台ID
                                MonitorID.AppendChild(xmlElemMonitorID);
                                Monitor.AppendChild(MonitorID);
 
                                //创建MonitorCreateUserID子节点
                                XmlNode MonitorCreateUserID = xmlDoc.CreateElement("CreateUserID");
                                XmlAttribute MonitorCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorCreateUserIDAttribute.Value = "创建人ID";
                                MonitorCreateUserID.Attributes.Append(MonitorCreateUserIDAttribute);
                                XmlText xmlElemMonitorCreateUserID = xmlDoc.CreateTextNode(monitor?.CreateUserID < 1 ? " " : monitor?.CreateUserID.ToString());//创建名称
                                MonitorCreateUserID.AppendChild(xmlElemMonitorCreateUserID);
                                Monitor.AppendChild(MonitorCreateUserID);
 
                                //创建MonitorCreateTime子节点
                                XmlNode MonitorCreateTime = xmlDoc.CreateElement("CreateTime");
                                XmlAttribute MonitorCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorCreateTimeAttribute.Value = "创建时间";
                                MonitorCreateTime.Attributes.Append(MonitorCreateTimeAttribute);
                                XmlText xmlElemMonitorCreateTime = xmlDoc.CreateTextNode(monitor?.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : monitor?.CreateTime.ToString("yyyy-MM-dd"));//创建时间
                                MonitorCreateTime.AppendChild(xmlElemMonitorCreateTime);
                                Monitor.AppendChild(MonitorCreateTime);
 
                                //创建MonitorUpdateUserID 子节点
                                XmlNode MonitorUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
                                XmlAttribute MonitorUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorUpdateUserIDAttribute.Value = "更新人ID";
                                MonitorUpdateUserID.Attributes.Append(MonitorUpdateUserIDAttribute);
                                XmlText xmlElemMonitorUpdateUserID = xmlDoc.CreateTextNode(monitor?.UpdateUserID < 1 ? " " : monitor?.UpdateUserID.ToString());//创建名称
                                MonitorUpdateUserID.AppendChild(xmlElemMonitorUpdateUserID);
                                Monitor.AppendChild(MonitorUpdateUserID);
 
                                //创建MonitorUpdateTime子节点
                                XmlNode MonitorUpdateTime = xmlDoc.CreateElement("UpdateTime");
                                XmlAttribute MonitorUpdateTimeAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorUpdateTimeAttribute.Value = "更新时间";
                                MonitorUpdateTime.Attributes.Append(MonitorUpdateTimeAttribute);
                                XmlText xmlElemMonitorUpdateTime = xmlDoc.CreateTextNode(monitor?.UpdateTime < Convert.ToDateTime("2008-1-1") ? " " : monitor?.UpdateTime.ToString("yyyy-MM-dd"));//创建时间
                                MonitorUpdateTime.AppendChild(xmlElemMonitorUpdateTime);
                                Monitor.AppendChild(MonitorUpdateTime);
 
                                //创建MonitorCode子节点
                                XmlNode MonitorCode = xmlDoc.CreateElement("Code");
                                XmlAttribute MonitorCodeAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorCodeAttribute.Value = "编号";
                                MonitorCode.Attributes.Append(MonitorCodeAttribute);
                                XmlText xmlElemMonitorCode = xmlDoc.CreateTextNode(monitor?.Code);//创建时间
                                MonitorCode.AppendChild(xmlElemMonitorCode);
                                Monitor.AppendChild(MonitorCode);
 
                                //创建MonitorType子节点
                                XmlNode MonitorType = xmlDoc.CreateElement("Monitor");
                                XmlAttribute MonitorTypeAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorTypeAttribute.Value = "测点类型";
                                MonitorType.Attributes.Append(MonitorTypeAttribute);
                                XmlText xmlElemMonitorType = xmlDoc.CreateTextNode(monitor?.MonitorType.GetDisplayText());//创建时间
                                MonitorType.AppendChild(xmlElemMonitorType);
                                Monitor.AppendChild(MonitorType);
 
                                //创建MonitorPipeDia子节点
                                XmlNode MonitorPipeDia = xmlDoc.CreateElement("PipeDia");
                                XmlAttribute MonitorPipeDiaAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorPipeDiaAttribute.Value = "管径";
                                MonitorPipeDia.Attributes.Append(MonitorPipeDiaAttribute);
                                XmlText xmlElemMonitorPipeDia = xmlDoc.CreateTextNode(monitor?.PipeDia < 0 ? "" : monitor?.PipeDia.ToString());//创建时间
                                MonitorPipeDia.AppendChild(xmlElemMonitorPipeDia);
                                Monitor.AppendChild(MonitorPipeDia);
 
                                //创建MonitorElevation子节点
                                XmlNode MonitorElevation = xmlDoc.CreateElement("Elevation");
                                XmlAttribute MonitorElevationAttribute = xmlDoc.CreateAttribute("Description");
                                MonitorElevationAttribute.Value = "标高";
                                MonitorElevation.Attributes.Append(MonitorElevationAttribute);
                                XmlText xmlElemMonitorElevation = xmlDoc.CreateTextNode(monitor?.Elevation < 0 ? "" : monitor?.Elevation.ToString());//创建时间
                                MonitorElevation.AppendChild(xmlElemMonitorElevation);
                                Monitor.AppendChild(MonitorElevation);
 
                                //创建MonitorValueCoefficient子节点
                                //XmlNode MonitorValueCoefficient = xmlDoc.CreateElement("ValueCoefficient");
                                //XmlAttribute ValueCoefficientAttribute = xmlDoc.CreateAttribute("Description");
                                //ValueCoefficientAttribute.Value = "相乘系数";
                                //MonitorValueCoefficient.Attributes.Append(ValueCoefficientAttribute);
                                //XmlText xmlElemMonitorValueCoefficient = xmlDoc.CreateTextNode(monitor?.ValueCoefficient < 0 ? "" : monitor?.ValueCoefficient.ToString());//创建时间
                                //MonitorValueCoefficient.AppendChild(xmlElemMonitorValueCoefficient);
                                //Monitor.AppendChild(MonitorValueCoefficient);
 
                                ////创建MonitorValueAdditional子节点
                                //XmlNode MonitorValueAdditional = xmlDoc.CreateElement("ValueAdditional");
                                //XmlAttribute ValueAdditionalAttribute = xmlDoc.CreateAttribute("Description");
                                //ValueAdditionalAttribute.Value = "相加系数";
                                //MonitorValueAdditional.Attributes.Append(ValueAdditionalAttribute);
                                //XmlText xmlElemMonitorValueAdditional = xmlDoc.CreateTextNode(monitor?.ValueAdditional < 0 ? "" : monitor?.ValueAdditional.ToString());//创建时间
                                //MonitorValueAdditional.AppendChild(xmlElemMonitorValueAdditional);
                                //Monitor.AppendChild(MonitorValueAdditional);
 
                                XmlElement xmlWorkBenchTestParas = xmlDoc.CreateElement("WorkBenchTestParas");
                                XmlAttribute WorkBenchTestParasAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasAttribute.Value = "测试参数";
                                xmlWorkBenchTestParas.Attributes.Append(WorkBenchTestParasAttribute);
 
 
                                var workParas = new BLL.WorkBenchBase().GetByID(monitor.BenchID);
                                //创建MonitorCreateUserID子节点
                                XmlNode WorkBenchTestParasCreateUserID = xmlDoc.CreateElement("CreateUserID");
                                XmlAttribute WorkBenchTestParasCreateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasCreateUserIDAttribute.Value = "创建人ID";
                                WorkBenchTestParasCreateUserID.Attributes.Append(WorkBenchTestParasCreateUserIDAttribute);
                                XmlText xmlElemWorkBenchTestParasCreateUserID = xmlDoc.CreateTextNode(workParas.CreateUserID < 1 ? " " : workParas.CreateUserID.ToString());//创建名称
                                WorkBenchTestParasCreateUserID.AppendChild(xmlElemWorkBenchTestParasCreateUserID);
                                xmlWorkBenchTestParas.AppendChild(WorkBenchTestParasCreateUserID);
 
                                //创建WorkBenchTestParasCreateTime子节点
                                XmlNode WorkBenchTestParasCreateTime = xmlDoc.CreateElement("CreateTime");
                                XmlAttribute WorkBenchTestParasCreateTimeAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasCreateTimeAttribute.Value = "创建时间";
                                WorkBenchTestParasCreateTime.Attributes.Append(WorkBenchTestParasCreateTimeAttribute);
                                XmlText xmlElemWorkBenchTestParasCreateTime = xmlDoc.CreateTextNode(workParas.CreateTime < Convert.ToDateTime("2008-1-1") ? " " : workParas.CreateTime.ToString("yyyy-MM-dd"));//创建时间
                                WorkBenchTestParasCreateTime.AppendChild(xmlElemWorkBenchTestParasCreateTime);
                                xmlWorkBenchTestParas.AppendChild(WorkBenchTestParasCreateTime);
 
                                //创建WorkBenchTestParasUpdateUserID 子节点
                                XmlNode WorkBenchTestParasUpdateUserID = xmlDoc.CreateElement("UpdateUserID");
                                XmlAttribute WorkBenchTestParasUpdateUserIDAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasUpdateUserIDAttribute.Value = "更新人ID";
                                WorkBenchTestParasUpdateUserID.Attributes.Append(WorkBenchTestParasUpdateUserIDAttribute);
                                XmlText xmlElemWorkBenchTestParasUpdateUserID = xmlDoc.CreateTextNode(workParas.UpdateUserID < 1 ? " " : workParas.UpdateUserID.ToString());//创建名称
                                WorkBenchTestParasUpdateUserID.AppendChild(xmlElemWorkBenchTestParasUpdateUserID);
                                xmlWorkBenchTestParas.AppendChild(WorkBenchTestParasUpdateUserID);
 
 
                                //创建WorkBenchTestParasTestMethod 子节点
                                XmlNode WorkBenchTestParasTestMethod = xmlDoc.CreateElement("TestMethod");
                                XmlAttribute WorkBenchTestParasTestMethodAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasTestMethodAttribute.Value = "测试方法";
                                WorkBenchTestParasTestMethod.Attributes.Append(WorkBenchTestParasTestMethodAttribute);
                                XmlText xmlElemWorkBenchTestParasTestMethod = xmlDoc.CreateTextNode(workParas?.TestMethod?.ToString());//创建名称
                                WorkBenchTestParasTestMethod.AppendChild(xmlElemWorkBenchTestParasTestMethod);
                                xmlWorkBenchTestParas.AppendChild(WorkBenchTestParasTestMethod);
 
 
                                //创建WorkBenchTestParasTestSetting子节点
                                XmlNode WorkBenchTestParasTestSetting = xmlDoc.CreateElement("TestSetting");
                                XmlAttribute WorkBenchTestParasTestSettingAttribute = xmlDoc.CreateAttribute("Description");
                                WorkBenchTestParasTestSettingAttribute.Value = "测试设定";
                                WorkBenchTestParasTestSetting.Attributes.Append(WorkBenchTestParasTestSettingAttribute);
                                XmlText xmlElemWorkBenchTestParasTestSetting = xmlDoc.CreateTextNode(workParas?.TestSetting?.ToString());//创建名称
                                WorkBenchTestParasTestSetting.AppendChild(xmlElemWorkBenchTestParasTestSetting);
                                xmlWorkBenchTestParas.AppendChild(WorkBenchTestParasTestSetting);
 
                                Monitor.AppendChild(xmlWorkBenchTestParas);
                                xmlMonitorListNode.AppendChild(Monitor);
                            }
 
                        }
                    }
 
                    xmlElementFrom.AppendChild(xmlMonitorListNode);
                    TestDataNode.AppendChild(xmlElementFrom);
                }
            }
 
            #endregion
 
            #region 版本信息附加子节点
 
            VersionInfoNode.AppendChild(VersionInfoSource);
            VersionInfoNode.AppendChild(VersionInfoVersion);
 
            #endregion
 
            #region  测试项目附加子节点
 
            TestProjectNode.AppendChild(TestProjectID);
            TestProjectNode.AppendChild(TtestReportFileNO);
            TestProjectNode.AppendChild(TestProjectSeriesID);
            TestProjectNode.AppendChild(TestProjectProductID);
            TestProjectNode.AppendChild(TestProjectPartID);
            TestProjectNode.AppendChild(TestProjectCreateUserID);
            TestProjectNode.AppendChild(TestProjectCreateTime);
            TestProjectNode.AppendChild(TestProjectTestUserID);
            TestProjectNode.AppendChild(TestProjectTestTime);
            TestProjectNode.AppendChild(TtestProjectCode);
            TestProjectNode.AppendChild(TtestProjectName);
            TestProjectNode.AppendChild(TtestProjectRemarks);
            TestProjectNode.AppendChild(TtestProjectIsFixed);
            TestProjectNode.AppendChild(TtestProjectUseStatus);
            TestProjectNode.AppendChild(TtestJudgeResult);
 
            #endregion
 
            #region   测试台附加子节点
 
            WorkBenchNode.AppendChild(WorkBenchID);
            WorkBenchNode.AppendChild(WorkBenchCreateUserID);
            WorkBenchNode.AppendChild(WorkBenchCreateTime);
            WorkBenchNode.AppendChild(WorkBenchCode);
            WorkBenchNode.AppendChild(WorkBenchName);
            WorkBenchNode.AppendChild(WorkBenchLastUseTime);
            WorkBenchNode.AppendChild(WorkBenchLastUseUserID);
            WorkBenchNode.AppendChild(WorkBenchLastUseUserID);
            WorkBenchNode.AppendChild(WorkBenchUseStatus);
            WorkBenchNode.AppendChild(WorkBenchPipeParas);
            WorkBenchNode.AppendChild(WorkBenchProductType);
 
            #endregion
 
 
            #region  产品附加子节点
 
            PartNode.AppendChild(PartID);
            PartNode.AppendChild(PartCreateUserID);
            PartNode.AppendChild(PartCreateTime);
            PartNode.AppendChild(PartCode);
            PartNode.AppendChild(PartName);
            PartNode.AppendChild(PartLastTestUserID);
            PartNode.AppendChild(PartLastTestTime);
            PartNode.AppendChild(PartSenderID);
            PartNode.AppendChild(PartSendTime);
            PartNode.AppendChild(PartManufacturerID);
            PartNode.AppendChild(PartManufactureTime);
            PartNode.AppendChild(PartNote);
 
            #endregion
 
 
            #region 泵附加子节点
 
            PumpNode.AppendChild(PumpID);
            PumpNode.AppendChild(PumpCreateUserID);
            PumpNode.AppendChild(PumpCreateTime);
            PumpNode.AppendChild(PumpUpdateUserID);
            PumpNode.AppendChild(PumpUpdateTime);
            PumpNode.AppendChild(PumpCode);
            PumpNode.AppendChild(PumpName);
            PumpNode.AppendChild(PumpSeriesID);
            PumpNode.AppendChild(PumpRatedn);
            PumpNode.AppendChild(PumpD2);
            PumpNode.AppendChild(PumpPosiAngle);
            PumpNode.AppendChild(PumpRatedParas);
 
            #region 泵额定参数附加子节点
 
            PumpRatedParas.Prepend​Child(PumpQ);
            PumpRatedParas.AppendChild(PumpH);
            PumpRatedParas.AppendChild(PumpP);
            PumpRatedParas.AppendChild(PumpE);
            PumpRatedParas.AppendChild(PumpNPSHr);
            PumpRatedParas.AppendChild(PumpIsFrequency);
            PumpRatedParas.AppendChild(PumpIsSxp);
            PumpRatedParas.AppendChild(PumpStageNumber);
            PumpRatedParas.AppendChild(PumpOutletCaliber);
            PumpRatedParas.AppendChild(PumpInletCaliber);
            PumpRatedParas.AppendChild(PumpGaoCha);
            #endregion
 
            PumpNode.AppendChild(PumpMotorMain);
 
 
            #endregion
 
            #region 信息附加模块子节点
 
            rootNode.AppendChild(VersionInfoNode);
            rootNode.AppendChild(TestProjectNode);
            rootNode.AppendChild(WorkBenchNode);
            rootNode.AppendChild(PartNode);
            rootNode.AppendChild(PumpNode);
            rootNode.AppendChild(TestDataNode);
 
            #endregion
 
            //附加根节点
            xmlDoc.AppendChild(rootNode);
 
            xmlDoc.Save(Path);
 
            Console.WriteLine("已保存Xml文档");
            return null;
        }
 
    }
 
 
}