本文整理汇总了C#中Rock.Web.UI.Controls.GridFilter类的典型用法代码示例。如果您正苦于以下问题:C# GridFilter类的具体用法?C# GridFilter怎么用?C# GridFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridFilter类属于Rock.Web.UI.Controls命名空间,在下文中一共展示了GridFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gfSettings_DisplayFilterValue
/// <summary>
/// Gfs the settings_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void gfSettings_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
if ( e.Key != "Include Inactive" )
{
e.Value = string.Empty;
}
}
开发者ID:Higherbound,项目名称:Higherbound-2016-website-upgrades,代码行数:12,代码来源:ScheduledTransactionList.ascx.cs
示例2: gfPledges_DisplayFilterValue
/// <summary>
/// Gfs the pledges_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
/// <exception cref="System.NotImplementedException"></exception>
protected void gfPledges_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
case "Person":
int? personId = e.Value.AsIntegerOrNull();
if ( personId != null )
{
var person = new PersonService( new RockContext() ).Get( personId.Value );
if ( person != null )
{
e.Value = person.ToString();
}
else
{
e.Value = string.Empty;
}
}
else
{
e.Value = string.Empty;
}
break;
case "Accounts":
var accountIdList = e.Value.Split( ',' ).AsIntegerList();
if ( accountIdList.Any() )
{
var service = new FinancialAccountService( new RockContext() );
var accounts = service.GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
e.Value = accounts.Select( a => a.Name ).ToList().AsDelimited( "," );
}
else
{
e.Value = string.Empty;
}
}
else
{
e.Value = string.Empty;
}
break;
default:
e.Value = string.Empty;
break;
}
}
示例3: fRequest_DisplayFilterValue
/// <summary>
/// Displays the text of the current filters
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void fRequest_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Request Date Range":
case "Response Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
}
}
示例4: fDevice_DisplayFilterValue
/// <summary>
/// Displays the text of the current filters
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void fDevice_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Printer":
int deviceId = 0;
if ( int.TryParse( e.Value, out deviceId ) )
{
var service = new DeviceService( new RockContext() );
var device = service.Get( deviceId );
if ( device != null )
{
e.Value = device.Name;
}
}
break;
case "Device Type":
int definedValueId = 0;
if ( int.TryParse( e.Value, out definedValueId ) )
{
var definedValue = DefinedValueCache.Read( definedValueId );
if ( definedValue != null )
{
e.Value = definedValue.Value;
}
}
break;
case "Print To":
e.Value = ( (PrintTo)System.Enum.Parse( typeof( PrintTo ), e.Value ) ).ToString();
break;
case "Print From":
e.Value = ( (PrintFrom)System.Enum.Parse( typeof( PrintFrom ), e.Value ) ).ToString();
break;
}
}
示例5: gfFilter_DisplayFilterValue
/// <summary>
/// Handles displaying the stored filter values.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e as DisplayFilterValueArgs (hint: e.Key and e.Value).</param>
protected void gfFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
// don't display dead setting
case "From Date":
e.Value = string.Empty;
break;
// don't display dead setting
case "To Date":
e.Value = string.Empty;
break;
case "Prayer Category":
int categoryId = e.Value.AsIntegerOrNull() ?? All.Id;
if ( categoryId == All.Id )
{
e.Value = "All";
}
else
{
var category = Rock.Web.Cache.CategoryCache.Read( categoryId );
if ( category != null )
{
e.Value = category.Name;
}
}
break;
}
}
示例6: rFilter_DisplayFilterValue
/// <summary>
/// Rs the filter_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void rFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "EntityType":
if ( e.Value != "" )
{
if ( e.Value == "0" )
{
e.Value = "None (Global Attributes)";
}
else
{
e.Value = EntityTypeCache.Read( int.Parse( e.Value ) ).FriendlyName;
}
}
break;
}
}
示例7: gfFilter_DisplayFilterValue
/// <summary>
/// Handles displaying the stored filter values.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e as DisplayFilterValueArgs (hint: e.Key and e.Value).</param>
protected void gfFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
// don't display dead setting
case "From Date":
e.Value = string.Empty;
break;
// don't display dead setting
case "To Date":
e.Value = string.Empty;
break;
}
}
示例8: fExceptionList_DisplayFilterValue
/// <summary>
/// Build filter values/summary with user friendly data from filters
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void fExceptionList_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Site":
int siteId;
if ( int.TryParse( e.Value, out siteId ) )
{
var site = SiteCache.Read( siteId );
if ( site != null )
{
e.Value = site.Name;
}
}
break;
case "Page":
int pageId;
if ( int.TryParse( e.Value, out pageId ) )
{
var page = PageCache.Read( pageId );
if ( page != null )
{
e.Value = page.InternalName;
}
}
break;
case "User":
int userPersonId;
if ( int.TryParse( e.Value, out userPersonId ) )
{
PersonService personService = new PersonService( new RockContext() );
var user = personService.Get( userPersonId );
if ( user != null )
{
e.Value = user.FullName;
}
}
break;
// ignore old filter parameters
case "Start Date":
case "End Date":
e.Value = null;
break;
case "Date Range":
e.Value = SlidingDateRangePicker.FormatDelimitedValues( e.Value );
break;
}
}
示例9: gfFilter_DisplayFilterValue
/// <summary>
/// Gfs the filter_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void gfFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
if ( AvailableAttributes != null && SelectedChannelId.HasValue )
{
var attribute = AvailableAttributes.FirstOrDefault( a => MakeKeyUniqueToChannel( SelectedChannelId.Value, a.Key ) == e.Key );
if ( attribute != null )
{
try
{
var values = JsonConvert.DeserializeObject<List<string>>( e.Value );
e.Value = attribute.FieldType.Field.FormatFilterValues( attribute.QualifierValues, values );
return;
}
catch
{
// intentionally ignore
}
}
}
if ( e.Key == "Date Range" )
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
}
else if ( e.Key == "Status" )
{
var status = e.Value.ConvertToEnumOrNull<ContentChannelItemStatus>();
if ( status.HasValue )
{
{
e.Value = status.ConvertToString();
}
}
}
else if ( e.Key == "Title" )
{
return;
}
else
{
e.Value = string.Empty;
}
}
示例10: gfMetricValues_DisplayFilterValue
/// <summary>
/// Gfs the metric values_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void gfMetricValues_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
if ( e.Key == "Date Range" )
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
}
else if ( e.Key == "Goal/Measure" )
{
var metricValueType = e.Value.ConvertToEnumOrNull<MetricValueType>();
if ( metricValueType.HasValue )
{
e.Value = metricValueType.Value.ConvertToString();
}
else
{
e.Value = null;
}
}
else if ( e.Key == EntityPreferenceKey )
{
e.Key = hfEntityTypeName.Value;
var parts = e.Value.Split( '|' );
if ( parts.Length >= 2 )
{
e.Value = GetSeriesName( parts[1].AsIntegerOrNull() );
}
}
else
{
e.Value = null;
}
}
示例11: DisplayFilterValue
/// <summary>
/// Displays the text of the current filters
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
DateTime startDateTimeValue;
DateTime endDateTimeValue;
if ( DateRangePicker.TryParse( e.Value, out startDateTimeValue, out endDateTimeValue ) )
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
}
}
示例12: rFilter_DisplayFilterValue
/// <summary>
/// Rs the filter_ display filter 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, GridFilter.DisplayFilterValueArgs e )
{
var rockContext = new RockContext();
switch ( e.Key )
{
case "Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
case "Person":
int? personId = e.Value.AsIntegerOrNull();
e.Value = null;
if ( personId.HasValue )
{
var person = new PersonService( rockContext ).Get( personId.Value );
if ( person != null )
{
e.Value = person.ToString();
}
}
break;
case "Group":
int? groupId = e.Value.AsIntegerOrNull();
e.Value = null;
if ( groupId.HasValue )
{
var group = new GroupService( rockContext ).Get( groupId.Value );
if ( group != null )
{
e.Value = group.ToString();
}
}
break;
case "Schedule":
int? scheduleId = e.Value.AsIntegerOrNull();
e.Value = null;
if ( scheduleId.HasValue )
{
var schedule = new ScheduleService( rockContext ).Get( scheduleId.Value );
if ( schedule != null )
{
e.Value = schedule.Name;
}
}
break;
case "Attended":
if ( e.Value == "1" )
{
e.Value = "Did Attend";
}
else if ( e.Value == "0" )
{
e.Value = "Did Not Attend";
}
else
{
e.Value = null;
}
break;
default:
e.Value = null;
break;
}
}
示例13: gfSettings_DisplayFilterValue
void gfSettings_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Authentication Provider":
{
var entityType = EntityTypeCache.Read( compProvider.SelectedValue.AsGuid() );
if ( entityType != null )
{
e.Value = entityType.FriendlyName;
}
break;
}
case "Created":
case "Last Login":
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
}
case "Is Confirmed":
case "Is Locked Out":
{
bool value = false;
if ( bool.TryParse( e.Value, out value ) )
{
e.Value = value ? "Yes" : "No";
}
break;
}
}
}
示例14: rFilter_DisplayFilterValue
/// <summary>
/// Rs the filter_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void rFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
if ( e.Key == MakeKeyUniqueToGroup( "Date Range" ) )
{
// show the date range pickers current value, instead of the user preference since we set it to a default value if blank
e.Value = DateRangePicker.FormatDelimitedValues( drpDates.DelimitedValues );
}
else if ( e.Key == MakeKeyUniqueToGroup( "Schedule" ) )
{
int scheduleId = e.Value.AsInteger();
if ( scheduleId != 0 )
{
var schedule = new ScheduleService( _rockContext ).Get( scheduleId );
e.Value = schedule != null ? schedule.Name : string.Empty;
}
else
{
e.Value = string.Empty;
}
}
else if ( e.Key == MakeKeyUniqueToGroup( "Location" ) )
{
string locId = e.Value;
if ( locId.StartsWith( "P" ) )
{
locId = locId.Substring( 1 );
}
int locationId = locId.AsInteger();
e.Value = new LocationService( _rockContext ).GetPath( locationId );
}
else
{
e.Value = string.Empty;
}
}
示例15: rAccountFilter_DisplayFilterValue
/// <summary>
/// Handles the filter display
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
protected void rAccountFilter_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Campus":
int? campusId = e.Value.AsIntegerOrNull();
if ( campusId.HasValue )
{
var campus = CampusCache.Read( campusId.Value );
if ( campus != null )
{
e.Value = campus.Name;
}
}
break;
}
}