Ejemplo n.º 1
0
 public GovInteractApplyTemplate(PublishmentSystemInfo publishmentSystemInfo, int nodeId, TagStyleInfo tagStyleInfo, TagStyleGovInteractApplyInfo tagStyleApplyInfo)
 {
     _publishmentSystemInfo = publishmentSystemInfo;
     _nodeId            = nodeId;
     _tagStyleInfo      = tagStyleInfo;
     _tagStyleApplyInfo = tagStyleApplyInfo;
 }
Ejemplo n.º 2
0
        public TagStyleInfo GetTagStyleInfo(int publishmentSystemId, string elementName, string styleName)
        {
            TagStyleInfo tagStyleInfo = null;

            var sqlString = "SELECT StyleID, StyleName, ElementName, PublishmentSystemID, IsTemplate, StyleTemplate, ScriptTemplate, ContentTemplate, SuccessTemplate, FailureTemplate, SettingsXML FROM siteserver_TagStyle WHERE PublishmentSystemID = @PublishmentSystemID AND ElementName = @ElementName AND StyleName = @StyleName";

            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemid, EDataType.Integer, publishmentSystemId),
                GetParameter(ParmElementName, EDataType.VarChar, 50, elementName),
                GetParameter(ParmStyleName, EDataType.NVarChar, 50, styleName)
            };

            using (var rdr = ExecuteReader(sqlString, parms))
            {
                if (rdr.Read())
                {
                    var i = 0;
                    tagStyleInfo = new TagStyleInfo(GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetInt(rdr, i++), GetBool(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i));
                }
                rdr.Close();
            }

            return(tagStyleInfo);
        }
Ejemplo n.º 3
0
        public static string ParseImpl(PageInfo pageInfo, ContextInfo contextInfo, string styleName, string inputTemplateString, string successTemplateString, string failureTemplateString)
        {
            var parsedContent = string.Empty;

            pageInfo.AddPageScriptsIfNotExists(PageInfo.Components.Jquery);
            pageInfo.AddPageScriptsIfNotExists(PageInfo.JQuery.BAjaxUpload);
            pageInfo.AddPageScriptsIfNotExists(PageInfo.JQuery.BShowLoading);
            pageInfo.AddPageScriptsIfNotExists(PageInfo.JQuery.BValidate);

            var styleInfo = TagStyleManager.GetTagStyleInfo(pageInfo.PublishmentSystemId, ElementName, styleName);

            if (styleInfo == null)
            {
                styleInfo = new TagStyleInfo();
            }
            var applyInfo = new TagStyleGovPublicApplyInfo(styleInfo.SettingsXML);

            var applyTemplate  = new GovPublicApplyTemplate(pageInfo.PublishmentSystemInfo, styleInfo, applyInfo);
            var contentBuilder = new StringBuilder(applyTemplate.GetTemplate(styleInfo.IsTemplate, inputTemplateString, successTemplateString, failureTemplateString));

            StlParserManager.ParseTemplateContent(contentBuilder, pageInfo, contextInfo);
            parsedContent = contentBuilder.ToString();

            return(parsedContent);
        }
Ejemplo n.º 4
0
        public static TagStyleInfo GetTagStyleInfo(int styleID)
        {
            var styleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(styleID);

            if (styleInfo == null)
            {
                styleInfo = new TagStyleInfo();
            }
            return(styleInfo);
        }
Ejemplo n.º 5
0
        public void ExportTagStyle(TagStyleInfo tagStyleInfo)
        {
            var feed = AtomUtility.GetEmptyFeed();

            var entry = ExportTagStyleInfo(tagStyleInfo);

            feed.Entries.Add(entry);

            feed.Save(_filePath);
        }
Ejemplo n.º 6
0
        public void ImportTagStyle(bool overwrite)
        {
            if (!FileUtils.IsFileExists(_filePath))
            {
                return;
            }
            var feed = AtomFeed.Load(FileUtils.GetFileStreamReadOnly(_filePath));

            foreach (AtomEntry entry in feed.Entries)
            {
                var styleName = AtomUtility.GetDcElementContent(entry.AdditionalElements, "StyleName");

                if (!string.IsNullOrEmpty(styleName))
                {
                    var tagStyleInfo = new TagStyleInfo
                    {
                        StyleName           = styleName,
                        ElementName         = AtomUtility.GetDcElementContent(entry.AdditionalElements, "ElementName"),
                        PublishmentSystemID = _publishmentSystemId,
                        IsTemplate          =
                            TranslateUtils.ToBool(AtomUtility.GetDcElementContent(entry.AdditionalElements, "IsTemplate")),
                        StyleTemplate =
                            AtomUtility.Decrypt(AtomUtility.GetDcElementContent(entry.AdditionalElements,
                                                                                "StyleTemplate")),
                        ScriptTemplate =
                            AtomUtility.Decrypt(AtomUtility.GetDcElementContent(entry.AdditionalElements,
                                                                                "ScriptTemplate")),
                        ContentTemplate =
                            AtomUtility.Decrypt(AtomUtility.GetDcElementContent(entry.AdditionalElements,
                                                                                "ContentTemplate")),
                        SettingsXML =
                            AtomUtility.Decrypt(AtomUtility.GetDcElementContent(entry.AdditionalElements, "SettingsXML"))
                    };

                    var srcTagStyleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(_publishmentSystemId, tagStyleInfo.ElementName, tagStyleInfo.StyleName);
                    if (srcTagStyleInfo != null)
                    {
                        if (overwrite)
                        {
                            tagStyleInfo.StyleID = srcTagStyleInfo.StyleID;
                            DataProvider.TagStyleDao.Update(tagStyleInfo);
                        }
                        else
                        {
                            tagStyleInfo.StyleName = DataProvider.TagStyleDao.GetImportStyleName(_publishmentSystemId, tagStyleInfo.ElementName, tagStyleInfo.StyleName);
                            DataProvider.TagStyleDao.Insert(tagStyleInfo);
                        }
                    }
                    else
                    {
                        DataProvider.TagStyleDao.Insert(tagStyleInfo);
                    }
                }
            }
        }
Ejemplo n.º 7
0
        public string ExportTagStyle(TagStyleInfo styleInfo)
        {
            var filePath = PathUtils.GetTemporaryFilesPath(styleInfo.StyleName + ".xml");

            FileUtils.DeleteFileIfExists(filePath);

            var tagStyleIe = new TagStyleIe(Fso.PublishmentSystemId, filePath);

            tagStyleIe.ExportTagStyle(styleInfo);

            return(PathUtils.GetFileName(filePath));
        }
Ejemplo n.º 8
0
        private static AtomEntry ExportTagStyleInfo(TagStyleInfo tagStyleInfo)
        {
            var entry = AtomUtility.GetEmptyEntry();

            AtomUtility.AddDcElement(entry.AdditionalElements, "StyleID", tagStyleInfo.StyleID.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, "StyleName", tagStyleInfo.StyleName);
            AtomUtility.AddDcElement(entry.AdditionalElements, "ElementName", tagStyleInfo.ElementName);
            AtomUtility.AddDcElement(entry.AdditionalElements, "PublishmentSystemID", tagStyleInfo.PublishmentSystemID.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, "IsTemplate", tagStyleInfo.IsTemplate.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, "StyleTemplate", AtomUtility.Encrypt(tagStyleInfo.StyleTemplate));
            AtomUtility.AddDcElement(entry.AdditionalElements, "ScriptTemplate", AtomUtility.Encrypt(tagStyleInfo.ScriptTemplate));
            AtomUtility.AddDcElement(entry.AdditionalElements, "ContentTemplate", AtomUtility.Encrypt(tagStyleInfo.ContentTemplate));
            AtomUtility.AddDcElement(entry.AdditionalElements, "SettingsXML", AtomUtility.Encrypt(tagStyleInfo.SettingsXML));

            return(entry);
        }
Ejemplo n.º 9
0
        public static string ParseImpl(PageInfo pageInfo, ContextInfo contextInfo, int channelID, string channelIndex, string channelName, string interactName, string inputTemplateString, string successTemplateString, string failureTemplateString)
        {
            var parsedContent = string.Empty;

            pageInfo.AddPageScriptsIfNotExists(PageInfo.Components.Jquery);
            pageInfo.AddPageScriptsIfNotExists(PageInfo.JQuery.BShowLoading);
            pageInfo.AddPageScriptsIfNotExists(PageInfo.JQuery.BValidate);

            var nodeID = channelID;

            if (!string.IsNullOrEmpty(interactName))
            {
                nodeID = DataProvider.GovInteractChannelDao.GetNodeIdByInteractName(pageInfo.PublishmentSystemId, interactName);
            }
            if (nodeID == 0)
            {
                nodeID = StlCacheManager.NodeId.GetNodeIdByChannelIdOrChannelIndexOrChannelName(pageInfo.PublishmentSystemId, pageInfo.PublishmentSystemId, channelIndex, channelName);
            }
            var nodeInfo = NodeManager.GetNodeInfo(pageInfo.PublishmentSystemId, nodeID);

            if (nodeInfo == null || !EContentModelTypeUtils.Equals(nodeInfo.ContentModelId, EContentModelType.GovInteract))
            {
                nodeInfo = NodeManager.GetNodeInfo(pageInfo.PublishmentSystemId, pageInfo.PublishmentSystemInfo.Additional.GovInteractNodeId);
            }
            if (nodeInfo != null)
            {
                var applyStyleID = DataProvider.GovInteractChannelDao.GetApplyStyleId(nodeInfo.PublishmentSystemId, nodeInfo.NodeId);

                var styleInfo = TagStyleManager.GetTagStyleInfo(applyStyleID);
                if (styleInfo == null)
                {
                    styleInfo = new TagStyleInfo();
                }
                var applyInfo = new TagStyleGovInteractApplyInfo(styleInfo.SettingsXML);

                var applyTemplate  = new GovInteractApplyTemplate(pageInfo.PublishmentSystemInfo, nodeInfo.NodeId, styleInfo, applyInfo);
                var contentBuilder = new StringBuilder(applyTemplate.GetTemplate(styleInfo.IsTemplate, inputTemplateString, successTemplateString, failureTemplateString));
                contentBuilder.Replace("{ChannelID}", nodeInfo.NodeId.ToString());

                StlParserManager.ParseTemplateContent(contentBuilder, pageInfo, contextInfo);
                parsedContent = contentBuilder.ToString();
            }

            return(parsedContent);
        }
Ejemplo n.º 10
0
        public void Update(TagStyleInfo tagStyleInfo)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(ParmStyleName, EDataType.NVarChar, 50, tagStyleInfo.StyleName),
                GetParameter(ParmIstemplate, EDataType.VarChar, 18, tagStyleInfo.IsTemplate.ToString()),
                GetParameter(ParmStyleTemplate, EDataType.NText, tagStyleInfo.StyleTemplate),
                GetParameter(ParmScriptTemplate, EDataType.NText, tagStyleInfo.ScriptTemplate),
                GetParameter(ParmContentTemplate, EDataType.NText, tagStyleInfo.ContentTemplate),
                GetParameter(ParmSuccessTemplate, EDataType.NText, tagStyleInfo.SuccessTemplate),
                GetParameter(ParmFailureTemplate, EDataType.NText, tagStyleInfo.FailureTemplate),
                GetParameter(ParmSettingsXml, EDataType.NText, tagStyleInfo.SettingsXML),
                GetParameter(ParmStyleId, EDataType.Integer, tagStyleInfo.StyleID)
            };

            ExecuteNonQuery(SqlUpdate, parms);

            TagStyleManager.RemoveCache(tagStyleInfo.PublishmentSystemID, tagStyleInfo.ElementName, tagStyleInfo.StyleName);
        }
Ejemplo n.º 11
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;

                string stlElement =
                    $@"<{_styleInfo.ElementName} styleName=""{_styleInfo.StyleName}""></{_styleInfo
                        .ElementName}>";
                if (StringUtils.EqualsIgnoreCase(_styleInfo.ElementName, StlGovInteractApply.ElementName))
                {
                    var nodeId   = DataProvider.GovInteractChannelDao.GetNodeIdByApplyStyleId(_styleInfo.StyleID);
                    var nodeName = NodeManager.GetNodeName(PublishmentSystemId, nodeId);
                    ltlStyleName.Text = nodeName;
                    stlElement        =
                        $@"<{_styleInfo.ElementName} interactName=""{nodeName}""></{_styleInfo.ElementName}>";
                }
                else if (StringUtils.EqualsIgnoreCase(_styleInfo.ElementName, StlGovInteractQuery.ElementName))
                {
                    var nodeId   = DataProvider.GovInteractChannelDao.GetNodeIdByQueryStyleId(_styleInfo.StyleID);
                    var nodeName = NodeManager.GetNodeName(PublishmentSystemId, nodeId);
                    ltlStyleName.Text = nodeName;
                    stlElement        =
                        $@"<{_styleInfo.ElementName} interactName=""{nodeName}""></{_styleInfo.ElementName}>";
                }

                ltlElement.Text = StringUtils.HtmlEncode(stlElement);

                ltlForm.Text = StlParserManager.ParsePreviewContent(PublishmentSystemInfo, stlElement);
            }
        }
Ejemplo n.º 12
0
        public TagStyleInfo GetTagStyleInfo(int styleId)
        {
            TagStyleInfo tagStyleInfo = null;

            var parms = new IDataParameter[]
            {
                GetParameter(ParmStyleId, EDataType.Integer, styleId)
            };

            using (var rdr = ExecuteReader(SqlSelect, parms))
            {
                if (rdr.Read())
                {
                    var i = 0;
                    tagStyleInfo = new TagStyleInfo(GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetInt(rdr, i++), GetBool(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i));
                }
                rdr.Close();
            }

            return(tagStyleInfo);
        }
Ejemplo n.º 13
0
        public int Insert(TagStyleInfo tagStyleInfo)
        {
            int styleId;

            var sqlString = "INSERT INTO siteserver_TagStyle (StyleName, ElementName, PublishmentSystemID, IsTemplate, StyleTemplate, ScriptTemplate, ContentTemplate, SuccessTemplate, FailureTemplate, SettingsXML) VALUES (@StyleName, @ElementName, @PublishmentSystemID, @IsTemplate, @StyleTemplate, @ScriptTemplate, @ContentTemplate, @SuccessTemplate, @FailureTemplate, @SettingsXML)";

            var parms = new IDataParameter[]
            {
                GetParameter(ParmStyleName, EDataType.NVarChar, 50, tagStyleInfo.StyleName),
                GetParameter(ParmElementName, EDataType.VarChar, 50, tagStyleInfo.ElementName),
                GetParameter(ParmPublishmentsystemid, EDataType.Integer, tagStyleInfo.PublishmentSystemID),
                GetParameter(ParmIstemplate, EDataType.VarChar, 18, tagStyleInfo.IsTemplate.ToString()),
                GetParameter(ParmStyleTemplate, EDataType.NText, tagStyleInfo.StyleTemplate),
                GetParameter(ParmScriptTemplate, EDataType.NText, tagStyleInfo.ScriptTemplate),
                GetParameter(ParmContentTemplate, EDataType.NText, tagStyleInfo.ContentTemplate),
                GetParameter(ParmSuccessTemplate, EDataType.NText, tagStyleInfo.SuccessTemplate),
                GetParameter(ParmFailureTemplate, EDataType.NText, tagStyleInfo.FailureTemplate),
                GetParameter(ParmSettingsXml, EDataType.NText, tagStyleInfo.SettingsXML)
            };

            using (var conn = GetConnection())
            {
                conn.Open();
                using (var trans = conn.BeginTransaction())
                {
                    try
                    {
                        styleId = ExecuteNonQueryAndReturnId(trans, sqlString, parms);
                        trans.Commit();
                    }
                    catch
                    {
                        trans.Rollback();
                        throw;
                    }
                }
            }

            return(styleId);
        }
Ejemplo n.º 14
0
        public ArrayList GetTagStyleInfoArrayList(int publishmentSystemId)
        {
            var arraylist = new ArrayList();

            var parms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemid, EDataType.Integer, publishmentSystemId)
            };

            using (var rdr = ExecuteReader(SqlSelectAll, parms))
            {
                while (rdr.Read())
                {
                    var i            = 0;
                    var tagStyleInfo = new TagStyleInfo(GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetInt(rdr, i++), GetBool(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetString(rdr, i));
                    arraylist.Add(tagStyleInfo);
                }
                rdr.Close();
            }

            return(arraylist);
        }
Ejemplo n.º 15
0
 public static void IsCreateTemplate_CheckedChanged(TagStyleInfo styleInfo, PublishmentSystemInfo publishmentSystemInfo, TextBox tbContent, TextBox tbSuccess, TextBox tbFailure, TextBox tbStyle, TextBox tbScript)
 {
     if (StringUtils.EqualsIgnoreCase(StlGovPublicApply.ElementName, styleInfo.ElementName))
     {
         var applyInfo     = new TagStyleGovPublicApplyInfo(styleInfo.SettingsXML);
         var applyTemplate = new GovPublicApplyTemplate(publishmentSystemInfo, styleInfo, applyInfo);
         tbContent.Text = applyTemplate.GetFileInputTemplate();
         tbSuccess.Text = applyTemplate.GetFileSuccessTemplate();
         tbFailure.Text = applyTemplate.GetFileFailureTemplate();
         tbScript.Text  = applyTemplate.GetScript();
     }
     else if (StringUtils.EqualsIgnoreCase(StlGovPublicQuery.ElementName, styleInfo.ElementName))
     {
         var queryTemplate = new GovPublicQueryTemplate(publishmentSystemInfo, styleInfo);
         tbContent.Text = queryTemplate.GetFileInputTemplate();
         tbSuccess.Text = queryTemplate.GetFileSuccessTemplate();
         tbFailure.Text = queryTemplate.GetFileFailureTemplate();
         tbScript.Text  = queryTemplate.GetScript();
     }
     else if (StringUtils.EqualsIgnoreCase(StlGovInteractApply.ElementName, styleInfo.ElementName))
     {
         var applyInfo     = new TagStyleGovInteractApplyInfo(styleInfo.SettingsXML);
         var nodeID        = DataProvider.GovInteractChannelDao.GetNodeIdByApplyStyleId(styleInfo.StyleID);
         var applyTemplate = new GovInteractApplyTemplate(publishmentSystemInfo, nodeID, styleInfo, applyInfo);
         tbContent.Text = applyTemplate.GetFileInputTemplate();
         tbSuccess.Text = applyTemplate.GetFileSuccessTemplate();
         tbFailure.Text = applyTemplate.GetFileFailureTemplate();
         tbScript.Text  = applyTemplate.GetScript();
     }
     else if (StringUtils.EqualsIgnoreCase(StlGovInteractQuery.ElementName, styleInfo.ElementName))
     {
         var nodeID        = DataProvider.GovInteractChannelDao.GetNodeIdByQueryStyleId(styleInfo.StyleID);
         var queryTemplate = new GovInteractQueryTemplate(publishmentSystemInfo, nodeID, styleInfo);
         tbContent.Text = queryTemplate.GetFileInputTemplate();
         tbSuccess.Text = queryTemplate.GetFileSuccessTemplate();
         tbFailure.Text = queryTemplate.GetFileFailureTemplate();
         tbScript.Text  = queryTemplate.GetScript();
     }
 }
Ejemplo n.º 16
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;
                }
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var          isChanged = false;
            TagStyleInfo styleInfo = null;

            if (Body.IsQueryExists("StyleID"))
            {
                try
                {
                    var styleId = Body.GetQueryInt("StyleID");
                    styleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(styleId);
                    if (styleInfo != null)
                    {
                        styleInfo.StyleName = StyleName.Text;
                    }
                    DataProvider.TagStyleDao.Update(styleInfo);

                    Body.AddSiteLog(PublishmentSystemId, "修改依申请公开查询样式", $"样式名称:{styleInfo.StyleName}");

                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "依申请公开查询样式修改失败!");
                }
            }
            else
            {
                var styleNameArrayList = DataProvider.TagStyleDao.GetStyleNameArrayList(PublishmentSystemId, StlGovInteractQuery.ElementName);
                if (styleNameArrayList.IndexOf(StyleName.Text) != -1)
                {
                    FailMessage("依申请公开查询样式添加失败,依申请公开查询样式名称已存在!");
                }
                else
                {
                    try
                    {
                        styleInfo = new TagStyleInfo();

                        styleInfo.StyleName           = StyleName.Text;
                        styleInfo.ElementName         = StlGovInteractQuery.ElementName;
                        styleInfo.PublishmentSystemID = PublishmentSystemId;

                        DataProvider.TagStyleDao.Insert(styleInfo);

                        Body.AddSiteLog(PublishmentSystemId, "添加依申请公开查询样式", $"样式名称:{styleInfo.StyleName}");

                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "依申请公开查询样式添加失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Ejemplo n.º 18
0
 public GovPublicQueryTemplate(PublishmentSystemInfo publishmentSystemInfo, TagStyleInfo tagStyleInfo)
 {
     _publishmentSystemInfo = publishmentSystemInfo;
     _tagStyleInfo          = tagStyleInfo;
 }
Ejemplo n.º 19
0
 public GovPublicApplyTemplate(PublishmentSystemInfo publishmentSystemInfo, TagStyleInfo tagStyleInfo, TagStyleGovPublicApplyInfo applyInfo)
 {
     _publishmentSystemInfo = publishmentSystemInfo;
     _tagStyleInfo          = tagStyleInfo;
     _applyInfo             = applyInfo;
 }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var          isChanged = false;
            TagStyleInfo styleInfo;

            if (Body.IsQueryExists("StyleID"))
            {
                try
                {
                    var styleId = Body.GetQueryInt("StyleID");
                    styleInfo = DataProvider.TagStyleDao.GetTagStyleInfo(styleId);
                    if (styleInfo != null)
                    {
                        var applyInfo = new TagStyleGovPublicApplyInfo(styleInfo.SettingsXML);

                        styleInfo.StyleName = StyleName.Text;

                        applyInfo.IsSMS    = TranslateUtils.ToBool(IsSMS.SelectedValue);
                        applyInfo.SMSTo    = SMSTo.Text;
                        applyInfo.SMSTitle = SMSTitle.Text;

                        styleInfo.SettingsXML = applyInfo.ToString();
                    }
                    DataProvider.TagStyleDao.Update(styleInfo);

                    Body.AddSiteLog(PublishmentSystemId, "修改依申请公开提交样式", $"样式名称:{styleInfo.StyleName}");

                    isChanged = true;
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "依申请公开提交样式修改失败!");
                }
            }
            else
            {
                var styleNameArrayList = DataProvider.TagStyleDao.GetStyleNameArrayList(PublishmentSystemId, StlGovPublicApply.ElementName);
                if (styleNameArrayList.IndexOf(StyleName.Text) != -1)
                {
                    FailMessage("依申请公开提交样式添加失败,依申请公开提交样式名称已存在!");
                }
                else
                {
                    try
                    {
                        styleInfo = new TagStyleInfo();
                        var applyInfo = new TagStyleGovPublicApplyInfo(string.Empty);

                        styleInfo.StyleName           = StyleName.Text;
                        styleInfo.ElementName         = StlGovPublicApply.ElementName;
                        styleInfo.PublishmentSystemID = PublishmentSystemId;

                        applyInfo.IsSMS    = TranslateUtils.ToBool(IsSMS.SelectedValue);
                        applyInfo.SMSTo    = SMSTo.Text;
                        applyInfo.SMSTitle = SMSTitle.Text;

                        styleInfo.SettingsXML = applyInfo.ToString();

                        DataProvider.TagStyleDao.Insert(styleInfo);

                        Body.AddSiteLog(PublishmentSystemId, "添加依申请公开提交样式", $"样式名称:{styleInfo.StyleName}");

                        isChanged = true;
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "依申请公开提交样式添加失败!");
                    }
                }
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }