private OtherFood GeNewOther(double cost) { OtherFood res; res = new OtherFood(textBox1.Text, cost, ingrs, Int32.Parse(textBox3.Text)); return(res); }
private void ShowMenuPositionEd(MenuPosition mPos) { Drink ad = mPos as Drink; OtherFood ao = mPos as OtherFood; Pizza ap = mPos as Pizza; if (ad != null) { textBox1.Text = ad.Name; textBox2.Text = ad.Cost.ToString() + " руб."; textBox4.Text = ad.Volume.ToString() + " л."; radioButton2.Checked = true; } else if (ao != null) { textBox1.Text = ao.Name; textBox2.Text = ao.Cost.ToString() + " руб."; richTextBox1.Text = GetTextIngrs(ao.Ingredients); textBox3.Text = ao.RequiredTime + " мин."; radioButton3.Checked = true; } else if (ap != null) { textBox1.Text = ap.Name; textBox2.Text = ap.Cost.ToString() + " руб."; richTextBox1.Text = GetTextIngrs(ap.Ingredients); textBox3.Text = ap.RequiredTime + " мин."; radioButton1.Checked = true; } }
private void ShowPosition(string details, int index) { Order o = GetOrder(details); listBox7.Items.Clear(); MenuPosition pos = o.Content[index]; if (pos is Pizza) { Pizza pp = pos as Pizza; foreach (var i in pp.Ingredients) { listBox7.Items.Add(i.Name); } } else if (pos is OtherFood) { OtherFood po = pos as OtherFood; foreach (var i in po.Ingredients) { listBox7.Items.Add(i.Name); } } else { Drink d = pos as Drink; listBox7.Items.Add(d.Name + " " + d.Volume + "л."); } }
public List <Product> GetProducts(Order ord) { List <Product> res = new List <Product>(); foreach (var pos in ord.Content) { if (pos is Pizza) { Pizza pp = pos as Pizza; foreach (var i in pp.Ingredients) { AppQ((Product)i, res); } } else if (pos is OtherFood) { OtherFood po = pos as OtherFood; foreach (var i in po.Ingredients) { AppQ((Product)i, res); } } else { Drink d = pos as Drink; AppQ((Product)d.productInStorage, res); } } return(res); }