public GridExcelActionCommandBuilder <T> ExportToPdf <TController>(Expression <Action <TController> > actionResult) where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridExcelActionCommand <T>(Context, GridClass.PdfExport, GridParameters.ExportToPdf, routeValues, null);

            ToolBar.Commands.Add(command);
            return(new GridExcelActionCommandBuilder <T>(command));
        }
        public GridCreateActionCommandBuilder <T> Create <TController>(Expression <Action <TController> > actionResult) where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridCreateActionCommand <T>(Context, GridClass.IconAdd, GridParameters.Create, routeValues, null);

            ToolBar.Commands.Add(command);
            return(new GridCreateActionCommandBuilder <T>(command));
        }
        public GridActionCommandBuilder <T> ConfirmDelete <TController>(Expression <Action <TController> > actionResult) where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridActionCommand <T>(Context, GridClass.DeleteIcon, GridParameters.Delete, routeValues, new { @class = GridClass.ConfirmDelete });

            Column.Commands.Add(command);
            return(new GridActionCommandBuilder <T>(command));
        }
        public GridActionCommandBuilder <T> Custom <TController>(Expression <Action <TController> > actionResult, string cssClass, string altText) where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridActionCommand <T>(Context, cssClass, altText, routeValues, null);

            Column.Commands.Add(command);
            return(new GridActionCommandBuilder <T>(command));
        }
        public GridActionCommandBuilder <T> CheckGeo <TController>(Expression <Action <TController> > actionResult, Func <T, bool> hasValueFunc) where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridCheckGeoActionCommand <T>(Context, GridClass.GeoIcon, GridParameters.Geo, routeValues, null, hasValueFunc);

            Column.Commands.Add(command);
            return(new GridActionCommandBuilder <T>(command));
        }
        public GridActionCommandBuilder <T> Detail <TController>(Expression <Action <TController> > actionResult, string alternateText = null) where TController : Controller
        {
            var alt         = alternateText ?? GridParameters.Details;
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridActionCommand <T>(Context, GridClass.DetailIcon, alt, routeValues, null);

            Column.Commands.Add(command);
            return(new GridActionCommandBuilder <T>(command));
        }
Beispiel #7
0
        public GridBoundColumnBuilder <T> CheckEditFor <TController>(string name, Func <T, bool> checkValueFunc, Expression <Action <TController> > actionResult)
            where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var command     = new GridCheckEditActionCommand <T>(GridModel.Context, GridClass.EditIcon, GridParameters.Edit, routeValues, null, m => true, checkValueFunc);
            var column      = new GridCheckEditColumn <T, bool>(GridModel, command, name, checkValueFunc);

            GridModel.ColumnList.Add(column);
            return(new GridBoundColumnBuilder <T>(column));
        }
Beispiel #8
0
        public GridBoundColumnBuilder <T> ActionLinkFor <TController, TValue>(string name, Func <T, TValue> func, Expression <Action <TController> > actionResult)
            where TController : Controller
        {
            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(actionResult);
            var column      = new GridActionLinkColumn <T, TValue>(GridModel, name, func);

            column.Command = new GridActionLinkCommand <T>(GridModel.Context, routeValues);
            GridModel.ColumnList.Add(column);
            return(new GridBoundColumnBuilder <T>(column));
        }
Beispiel #9
0
        public GridBoundColumnBuilder <T> EditionStateWithTooltip <TController>(Expression <Action <TController> > toolTipResult)
            where TController : Controller
        {
            Requires <ArgumentException> .IsTrue(typeof(ITrackEdition).IsAssignableFrom(typeof(T)), string.Format("{0} should Implement {1}", typeof(T).Name, typeof(ITrackEdition).Name));

            var routeValues = MvcExpressionHelper.GetRouteValuesFromExpression(toolTipResult);
            var column      = new GridStatusColumn <T>(GridModel, routeValues);

            GridModel.ColumnList.Add(column);
            return(new GridBoundColumnBuilder <T>(column));
        }