Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Recordset>
- <AUCCars>
- <Web_Series>5 Series</Web_Series>
- <Body_Desc>Sedan</Body_Desc>
- <Model_Type>550i (E60)</Model_Type>
- <Model_Year>2006</Model_Year>
- <Ext_Colour>Alpine White III - Non-Metallic</Ext_Colour>
- <Int_Colour>Leather Dakota Black - Dakota Leather</Int_Colour>
- <Price>R 579000</Price>
- <Search_Price>579000</Search_Price>
- <Province>Gauteng</Province>
- <AucID>106288</AucID>
- <DealerID>45</DealerID>
- <DealerCode>29968</DealerCode>
- <DealerName>Lyndhurst Auto</DealerName>
- <Transmission>Automatic</Transmission>
- <AirCon>n/a</AirCon>
- <Radio>Yes</Radio>
- <PSteering>Yes</PSteering>
- <ABS>Yes</ABS>
- <Airbag>Yes</Airbag>
- <Sunroof>Yes</Sunroof>
- <Km>11500</Km>
- <Motorplan>Yes</Motorplan>
- <Warranty>N</Warranty>
- <BodyNo>6CR76051</BodyNo>
- <ModelOEM>NB52</ModelOEM>
- <ColourOEM>300</ColourOEM>
- <TrimOEM>LCSW</TrimOEM>
- <WheelsOEM></WheelsOEM>
- <Sold>N</Sold>
- <Notes> </Notes>
- <Moreoptions>Automatic Transmission with Steptronic
- Interior trim finishers, Fine-wood, Poplar Grain Brown, high-gloss
- Park Distance Control (PDC),front and rear</Moreoptions>
- <Picture>Vehicle_PicturesE60LIfrontview_big_P0300.jpg</Picture>
- <PictureRear>Vehicle_PicturesE60LIrearview_big_P0300.jpg</PictureRear>
- <Interior>Vehicle_PicturesE60LIInteriorbig_Fo_LCSW.jpg</Interior>
- </AUCCars>
- <AUCCars>
- <Web_Series>5 Series</Web_Series>
- <Body_Desc>Sedan</Body_Desc>
- <Model_Type>550i (E60)</Model_Type>
- <Model_Year>2006</Model_Year>
- <Ext_Colour>Black Sapphire - Metallic</Ext_Colour>
- <Int_Colour>Amethyst Black Exclusive Leather - Exclusive Leather</Int_Colour>
- <Price>R 529990</Price>
- <Search_Price>529990</Search_Price>
- <Province>KwaZulu Natal</Province>
- <AucID>111922</AucID>
- <DealerID>17</DealerID>
- <DealerCode>2485</DealerCode>
- <DealerName>Supertech</DealerName>
- <Transmission>Automatic</Transmission>
- <AirCon> Yes</AirCon>
- <Radio>Yes</Radio>
- <PSteering>Yes</PSteering>
- <ABS>Yes</ABS>
- <Airbag>Yes</Airbag>
- <Sunroof>n/a</Sunroof>
- <Km>7000</Km>
- <Motorplan>n/a</Motorplan>
- <Warranty>N</Warranty>
- <BodyNo>6CR75567</BodyNo>
- <ModelOEM>NB52</ModelOEM>
- <ColourOEM>475</ColourOEM>
- <TrimOEM>LDRH</TrimOEM>
- <WheelsOEM></WheelsOEM>
- <Sold>N</Sold>
- <Notes> </Notes>
- <Moreoptions>Automatic Transmission with Steptronic
- Electric Rear Screen Roller Sun Blind with manual Side Blinds
- Interior trim finishers, Fine-wood, Poplar Grain Brown, high-gloss
- High Beam Assist
- Head-up display (not with SA354)</Moreoptions>
- <Picture>Vehicle_PicturesE60LIfrontview_big_P0475.jpg</Picture>
- <PictureRear>Vehicle_PicturesE60LIrearview_big_P0475.jpg</PictureRear>
- <Interior>Vehicle_PicturesE60LIInteriorbig_Fo_LDRH.jpg</Interior>
- </AUCCars>
- <Recordset>
- // get data from file
- XElement aucCars = XElement.Load("data.xml");
- private void cmbSeries_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (cmbSeries.SelectedItem != null)
- {
- string currentSeries = cmbSeries.SelectedItem.ToString();
- var models = (from a in aucCars.Elements()
- where a.Element("Web_Series").Value == currentSeries
- select a.Element("Model_Type").Value).Distinct().ToList();
- cmbModel.DataSource = models;
- }
- showAucCars();
- }
- private void cmbModel_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (cmbModel.SelectedItem != null)
- {
- string currentSeries = cmbSeries.SelectedItem.ToString();
- string currentModel = cmbModel.SelectedItem.ToString();
- var years = (from a in aucCars.Elements()
- where a.Element("Web_Series").Value == currentSeries &&
- a.Element("Model_Type").Value == currentModel
- select a.Element("Model_Year").Value).Distinct().ToList();
- cmbYear.DataSource = years;
- }
- showAucCars();
- }
- private void cmbYear_SelectedIndexChanged(object sender, EventArgs e)
- {
- showAucCars();
- }
- private void frmXmlLoad_Load(object sender, EventArgs e)
- {
- var series = (from a in aucCars.Elements()
- select a.Element("Web_Series").Value).Distinct().ToList();
- cmbSeries.DataSource = series;
- }
- private void showAucCars()
- {
- var filterCars = aucCars.Elements();
- if (cmbSeries.SelectedItem!=null)
- {
- string currentSeries = cmbSeries.SelectedItem.ToString();
- filterCars = from a in filterCars
- where a.Element("Web_Series").Value == currentSeries
- select a;
- }
- if (cmbSeries.SelectedItem != null)
- {
- string currentModel = cmbModel.SelectedItem.ToString();
- filterCars = from a in filterCars
- where a.Element("Model_Type").Value == currentModel
- select a;
- }
- if (cmbSeries.SelectedItem != null)
- {
- string currentYear = cmbYear.SelectedItem.ToString();
- filterCars = from a in filterCars
- where a.Element("Model_Year").Value == currentYear
- select a;
- }
- // will show all the element data
- // add a new linq stmt to select specific elements
- listBox1.DataSource = filterCars.ToList();
- }
Add Comment
Please, Sign In to add comment