Esempio n. 1
0
        public override IHtmlString RenderItemColumn(ViewContext viewContext)
        {
            WebEventModel webEventModel = (WebEventModel)this.DataItem;

            string editLinkUrl = viewContext.UrlHelper()
                .Action("Details", viewContext.RequestContext.AllRouteValues()
                    .Merge("fullname", webEventModel.FullName)
                    .Merge("returnUrl", viewContext.HttpContext.Request.RawUrl));

            string editLinkText = webEventModel.FileName;

            return new HtmlString(String.Format("<a href='{0}'><img class='icon' src='{2}'/> {1}</a>", editLinkUrl, editLinkText, UrlUtility.ResolveUrl("~/Images/invis.gif")));
        }
Esempio n. 2
0
        public override IHtmlString RenderItemColumn(ViewContext viewContext)
        {
            if (DataItem is IIdentifiable)
            {
                var data = (IIdentifiable)DataItem;

                var linkText = "Report".Localize();
                if (!string.IsNullOrEmpty(this.GridColumn.PropertyName))
                {
                    linkText = this.PropertyValue == null ? "" : PropertyValue.ToString();
                }
                var url = viewContext.UrlHelper().Action("HitReport"
                    , viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID).Merge("return", viewContext.HttpContext.Request.RawUrl));

                return new HtmlString(string.Format("<a href='{0}'><img class='icon {2}' src='{3}'/> {1}</a>", url, linkText,
                    "", Kooboo.Web.Url.UrlUtility.ResolveUrl("~/Images/invis.gif")));
            }

            return new HtmlString("");
        }
Esempio n. 3
0
        public override IHtmlString RenderItemColumn(ViewContext viewContext)
        {
            if (PropertyValue == null)
            {
                return MvcHtmlString.Empty;
            }

            var columnAttr = GridColumn.ColumnAttribute as LinkColumnAttribute;
            if (columnAttr == null)
            {
                return MvcHtmlString.Empty;
            }

            var idProperty = GridColumn.GridModel.IdPorperty ?? "Id";
            var extraRouteValues = viewContext.RequestContext.AllRouteValues().Merge(idProperty, GetDataItemId(DataItem, idProperty));
            extraRouteValues = extraRouteValues.Merge("return", viewContext.HttpContext.Request.RawUrl);

            var url = viewContext.UrlHelper().Action(columnAttr.TargetAction, extraRouteValues);

            return new HtmlString(string.Format("<a href='{0}'><img class='icon {2}' src='{3}'/> {1}</a>", url, PropertyValue.ToString(),
                Class, Kooboo.Web.Url.UrlUtility.ResolveUrl("~/Images/invis.gif")));
        }