private void ButtonOrder_Click(object sender, RoutedEventArgs e) { try { var client = GetWebClient(SERVICE_URL); foreach (UnitEntryDisplay item in ListOfEntires.Items) { if (item.Selected == true) { var orderPopUp = new OrderPopUp(); orderPopUp.ShowDialog(); var count = orderPopUp.Count; client.Order.Order(item.GetUnitEntry(), Int32.Parse(count)); } } RefreshListOfEntires(); } catch { var errorPopUp = new ErrorPopUp(); errorPopUp.ShowDialog(); } }
private void ButtonRefresh_Click(object sender, RoutedEventArgs e) { try { RefreshListOfEntires(); } catch { var errorPopUp = new ErrorPopUp(); errorPopUp.ShowDialog(); } }
private void ButtonAdd_Click(object sender, RoutedEventArgs e) { try { var client = GetWebClient(SERVICE_URL); var addPopUp = new Add(); addPopUp.ShowDialog(); client.Unit.AddMagazineProduct(addPopUp.Name, addPopUp.Count, addPopUp.Price); RefreshListOfEntires(); } catch { var errorPopUp = new ErrorPopUp(); errorPopUp.ShowDialog(); } }
private void RefreshListOfEntires() { try { var client = GetWebClient(SERVICE_URL); var list = client.Unit.GetAllProducts(); ListOfEntires.Items.Clear(); foreach (var item in list) { ListOfEntires.Items.Add(new UnitEntryDisplay(item)); } } catch { var errorPopUp = new ErrorPopUp(); errorPopUp.ShowDialog(); } }
private void ButtonDelete_Click(object sender, RoutedEventArgs e) { try { var client = GetWebClient(SERVICE_URL); foreach (UnitEntryDisplay item in ListOfEntires.Items) { if (item.Selected == true) { client.Unit.RemoveMagazineProduct(item.Id.Value); } } RefreshListOfEntires(); } catch { var errorPopUp = new ErrorPopUp(); errorPopUp.ShowDialog(); } }