private TransactionSearchValue GetSearchValue() { TransactionSearchValue searchValue = new TransactionSearchValue(); decimal?fromAmountRange = null; if (!String.IsNullOrEmpty(txtFromAmount.Text)) { fromAmountRange = Decimal.Parse(txtFromAmount.Text); } decimal?toAmountRange = null; if (!String.IsNullOrEmpty(txtToAmount.Text)) { toAmountRange = Decimal.Parse(txtToAmount.Text); } searchValue.AmountRange = new RangeValue <decimal?>(fromAmountRange, toAmountRange); if (ddlCreditCardType.SelectedValue != "-1") { searchValue.CreditCardType = definedValueService.Get(int.Parse(ddlCreditCardType.SelectedValue)); } if (ddlCurrencyType.SelectedValue != "-1") { searchValue.CurrencyType = definedValueService.Get(int.Parse(ddlCurrencyType.SelectedValue)); } DateTime?fromTransactionDate = null; if (!String.IsNullOrEmpty(txtFromDate.Text)) { fromTransactionDate = DateTime.Parse(txtFromDate.Text); } DateTime?toTransactionDate = null; if (!String.IsNullOrEmpty(txtToDate.Text)) { toTransactionDate = DateTime.Parse(txtToDate.Text); } searchValue.DateRange = new RangeValue <DateTime?>(fromTransactionDate, toTransactionDate); if (ddlFundType.SelectedValue != "-1") { searchValue.Fund = fundService.Get(int.Parse(ddlFundType.SelectedValue)); } searchValue.TransactionCode = txtTransactionCode.Text; searchValue.SourceType = definedValueService.Get(int.Parse(ddlSourceType.SelectedValue)); return(searchValue); }
/// <summary> /// Handles the filter display for each saved user value /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> /// <exception cref="System.NotImplementedException"></exception> protected void rFilter_DisplayFilterValue(object sender, Rock.Web.UI.Controls.GridFilter.DisplayFilterValueArgs e) { switch (e.Key) { case "Fund": int fundId = 0; if (int.TryParse(e.Value, out fundId)) { var service = new FundService(); var fund = service.Get(fundId); if (fund != null) { e.Value = fund.Name; } } break; case "Currency Type": case "Credit Card Type": case "Source": int definedValueId = 0; if (int.TryParse(e.Value, out definedValueId)) { var definedValue = DefinedValueCache.Read(definedValueId); if (definedValue != null) { e.Value = definedValue.Name; } } break; } }
/// <summary> /// Handles the filter display for each saved user value /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> /// <exception cref="System.NotImplementedException"></exception> protected void rFilter_DisplayFilterValue( object sender, Rock.Web.UI.Controls.GridFilter.DisplayFilterValueArgs e ) { switch ( e.Key ) { case "Fund": int fundId = 0; if ( int.TryParse( e.Value, out fundId ) ) { var service = new FundService(); var fund = service.Get( fundId ); if ( fund != null ) { e.Value = fund.Name; } } break; case "Currency Type": case "Credit Card Type": case "Source": int definedValueId = 0; if ( int.TryParse( e.Value, out definedValueId ) ) { var definedValue = DefinedValueCache.Read( definedValueId ); if ( definedValue != null ) { e.Value = definedValue.Name; } } break; } }