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); }
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(); } }
public void Main(int publishmentSystemId, int styleId) { var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); var tagStyleInfo = TagStyleManager.GetTagStyleInfo(styleId) ?? new TagStyleInfo(); var tagStyleGovPublicApplyInfo = new TagStyleGovPublicApplyInfo(tagStyleInfo.SettingsXML); try { var applyInfo = DataProvider.GovPublicApplyDao.GetApplyInfo(publishmentSystemId, styleId, HttpContext.Current.Request.Form); var applyId = DataProvider.GovPublicApplyDao.Insert(applyInfo); var fromName = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicName); if (applyInfo.IsOrganization) { fromName = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgName); } var toDepartmentName = string.Empty; if (applyInfo.DepartmentId > 0) { toDepartmentName = "至" + applyInfo.DepartmentName; } GovPublicApplyManager.LogNew(publishmentSystemId, applyId, fromName, toDepartmentName); MessageManager.SendSMSByGovPublicApply(publishmentSystemInfo, tagStyleGovPublicApplyInfo, applyInfo); HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, true, applyInfo.QueryCode, string.Empty)); HttpContext.Current.Response.End(); } catch (Exception ex) { //HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, false, string.Empty, ex.Message)); HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, false, string.Empty, "程序错误")); HttpContext.Current.Response.End(); } }