Exemplo n.º 1
0
        public static ResponseCollection Links(
            this ResponseCollection res,
            Context context,
            SiteSettings ss,
            long id,
            BaseModel.MethodTypes?methodType)
        {
            var dataSet = DataSet(
                context: context,
                ss: ss,
                id: id);
            var links = HtmlLinkCreations.Links(
                context: context,
                ss: ss);

            new[] { ss.TabName(0) }
            .Concat(ss.Tabs?.Select(tab => ss.TabName(tab.Id)) ?? new List <string>())
            .Select((tabName, tabIndex) => new { tabName, tabIndex })
            .ForEach(data =>
            {
                ss.EditorColumnHash?.Get(data.tabName)?.ForEach(columnName =>
                {
                    var linkId = ss.LinkId(columnName);
                    if (linkId > 0)
                    {
                        var sourceSs      = TargetSiteSettings(ss.Sources, linkId);
                        var destinationSs = TargetSiteSettings(ss.Destinations, linkId);
                        var targetSs      = sourceSs ?? destinationSs;
                        if (targetSs != null)
                        {
                            var direction = sourceSs != null
                                    ? "Source"
                                    : "Destination";
                            var dataTableName = DataTableName(
                                ss: targetSs,
                                direction: direction);
                            res.Html("#" + dataTableName + "Field", new HtmlBuilder().Link(
                                         context: context,
                                         ss: ss,
                                         id: id,
                                         linkId: linkId,
                                         direction: direction,
                                         targetSs: targetSs,
                                         links: links,
                                         dataSet: dataSet,
                                         methodType: methodType,
                                         tabIndex: data.tabIndex));
                        }
                    }
                });
            });
            return(res);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Fixed:
        /// </summary>
        public static ResponseCollection EditorResponse(
            this ResponseCollection res, SiteSettings ss, string reference, long id)
        {
            var exportSettingModel = ExportSetting(ss.ReferenceType, id);

            SetSessions(exportSettingModel);
            var hb = new HtmlBuilder();

            return(res
                   .Html("#ExportSettingsDialog", hb
                         .Form(
                             attributes: new HtmlAttributes()
                             .Id("ExportSettingsForm")
                             .Action(Locations.Action(
                                         reference, id, "ExportSettings")),
                             action: () => hb
                             .Columns(
                                 exportSettingModel.ExportColumns,
                                 exportSettingModel.GetSiteSettings())
                             .Settings(ss.ReferenceType, id)
                             .P(css: "message-dialog")
                             .Commands())));
        }