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.PrependChild(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;
|
}
|
|
}
|
|
|
}
|