Ejemplo n.º 1
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var styleID     = SqlUtils.EvalInt(e.Item.DataItem, "StyleID");
                var styleName   = SqlUtils.EvalString(e.Item.DataItem, "StyleName");
                var settingsXML = SqlUtils.EvalString(e.Item.DataItem, "SettingsXML");

                var ltlStyleName   = (Literal)e.Item.FindControl("ltlStyleName");
                var ltlTemplateUrl = (Literal)e.Item.FindControl("ltlTemplateUrl");
                var ltlPreviewUrl  = (Literal)e.Item.FindControl("ltlPreviewUrl");
                var ltlEditUrl     = (Literal)e.Item.FindControl("ltlEditUrl");
                var ltlExportUrl   = (Literal)e.Item.FindControl("ltlExportUrl");
                var ltlDeleteUrl   = (Literal)e.Item.FindControl("ltlDeleteUrl");

                ltlStyleName.Text = styleName;

                var returnUrl = GetRedirectUrl(PublishmentSystemId, _elementName);

                ltlTemplateUrl.Text = $@"<a href=""{PageTagStyleTemplate.GetRedirectUrl(PublishmentSystemId, styleID, returnUrl)}"">自定义模板</a>";

                ltlPreviewUrl.Text = $@"<a href=""{PageTagStylePreview.GetRedirectUrl(PublishmentSystemId, styleID, returnUrl)}"">预览</a>";

                ltlEditUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{TextUtility.GetTagStyleOpenWindowStringToEdit(_elementName,
                        PublishmentSystemId, styleID)}"">编辑</a>";

                ltlExportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToTagStyle(
                        PublishmentSystemId, styleID)}"">导出</a>";

                var deleteUrl = PageUtils.GetCmsUrl(nameof(PageTagStyle), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "elementName", _elementName },
                    { "Delete", true.ToString() },
                    { "StyleID", styleID.ToString() }
                });
                ltlDeleteUrl.Text =
                    $@"<a href=""{deleteUrl}"" onClick=""javascript:return confirm('此操作将删除样式“{styleName}”,确认吗?');"">删除</a>";
            }
        }
Ejemplo n.º 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("StyleID");

            var styleID = Body.GetQueryInt("StyleID");

            _styleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(styleID);

            if (!IsPostBack)
            {
                ltlStyleName.Text = _styleInfo.StyleName;
                ltlElement.Text   = $@"
&lt;{_styleInfo.ElementName} styleName=&quot;{_styleInfo.StyleName}&quot;&gt;&lt;/{_styleInfo.ElementName}&gt;";
                if (StringUtils.EqualsIgnoreCase(_styleInfo.ElementName, StlGovInteractApply.ElementName))
                {
                    var nodeID   = DataProvider.GovInteractChannelDao.GetNodeIdByApplyStyleId(_styleInfo.StyleID);
                    var nodeName = NodeManager.GetNodeName(PublishmentSystemId, nodeID);
                    ltlStyleName.Text = nodeName;
                    ltlElement.Text   =
                        $@"&lt;{_styleInfo.ElementName} interactName=&quot;{nodeName}&quot;&gt;&lt;/{_styleInfo
                            .ElementName}&gt;";
                }
                else if (StringUtils.EqualsIgnoreCase(_styleInfo.ElementName, StlGovInteractQuery.ElementName))
                {
                    var nodeID   = DataProvider.GovInteractChannelDao.GetNodeIdByQueryStyleId(_styleInfo.StyleID);
                    var nodeName = NodeManager.GetNodeName(PublishmentSystemId, nodeID);
                    ltlStyleName.Text = nodeName;
                    ltlElement.Text   =
                        $@"&lt;{_styleInfo.ElementName} interactName=&quot;{nodeName}&quot;&gt;&lt;/{_styleInfo
                            .ElementName}&gt;";
                }

                EBooleanUtils.AddListItems(rblIsTemplate, "自定义模板", "默认模板");
                ControlUtils.SelectListItemsIgnoreCase(rblIsTemplate, _styleInfo.IsTemplate.ToString());
                phTemplate.Visible = _styleInfo.IsTemplate;

                var previewUrl = PageTagStylePreview.GetRedirectUrl(PublishmentSystemId, _styleInfo.StyleID,
                                                                    Body.GetQueryString("ReturnUrl"));
                Preview.Attributes.Add("onclick", $"location.href='{previewUrl}';return false;");

                phSuccess.Visible = TagStyleUtility.IsSuccessVisible(_styleInfo.ElementName);
                phFailure.Visible = TagStyleUtility.IsFailureVisible(_styleInfo.ElementName);
                phStyle.Visible   = TagStyleUtility.IsStyleVisible(_styleInfo.ElementName);
                phScript.Visible  = TagStyleUtility.IsScriptVisible(_styleInfo.ElementName);

                if (_styleInfo.IsTemplate)
                {
                    tbContent.Text = _styleInfo.ContentTemplate;
                    if (phSuccess.Visible)
                    {
                        tbSuccess.Text = _styleInfo.SuccessTemplate;
                    }
                    if (phFailure.Visible)
                    {
                        tbFailure.Text = _styleInfo.FailureTemplate;
                    }
                    if (phStyle.Visible)
                    {
                        tbStyle.Text = _styleInfo.StyleTemplate;
                    }
                    if (phScript.Visible)
                    {
                        tbScript.Text = _styleInfo.ScriptTemplate;
                    }
                }

                if (string.IsNullOrEmpty(Body.GetQueryString("ReturnUrl")))
                {
                    phReturn.Visible = false;
                }
            }
        }
Ejemplo n.º 3
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlName    = e.Item.FindControl("ltlName") as Literal;
                var ltlEditUrl = e.Item.FindControl("ltlEditUrl") as Literal;

                if (tableStyle == ETableStyle.GovInteractContent)
                {
                    var nodeInfo = e.Item.DataItem as NodeInfo;
                    ltlName.Text = nodeInfo.NodeName;
                    if (StringUtils.EqualsIgnoreCase(type, "DepartmentSelect"))
                    {
                        ltlEditUrl.Text =
                            $@"<a target='management' href=""{PageGovInteractDepartmentSelect.GetRedirectUrl(
                                PublishmentSystemId, nodeInfo.NodeId)}"">负责部门设置</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "AdministratorSelect"))
                    {
                        ltlEditUrl.Text =
                            $@"<a target='management' href=""{PageGovInteractPermissions.GetRedirectUrl(
                                PublishmentSystemId, nodeInfo.NodeId)}"">负责人员设置</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "Attributes"))
                    {
                        ltlEditUrl.Text =
                            $@"<a target='management' href=""{PageTableStyle.GetRedirectUrl(PublishmentSystemId,
                                ETableStyle.GovInteractContent,
                                PublishmentSystemInfo.AuxiliaryTableForGovInteract, nodeInfo.NodeId)}"">自定义字段</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "Apply"))
                    {
                        var applyStyleId = DataProvider.GovInteractChannelDao.GetApplyStyleId(nodeInfo.PublishmentSystemId, nodeInfo.NodeId);
                        ltlEditUrl.Text = $@"<a target='management' href=""{PageTagStyleTemplate.GetRedirectUrl(PublishmentSystemId, applyStyleId, string.Empty)}"">自定义提交模板</a>&nbsp;&nbsp;&nbsp;&nbsp;<a target='management' href=""{PageTagStylePreview.GetRedirectUrl(PublishmentSystemId, applyStyleId, string.Empty)}"">预览 </a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "Query"))
                    {
                        var queryStyleId = DataProvider.GovInteractChannelDao.GetQueryStyleId(nodeInfo.PublishmentSystemId, nodeInfo.NodeId);
                        ltlEditUrl.Text = $@"<a target='management' href=""{PageTagStyleTemplate.GetRedirectUrl(PublishmentSystemId, queryStyleId, string.Empty)}"">自定义查询模板</a>&nbsp;&nbsp;&nbsp;&nbsp;<a target='management' href=""{PageTagStylePreview.GetRedirectUrl(PublishmentSystemId, queryStyleId, string.Empty)}"">预览 </a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "MailSMS"))
                    {
                        var styleID = DataProvider.GovInteractChannelDao.GetApplyStyleId(nodeInfo.PublishmentSystemId, nodeInfo.NodeId);
                        ltlEditUrl.Text =
                            $@"<a target='management' href=""{PageTagStyleMailSMS.GetRedirectUrl(
                                PublishmentSystemId, styleID, tableStyle, nodeInfo.NodeId)}"">邮件/短信发送</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(type, "InteractType"))
                    {
                        ltlEditUrl.Text = $@"<a target='management' href=""{PageGovInteractType.GetRedirectUrl(PublishmentSystemId, nodeInfo.NodeId)}"">办件类型管理</a>";
                    }
                }
            }
        }