Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataTable    headdata = new DataTable();
            DataRow      dr       = headdata.NewRow();
            BindingClass bc       = new BindingClass();
            string       FILENAME = "TCM_Test.xml";

            bc.readXmlFile(FILENAME);
            TestJobDefinition tj = bc.HeaderDataTag();

            headdata.Columns.Add("TestLocationRef", typeof(string));
            headdata.Columns.Add("VPProductionScheduleRef", typeof(string));
            headdata.Columns.Add("TestJobIdType", typeof(string));
            headdata.Columns.Add("TestJobName", typeof(string));
            headdata.Columns.Add("TestJobCreationDate", typeof(string));
            headdata.Columns.Add("VDSName", typeof(string));
            headdata.Columns.Add("Test Job Creater PersonRef", typeof(string));
            headdata.Columns.Add("Vehicle Configuration Id", typeof(string));

            dr["TestLocationRef"]         = tj.TestLocationRef.testLocationId;
            dr["VPProductionScheduleRef"] = tj.VPProductionScheduleRef.id;
            dr["TestJobIdType"]           = tj.TestJobId;
            dr["TestJobName"]             = tj.TestJobName;
            dr["TestJobCreationDate"]     = Convert.ToDateTime(tj.TestJobCreationDate);
            dr["VDSName"] = tj.VDSName;

            dr["Test Job Creater PersonRef"] = tj.testJobCreator.Id;
            dr["Vehicle Configuration Id"]   = tj.VehicleConfigurationId;



            headdata.Rows.Add(dr);
            dataGridView2.DataSource = headdata;
        }
Exemplo n.º 2
0
        public TestJobDefinition HeaderDataTag()
        {
            XmlNodeList headerData = xmldoc.GetElementsByTagName("HeaderData");

            foreach (XmlNode node in headerData)
            {
                TestJobDefinition testJobDefinition = new TestJobDefinition();
                foreach (XmlNode node_2 in node)
                {
                    testJobDefinition.TestJobId              = Convert.ToDouble(node_2["TestJobId"].InnerText);
                    testJobDefinition.TestJobName            = node_2["TestJobName"].InnerText;
                    testJobDefinition.TestJobCreationDate    = node_2["TestJobCreationDate"].InnerText;
                    testJobDefinition.VDSName                = node_2["VDSName"].InnerText;
                    testJobDefinition.VehicleConfigurationId = Convert.ToDouble(node_2["VehicleConfigurationId"].InnerText);

                    testJobDefinition.TestLocationRef.testLocationId = node_2.Attributes["TestLocationRef"].Value;
                    testJobDefinition.VPProductionScheduleRef.id     = node_2.Attributes["VPProductionScheduleRef"].Value;
                    testJobDefinition.testJobCreator.Id = node_2["TestJobCreator"].Attributes["PersonRef"].Value;
                }
                return(testJobDefinition);
            }
            return(null);
        }