Exemplo n.º 1
0
        public static string Grid <TGridModel>(this UrlHelper helper) where TGridModel : class
        {
            var controllerName = HelperUtil.GetControllerName <TGridModel>();

            return(Grid(helper,
                        controllerName));
        }
Exemplo n.º 2
0
        private static string Action <TModel>(UrlHelper helper,
                                              string actionName,
                                              TModel model,
                                              object routeValues) where TModel : class
        {
            var controllerName = HelperUtil.GetControllerName(model);

            return(helper.Action(actionName,
                                 controllerName,
                                 routeValues));
        }
Exemplo n.º 3
0
        public static MvcHtmlString GridLink <TGridModel>(this HtmlHelper helper,
                                                          string linkText,
                                                          object htmlAttributes = null) where TGridModel : class
        {
            var controllerName = HelperUtil.GetControllerName <TGridModel>();

            return(helper.ActionLink(linkText,
                                     ActionNames.Grid,
                                     controllerName,
                                     null,
                                     htmlAttributes));
        }
Exemplo n.º 4
0
        public static MvcForm BeginEditForm <TEditModel>(this HtmlHelper helper,
                                                         TEditModel editModel,
                                                         FormMethod method,
                                                         object htmlAttributes = null) where TEditModel : class
        {
            var routeValues    = ModelRouteValuesProvider.GetRouteValues(editModel);
            var controllerName = HelperUtil.GetControllerName(editModel);

            return(helper.BeginForm(ActionNames.Edit,
                                    controllerName,
                                    routeValues,
                                    method,
                                    htmlAttributes));
        }
Exemplo n.º 5
0
        private static MvcHtmlString ActionLink <TModel>(HtmlHelper helper,
                                                         string linkText,
                                                         string actionName,
                                                         TModel model,
                                                         object routeValues,
                                                         object htmlAttributes) where TModel : class
        {
            var controllerName = HelperUtil.GetControllerName(model);

            return(helper.ActionLink(linkText,
                                     actionName,
                                     controllerName,
                                     routeValues,
                                     htmlAttributes));
        }