private void LoadDishesButtonsInSections() { DishInfo_pnl.Visible = true; DishInfo_pnl.BringToFront(); foreach (XElement xe in (XDocument.Load(XmlParser.xmlDishPath).XPathSelectElements("//Dish"))) { if (xe.Element("Type").Value.Equals("Appetizer")) { AddButtonToCategoryAppetizer(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Main")) { AddButtonToCategoryMain(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Dessert")) { AddButtonToCategoryDessert(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Drink")) { AddButtonToCategoryDrink(xe.Element("Name").Value); } } }
private void LoadDishesButtonsInSections() { //DataSet DishLoad = new DataSet(); //DishLoad.ReadXml(XmlParser.xmlDishPath); //for (int i = 1; i <= CountDishesInXml("//Dish", XmlParser.xmlDishPath); i++) //{ //} //xpath //Type[text()="Main"] //foreach (XElement xe in (XDocument.Load(XmlParser.xmlDishPath).Descendants("Dish"))) DishInfo_pnl.Visible = true; DishInfo_pnl.BringToFront(); foreach (XElement xe in (XDocument.Load(XmlParser.xmlDishPath).XPathSelectElements("//Dish"))) { if (xe.Element("Type").Value.Equals("Appetizer")) { AddButtonToCategoryAppetizer(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Main")) { AddButtonToCategoryMain(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Dessert")) { AddButtonToCategoryDessert(xe.Element("Name").Value); } else if (xe.Element("Type").Value.Equals("Drink")) { AddButtonToCategoryDrink(xe.Element("Name").Value); } } }
private void appetizer_tab_Click(object sender, EventArgs e) { DishInfo_pnl.BringToFront(); DishInfo_pnl.Visible = true; }
private void tabPage2_Click(object sender, EventArgs e) { DishInfo_pnl.BringToFront(); DishInfo_pnl.Visible = true; }