Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
 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();
     }
 }
Пример #4
0
        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();
        }