static void Main(string[] args) { ShopServiceClient client = new ShopServiceClient(); bool isOn = true; while (isOn) { Console.WriteLine("Welcome to The Shop. Here are our products:"); foreach (var item in client.GetProducts()) { Console.WriteLine(item.Id + ". " + item.Name); } Console.WriteLine("Press A to add, R to remove and U to update product."); switch (Console.ReadKey(true).Key) { case ConsoleKey.A: AddNewProduct(client); break; case ConsoleKey.R: RemoveProduct(client); break; case ConsoleKey.U: UpdateProduct(client); break; default: isOn = false; break; } } }
public WarehouseGUI() { InitializeComponent(); proxyShop = new ShopServiceClient(new InstanceContext(this)); proxyShop.SetClientBaseAddress(); proxyWH = new WarehouseServiceClient(); }
private static void RemoveProduct(ShopServiceClient client) { Console.WriteLine("Write id number of id to remove product"); int removeProduct = int.Parse(Console.ReadLine()); client.RemoveProduct(removeProduct); Console.WriteLine("product removed."); Console.Clear(); }
public ProductsPage() { ShopServiceClient shopProxy = new ShopServiceClient(); InitializeComponent(); productBox.ItemsSource = ssc.GetAllProducts(); ; moneyLeft.Content = "Money left: €"; //+ ; }
public MainForm() { InitializeComponent(); serviceClient = new ShopServiceClient(); dicItems = new Dictionary <string, Item>(); wb.DocumentText = Resources.BasketIsEmpty; wb.IsWebBrowserContextMenuEnabled = false; lblTotalAmount.Text = 0.ToString(".00"); }
private static void AddNewProduct(ShopServiceClient client) { Console.WriteLine("Write name of new product:"); string newProduct = Console.ReadLine(); client.AddProduct(new Product { Name = newProduct }); Console.WriteLine("New product created."); Console.Clear(); }
private static void UpdateProduct(ShopServiceClient client) { Console.WriteLine("Write id number of id to remove product"); int updatedId = int.Parse(Console.ReadLine()); Console.WriteLine("Write new name of product"); var updatedProduct = Console.ReadLine(); client.UpdateProduct(new Product { Id = updatedId, Name = updatedProduct }); Console.Clear(); }
public ShopGUI() { InitializeComponent(); proxy = new ShopServiceClient(new InstanceContext(this)); proxy.SetClientBaseAddress(); proxy.Subscribe(); orders = proxy.getOrders(); Orders.Items.Clear(); foreach (Order order in orders) { Orders.Items.Add(order.id + " " + Enum.GetName(typeof(Title), order.title) + " " + order.quant); } Dictionary <Title, int> stocks = proxy.getStocks(); Stock.Items.Clear(); foreach (Title t in stocks.Keys) { Stock.Items.Add(Enum.GetName(typeof(Title), t) + " " + stocks[t]); } }
static void Main(string[] args) { ShopServiceClient shopProxy = new ShopServiceClient(); Console.WriteLine("All Products\n"); foreach (Product p in shopProxy.GetAllProducts()) { Console.WriteLine(p.Name); } //Console.WriteLine("Please enter your name: "); //string name = Console.ReadLine(); //while (true) //{ // Console.WriteLine("Type a note (or hit enter to quit): "); // string note = Console.ReadLine(); // if (string.IsNullOrEmpty(note)) // { // break; // } // shopProxy.PostNote(name, note); //} }
public Printer() { proxy = new ShopServiceClient(new InstanceContext(this)); proxy.SetClientBaseAddress(); proxy.Subscribe(); }
public LoginWindow() { ShopServiceClient shopProxy = new ShopServiceClient(); InitializeComponent(); }