public JsonNetResult AlertsCount() { var entity = Lite.Parse <Entity>(Request["key"]); return(this.JsonNet(new { Alerted = AlertWidgetHelper.CountAlerts(entity, "Alerted"), Future = AlertWidgetHelper.CountAlerts(entity, "Future"), Attended = AlertWidgetHelper.CountAlerts(entity, "Attended"), })); }
public static IWidget WidgetsHelper_GetWidget(WidgetContext ctx) { Entity ie = ctx.Entity as Entity; if (ie == null || ie.IsNew) { return(null); } if (!Types.Contains(ie.GetType())) { return(null); } if (!Finder.IsFindable(typeof(AlertEntity))) { return(null); } return(AlertWidgetHelper.CreateWidget(ctx)); }