/// <summary> /// Handles the SaveClick event of the mdAccount control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void mdAccount_SaveClick(object sender, EventArgs e) { Guid?guid = hfAccountGuid.Value.AsGuidOrNull(); if (guid.HasValue) { var txnDetail = TransactionDetailsState.Where(t => t.Guid.Equals(guid.Value)).FirstOrDefault(); if (txnDetail == null) { txnDetail = new FinancialScheduledTransactionDetail(); TransactionDetailsState.Add(txnDetail); } txnDetail.AccountId = apAccount.SelectedValue.AsInteger(); txnDetail.Amount = tbAccountAmount.Text.AsDecimal(); txnDetail.Summary = tbAccountSummary.Text; txnDetail.LoadAttributes(); Rock.Attribute.Helper.GetEditValues(phAccountAttributeEdits, txnDetail); foreach (var attributeValue in txnDetail.AttributeValues) { txnDetail.SetAttributeValue(attributeValue.Key, attributeValue.Value.Value); } BindAccounts(); } HideDialog(); }
/// <summary> /// Handles the SaveClick event of the mdAccount control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void mdAccount_SaveClick(object sender, EventArgs e) { Guid?guid = hfAccountGuid.Value.AsGuidOrNull(); if (guid.HasValue) { var financialTransactionDetail = TransactionDetailsState.Where(t => t.Guid.Equals(guid.Value)).FirstOrDefault(); if (financialTransactionDetail == null) { financialTransactionDetail = new FinancialScheduledTransactionDetail(); TransactionDetailsState.Add(financialTransactionDetail); } financialTransactionDetail.AccountId = apAccount.SelectedValue.AsInteger(); var feeCoverageAmount = tbAccountFeeCoverageAmount.Value; financialTransactionDetail.Amount = (tbAccountAmountMinusFeeCoverageAmount.Value ?? 0.0M) + (feeCoverageAmount ?? 0.00M); financialTransactionDetail.FeeCoverageAmount = feeCoverageAmount; financialTransactionDetail.Summary = tbAccountSummary.Text; financialTransactionDetail.LoadAttributes(); Rock.Attribute.Helper.GetEditValues(phAccountAttributeEdits, financialTransactionDetail); foreach (var attributeValue in financialTransactionDetail.AttributeValues) { financialTransactionDetail.SetAttributeValue(attributeValue.Key, attributeValue.Value.Value); } BindAccounts(); } HideDialog(); }
/// <summary> /// Handles the SaveClick event of the mdAccount control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void mdAccount_SaveClick(object sender, EventArgs e) { Guid?guid = hfAccountGuid.Value.AsGuidOrNull(); if (guid.HasValue) { var txnDetail = TransactionDetailsState.Where(t => t.Guid.Equals(guid.Value)).FirstOrDefault(); if (txnDetail == null) { txnDetail = new FinancialTransactionDetail(); TransactionDetailsState.Add(txnDetail); } txnDetail.AccountId = ddlAccount.SelectedValue.AsInteger(); txnDetail.Amount = tbAccountAmount.Text.AsDecimal(); txnDetail.Summary = tbAccountSummary.Text; BindAccounts(); } HideDialog(); }