public static bool RemoveAlcohoBottleinBase(string types, AlcoholBottle bottle)//ударение по ключу и обЪукту { if (_alcoholBase.ContainsKey(types)) { return(_alcoholBase[types].Remove(bottle)); } else { return(false); } }
public static void AddRandomValue() { AlcoholBase.newAlcoholTypes("Beer"); AlcoholBase.newAlcoholTypes("Wine"); AlcoholBase.newAlcoholTypes("Vodka"); AlcoholBottle ab1 = new AlcoholBottle("Beer", "Guinness", "Diageo", 4.1, 35, 500, 10, 50); AlcoholBottle ab2 = new AlcoholBottle("Beer", "Murphy’s", "Murphy’s", 5.1, 35, 500, 50, 50); AlcoholBottle ab3 = new AlcoholBottle("Beer", "Newcastle Brown Ale", "Scottish & Newcastle", 4.7, 30, 500, 50, 40); AlcoholBottle aw1 = new AlcoholBottle("Wine", "Charton Bordeaux", "Bordeaux", 12, 83, 750, 30, 210); AlcoholBottle aw2 = new AlcoholBottle("Wine", "Chateau Prieure-Lichine", "Chateau Prieure-Lichine", 12.5, 83, 750, 30, 6200); AlcoholBottle aw3 = new AlcoholBottle("Wine", "Moet & Chandon Brut Imperial", "Moet", 12, 80, 750, 10, 1800); AlcoholBase.AddNewPosition(ab1); AlcoholBase.AddNewPosition(ab2); AlcoholBase.AddNewPosition(ab3); AlcoholBase.AddNewPosition(aw1); AlcoholBase.AddNewPosition(aw2); AlcoholBase.AddNewPosition(aw3); }
public static void AddNewPosition(AlcoholBottle alcoholBottle) { newAlcoholTypes(alcoholBottle.Types); if (!_alcoholBase[alcoholBottle.Types].Contains(alcoholBottle)) { _alcoholBase[alcoholBottle.Types].Add(alcoholBottle); } else { foreach (var alcBatle in _alcoholBase[alcoholBottle.Types]) { if (alcBatle.Equals(alcoholBottle)) { alcBatle.AddQuantityBottle(alcoholBottle.Quantity); alcBatle.NewPrise(alcoholBottle.Prise); } } } }
public static string GetItemStr(AlcoholBottle bottle) { return($"Имя:{bottle.Name} Производитель:{bottle.Manufacturer} Об.:{bottle.AbvPercent} Ккал:{bottle.KCal} Млл:{bottle.Volume} Кол-во:{bottle.Quantity} Цена:{bottle.Prise} Cтоимость:{bottle.PrisePosition}"); }