private void btnDelete_Click(object sender, EventArgs e) { if (tillSettingsId != null) { CurrencyItemModel cim = new CurrencyItemModel(); dynamic currency_item = cim.find(cim, tillSettingsId); currency_item.delete(currency_item); MessageDialog.ShowAlert("Currency Item Deleted"); resetTillSettings(); loadTillSettings(); } else { MessageDialog.ShowAlert("Unable to delete, Please select item to delete", "Alert Message", "error"); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (itemName.Text != "" && itemValue.Text != "") { CurrencyItemModel cim = new CurrencyItemModel(); dynamic currency_item = cim.find(cim, tillSettingsId); currency_item.name = itemName.Text; currency_item.value = Convert.ToDouble(itemValue.Text); currency_item.save(currency_item); MessageDialog.ShowAlert("Currency Item Updated"); resetTillSettings(); loadTillSettings(); } else { MessageDialog.ShowAlert("Please enter correct value", "Alert Message", "error"); } }