private DataTable GetItems(string vendorID) { string currentCat = CategoryNameLabel.Text; DataTable ItemInfo = StoreMenuInfo.GetItemList(vendorID, currentCat); return(ItemInfo); }
private void UpdateCategory_Click(object sender, EventArgs e) { string oldName = ItemName.Text.Substring(0, ItemName.Text.Length - 9); string newCatName = EditCategoryTBox.Text; StoreMenuInfo.EditCategory(vendorID, oldName, newCatName); ItemName.Text = newCatName + " Category"; }
private void UpdateItemInfo() { string id = ItemName.Text; if (id.Contains("PicBox")) { id = id.Substring(0, id.Length - 6); } else // == "Label". No Other Possibilities { id = id.Substring(0, id.Length - 5); } DataTable dt = StoreMenuInfo.GetSpecificItem(vendorID, id); //ItemName.Text = dt.Rows[0][2].ToString(); NameTBox.Text = dt.Rows[0][2].ToString(); CategoryTBox.Text = dt.Rows[0][3].ToString(); DescTBox.Text = dt.Rows[0][4].ToString(); PriceTBox.Text = dt.Rows[0][5].ToString(); EditItemPanel.BringToFront(); }
private List <string> GetCategories(string vendorID, out int itemAmm) { DataTable MenuTable = StoreMenuInfo.GetMenuInfo(vendorID); //This Returns all Items from the server List <string> DuplicateCategoryList = new List <string>(); foreach (DataRow Item in MenuTable.Rows) { DuplicateCategoryList.Add(Item[3].ToString()); } itemAmm = MenuTable.Rows.Count; List <string> CategoryList = new List <string>(); foreach (string category in DuplicateCategoryList) { if (!CategoryList.Contains(category)) { CategoryList.Add(category); } } return(CategoryList); }
private void UpdateButton_Click(object sender, EventArgs e) { StoreMenuInfo.EditItem(vendorID, ItemName.Text, NameTBox.Text, CategoryTBox.Text, DescTBox.Text, PriceTBox.Text); //ItemName.Text = NameTBox.Text; }
private void AddNewCat_Click(object sender, EventArgs e) { StoreMenuInfo.AddCategory(vendorID, NameTBox.Text, CategoryTBox.Text, DescTBox.Text, PriceTBox.Text); }