public void EditItemType(User u, Events event_, Boolean Important) { EventItemsHelper client = new EventItemsHelper(); //Insert server code here ItemTypes Item2Edit=ItemTypeCollection[lv.SelectedIndex]; ItemTypeCollection[lv.SelectedIndex].IsImportantType = Important; client.SetItemTypeImportance(u, Item2Edit, Important); client.Close(); }
public void DeleteItemType(User u, Events event_) { EventItemsHelper client = new EventItemsHelper(); //Insert server code here if (lv.SelectedIndex != -1) { ItemTypes type2delete = ItemTypeCollection[lv.SelectedIndex]; client.DeleteEventItemType(u, type2delete); ItemTypeCollection.RemoveAt(lv.SelectedIndex); } client.Close(); }
public void AddNewItemType(User u, Events event_, String ItemType, Boolean Important) { EventItemsHelper client = new EventItemsHelper(); try { ItemTypes type = client.AddEventItemType(u, event_.EventID, ItemType, Important); ItemTypeCollection.Add(type); } catch (Exception ex) { MessageBox.Show("Error have occured: " + ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } finally { client.Close(); } }
public void ToggleItemTypeImpt(User u, Events event_) { if (lv.SelectedIndex==-1) { MessageBox.Show("Please Select an Item Type to toggle!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); return; } EventItemsHelper client = new EventItemsHelper(); //Insert server code here ItemTypes Item2Edit = ItemTypeCollection[lv.SelectedIndex]; bool Important=!Item2Edit.IsImportantType; ItemTypeCollection[lv.SelectedIndex].IsImportantType = Important; client.SetItemTypeImportance(u, Item2Edit, Important); client.Close(); }