public SqlUpdateOrInsert ( bool increasecount ) : bool | ||
increasecount | bool | |
리턴 | bool |
// A quick item is clicked private void quickitem_Click(object sender, EventArgs e) { DisplayButton quickitembutton = (DisplayButton)sender; int index = GetIndexByName(quickitembutton.Text); if (index > -1) { items[index].count++; items[index].SqlUpdateOrInsert(false); } else { GroceriesItem newitem = new GroceriesItem(); newitem.name = quickitembutton.Text; newitem.count = 1; newitem.list = selectedlist; newitem.SqlUpdateOrInsert(true); items = General.Groceries.GetAllItems(selectedlist).ToArray(); } RefreshMainItems(); }
// A quick item is clicked private void quickitem_Click(object sender, EventArgs e) { DisplayButton quickitembutton = (DisplayButton)sender; int index = GetIndexByName(quickitembutton.Text); if(index > -1) { items[index].count++; items[index].SqlUpdateOrInsert(false); } else { GroceriesItem newitem = new GroceriesItem(); newitem.name = quickitembutton.Text; newitem.count = 1; newitem.list = selectedlist; newitem.SqlUpdateOrInsert(true); items = General.Groceries.GetAllItems(selectedlist).ToArray(); } RefreshMainItems(); }
// This adds or updates an item in the main list public void AddOrUpdateItem(GroceriesItem item, bool increasecount) { item.SqlUpdateOrInsert(increasecount); }
// This adds or updates an item in the main list public void AddOrUpdateItem(GroceriesItem item, bool increasecount) { item.SqlUpdateOrInsert(increasecount); }