public void OnCakeDownload() { foreach (var cake in _cakeManager.DownlodedCakeList.Cakes) { CakeList.Add(cake); } }
//POST => add cake public IHttpResponse AddCakePost(string name, decimal price) { CakeList.Add(new Cake(name, price)); File.WriteAllText("../../../Application/Resources/database.csv", CakeList.GetCakes()); return(new RedirectResponse($"/add")); }
public IHttpResponse AddPost(string name, double price) { name = name.Replace(",", string.Empty).Trim(); if (!string.IsNullOrEmpty(name) && !string.IsNullOrWhiteSpace(name)) { CakeList.Add(new Cake(name, price)); } return(new RedirectResponse($"/add")); }
public IHttpResponse AddCakePost(string name, string price) { if (!string.IsNullOrEmpty(name) || !string.IsNullOrEmpty(price)) { var castPriceToDecimal = decimal.Parse(price); var cake = new Cake(name, castPriceToDecimal); CakeList.Add(cake); } return(new RedirectResponse("/add")); }
public void AddCake(string name) { CakeList.Add(new SpecialCake(name)); }
public void AddCake(string flavour, int size, int layers) { //add custom cake to list CakeList.Add(new CustomCake(flavour, size, layers)); }