Esempio n. 1
0
        private void AddItem_Click(object sender, RoutedEventArgs e)
        {
            listItems.Add((Item)cBoxItems.SelectionBoxItem);
            ItemTies newTie = new ItemTies();

            newTie.IDCategory = listCategories[listViewCategories.SelectedIndex].ID;
            newTie.IDItem     = ((Item)cBoxItems.SelectionBoxItem).ID;
            database.SaveItemTiesAsync(newTie);
        }
Esempio n. 2
0
 public Task <int> SaveItemTiesAsync(ItemTies category)
 {
     if (category.ID != 0)
     {
         return(database.UpdateAsync(category));
     }
     else
     {
         return(database.InsertAsync(category));
     }
 }