private void btn_spendingaccount_save_Click(object sender, EventArgs e) { var account = new Four51WebSpendingAccount(txt_sharedsecret.Text, txt_serviceid.Text) { InteropID = txt_spendingaccount_interopid.Text, Name = txt_spendingaccount_name.Text, Label = txt_spendingaccount_label.Text, SpendingAccountTypeName = txt_spendingaccount_type.Text, CompanyInteropID = txt_spendingaccount_companyid.Text, GroupInteropID = txt_spendingaccount_groupid.Text, UserInteropID = txt_spendingaccount_userid.Text, Balance = txt_spendingaccount_balance.Text.To <decimal>(), StartDate = date_spendingaccount_start.Value, ExpirationDate = date_spendingaccount_expiration.Value }; try { account.Save(); MessageBox.Show("Saved Spending Account: " + account.InteropID); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_spendingaccount_delete_Click(object sender, EventArgs e) { var account = new Four51WebSpendingAccount(txt_sharedsecret.Text, txt_serviceid.Text) { InteropID = txt_spendingaccount_interopid.Text }; try { account.Delete(); MessageBox.Show("Deleted Spending Account: " + account.InteropID); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_spendingaccount_update_Click(object sender, EventArgs e) { var acct = new Four51WebSpendingAccount(txt_sharedsecret.Text, txt_serviceid.Text) { InteropID = txt_spendingaccount_interopid.Text, Value = txt_spendingaccount_balance.Text.To <decimal>() }; try { acct.AddToBalance(); MessageBox.Show("Added to spending account balance: " + acct.InteropID); } catch (Exception ex) { MessageBox.Show(ex.Message); } }