private void btnAddUpdateDotation_Click(object sender, System.Windows.RoutedEventArgs e) { string dotationAmountText = txtDotationAmount.Text.Trim(); decimal dotationAmount; if (AreValidFields(dotationAmountText, out dotationAmount) == false) { return; } if (_isUpdateDotation) { _dotationToUpdate.DotationDate = DateTime.Now; _dotationToUpdate.Amount = dotationAmount; UpdateDotation(_dotationToUpdate); } else { Model.Dotation dotationToAdd = new Model.Dotation() { DotationDate = DateTime.Now, Amount = dotationAmount, UserId = null, SignedDate = null }; AddDotation(dotationToAdd); } }
public ViewDotationModal(Model.Dotation dotationToView) { this.InitializeComponent(); _dotationToView = dotationToView; LoadDotationInfo(); }
public AddEditDotationsModal(Model.Dotation dotationToUpdate) { this.InitializeComponent(); _dotationToUpdate = dotationToUpdate; _isUpdateDotation = dotationToUpdate != null; if (_isUpdateDotation) { PrepareWindowForUpdates(); } }