public static bool addProduct(string shoeName, string price, string stock, string shoeImage) { if (shoeName != "" && checkPrice(price) && checkStock(stock)) { int shoePrice = Int32.Parse(price); int shoeStock = Int32.Parse(stock); ShoeTable newShoe = ShoeFactory.createShoe(shoeName, shoePrice, shoeStock, shoeImage); ShoeRepository.insertShoe(newShoe); return true; } else { //Label_Error.Text = "Please Check the Data!"; return false; } }
static void Main(string[] args) { var shoeFactory = new ShoeFactory(); IShoe boot = shoeFactory.ProduceShoe(ShoeType.Boot); boot.TypeInfo(); IShoe sneaker = shoeFactory.ProduceShoe(ShoeType.Sneaker); sneaker.TypeInfo(); IShoe spikes = shoeFactory.ProduceShoe(ShoeType.Spikes); spikes.TypeInfo(); }
public ShoeController() { shoeFactory = new ShoeFactory(); }