private void btnAddItemType_Click(object sender, RoutedEventArgs e) { String itemType2Add = ""; if (radItemType.IsChecked == true) { if (cboItemType.SelectedIndex == -1) { MessageBox.Show("Please Select an Item Type!"); } itemType2Add = cboItemType.SelectedItem.ToString(); } else { //Save to item type repository here itemType2Add = txtOthers.Text.ToString().Trim().ToUpper(); EventItemsHelper client = new EventItemsHelper(); client.AddItemsTypes(itemType2Add); client.Close(); refreshItemTypes(); } lvItemType.AddNewItemType(user, event_, itemType2Add, chkNecessary.IsChecked.Value); rebindcboItemType4Item(); clearItemTypeInput(); }
private void refreshItemTypes() { EventItemsHelper client = new EventItemsHelper(); cboItemType.ItemsSource = client.GetItemsTypes(); client.Close(); }
private void clearItemInput() { txtItemName.Text = ""; txtItemPrice.Text = ""; txtItemSatisfaction.Text = ""; cboItemTypeIL.SelectedIndex = -1; EventItemsHelper client = new EventItemsHelper(); List<Items> ItemList = client.GetItemsByEvent(event_.EventID).ToList<Items>(); lvItem.SetExistingSource(ItemList); client.Close(); }
private void ExistingLoad() { EventItemsHelper client = new EventItemsHelper(); List<ItemTypes> TypeList = client.GetEventSpecificItemType(event_.EventID).ToList<ItemTypes>(); List<Items> ItemList = client.GetItemsByEvent(event_.EventID).ToList<Items>(); client.Close(); if (TypeList.Count > 0) lvItemType.SetExistingSource(TypeList); if (ItemList.Count > 0) lvItem.SetExistingSource(ItemList); rebindcboItemType4Item(); }
private void btnDeleteItemType_Click(object sender, RoutedEventArgs e) { lvItemType.DeleteItemType(user, event_); rebindcboItemType4Item(); EventItemsHelper client = new EventItemsHelper(); List<Items> ItemList = client.GetItemsByEvent(event_.EventID).ToList<Items>(); lvItem.SetExistingSource(ItemList); client.Close(); }