public Toy(string title, string manufacterer, string countryOfManufacturer, IMeasuredValue weight, IMeasuredValue price, ToyTypes type) : base(title, manufacterer, countryOfManufacturer, weight, price) { _Type = type; }
private void btnDone_Click(object sender, EventArgs e) { int selectedType = comboBox.SelectedIndex + 1; ToyTypes type = ToyTypesConverter.ToyTypesDict[selectedType]; byte age = (byte)UpDownAge.Value; double price = tbPrice.Text != "" ? double.Parse(tbPrice.Text) : 0; toy = new Toy(type, age, price); this.DialogResult = DialogResult.OK; this.Close(); }
private static Toy ToyFromString(string str) //string like "<type>, *<Age>*, *<Price>*" { string sType = str.Substring(0, str.IndexOf(',')).Trim(); ToyTypes type = (ToyTypes)Enum.Parse(typeof(ToyTypes), sType); string temp = str.Substring(str.IndexOf(','), str.LastIndexOf(',')).Trim(); string sAge = NumberFromString(temp); byte age = byte.Parse(sAge); temp = str.Substring(str.LastIndexOf(',')).Trim(); string sPrice = NumberFromString(temp); double price = double.Parse(sPrice); return(new Toy(type, age, price)); }
public void AddToyType() { repeate: Console.WriteLine("--->>Enter ToyType Details<<--"); Console.WriteLine("Enter ToyType Name: "); toyType.ToyTypeName = Console.ReadLine(); if (toyType.ToyTypeName != null) { ToyTypes.Add(toyType); SaveChanges(); } else { Console.WriteLine("Enter all requierd data"); goto repeate; } }
public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType) { BurgerType = burgerType; DrinkType = drinkType; ToyType = toyType; }
public decimal GetToyPrice(ToyTypes type) { return _toysPriceList[type]; }
public void GetToy_returns_burger_having_price_from_BurgerPriceList(ToyTypes type) { _operations.GetToy(type); _mockPriceList.Verify(x => x.GetToyPrice(type), Times.Once()); }
public void GetToy_returns_burger_having_specified_type(ToyTypes type) { var toy = (Toy)_operations.GetToy(type); Assert.AreEqual(type, toy.Type); }
public Toy(ToyTypes type, decimal price) : base(price) { Type = type; }
public void Change(ToyTypes type, byte age, double price) { this.Type = type; this.Age = age; this.Price = price; }
public decimal GetToyPrice(ToyTypes type) { return(_toysPriceList[type]); }
public List <ToyType> GetToyType() { return(ToyTypes.ToList()); }
public void DeleteToyType(ToyType toyType10) { ToyTypes.Remove(toyType10); SaveChanges(); Console.WriteLine("ToyTypeId " + toyType10.ToyTypeId + " Deleted"); }
public Toy(ToyTypes type, byte age, double price) { Type = type; Age = age; Price = price; }
public IMealItem GetToy(ToyTypes type) { // could be: go to the closet and take a toy ... return new Toy(type, PriceList.GetToyPrice(type)); }
public IMealItem GetToy(ToyTypes type) { // could be: go to the closet and take a toy ... return(new Toy(type, PriceList.GetToyPrice(type))); }