public override void Submit_OnClick(object sender, EventArgs e) { if (Page.IsPostBack && Page.IsValid) { var photoCount = TranslateUtils.ToInt(Request.Form["Photo_Count"]); if (photoCount > 0) { for (var index = 1; index <= photoCount; index++) { var id = TranslateUtils.ToInt(Request.Form["ID_" + index]); var smallUrl = Request.Form["SmallUrl_" + index]; var largeUrl = Request.Form["LargeUrl_" + index]; if (!string.IsNullOrEmpty(smallUrl) && !string.IsNullOrEmpty(largeUrl)) { _imageUrlArrayList.Add(smallUrl); _largeImageUrlArrayList.Add(largeUrl); } } } if (_imageUrlArrayList != null && _imageUrlArrayList.Count > 0) { _imageUrlCollection = TranslateUtils.ToSqlInStringWithoutQuote(_imageUrlArrayList); _largeImageUrlCollection = TranslateUtils.ToSqlInStringWithoutQuote(_largeImageUrlArrayList); } string scripts = $"window.parent.addImage('{_imageUrlCollection}', '{_largeImageUrlCollection}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } }
public override void Submit_OnClick(object sender, EventArgs e) { var isIncludeChildren = TranslateUtils.ToBool(IsIncludeChildren.SelectedValue); var isCreateContents = TranslateUtils.ToBool(IsCreateContents.SelectedValue); foreach (var channelID in TranslateUtils.StringCollectionToIntList(_channelIdCollection)) { CreateManager.CreateChannel(PublishmentSystemId, channelID); if (isCreateContents) { CreateManager.CreateAllContent(PublishmentSystemId, channelID); } if (isIncludeChildren) { foreach (int childChannelID in DataProvider.NodeDao.GetNodeIdListForDescendant(channelID)) { CreateManager.CreateChannel(PublishmentSystemId, childChannelID); if (isCreateContents) { CreateManager.CreateAllContent(PublishmentSystemId, channelID); } } } } PageUtils.CloseModalPageWithoutRefresh(Page); }
public override void Submit_OnClick(object sender, EventArgs e) { var fileNames = Request.Form["fileNames"]; if (!string.IsNullOrEmpty(fileNames)) { fileNames = fileNames.Trim('|'); var builder = new StringBuilder(); foreach (var fileName in fileNames.Split('|')) { var filePath = WordUtils.GetWordFilePath(fileName); var wordContent = WordUtils.Parse(PublishmentSystemId, filePath, CbIsClearFormat.Checked, CbIsFirstLineIndent.Checked, CbIsClearFontSize.Checked, CbIsClearFontFamily.Checked, CbIsClearImages.Checked); wordContent = StringUtility.TextEditorContentDecode(wordContent, PublishmentSystemInfo, true); builder.Append(wordContent); FileUtils.DeleteFileIfExists(filePath); } var script = "parent." + ETextEditorTypeUtils.GetInsertHtmlScript(_attributeName, builder.ToString()); PageUtils.CloseModalPageWithoutRefresh(Page, script); } else { FailMessage("请选择Word文件上传!"); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _classCode = Request.QueryString["ClassCode"]; if (!IsPostBack) { var categoryClassInfo = DataProvider.GovPublicCategoryClassDao.GetCategoryClassInfo(_classCode, PublishmentSystemId); ltlCategoryName.Text = categoryClassInfo.ClassName; if (Body.IsQueryExists("CategoryID")) { var categoryId = TranslateUtils.ToInt(Request.QueryString["CategoryID"]); var categoryName = DataProvider.GovPublicCategoryDao.GetCategoryName(categoryId); string scripts = $"window.parent.showCategory{_classCode}('{categoryName}', '{categoryId}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { ClientScriptRegisterClientScriptBlock("NodeTreeScript", GovPublicCategoryTreeItem.GetScript(_classCode, PublishmentSystemId, EGovPublicCategoryLoadingType.Select, null)); BindGrid(); } } }
//PageUtils.GetWcmUrl(nameof(ModalGovInteractDepartmentSelect), new NameValueCollection())$"modal_govInteractDepartmentSelect.aspx?PublishmentSystemID={PublishmentSystemID}" + "&DepartmentID={0}")); public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _nodeId = TranslateUtils.ToInt(Request.QueryString["NodeID"]); _additional.Add("UrlFormatString", PageUtils.GetWcmUrl(nameof(ModalGovInteractDepartmentSelect), new NameValueCollection { { "PublishmentSystemID", PublishmentSystemId.ToString() } })); if (!IsPostBack) { if (Body.IsQueryExists("DepartmentID")) { var departmentId = TranslateUtils.ToInt(Request.QueryString["DepartmentID"]); var departmentName = DepartmentManager.GetDepartmentName(departmentId); string scripts = $"window.parent.showCategoryDepartment('{departmentName}', '{departmentId}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { ClientScriptRegisterClientScriptBlock("NodeTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.DepartmentSelect, _additional)); BindGrid(); } } }
public override void Submit_OnClick(object sender, EventArgs e) { var playUrl = TbPlayUrl.Text; var script = "parent." + ETextEditorTypeUtils.GetInsertAudioScript(_attributeName, playUrl, CbIsAutoPlay.Checked); PageUtils.CloseModalPageWithoutRefresh(Page, script); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _isProtocol = Body.GetQueryBool("isProtocol"); _jsMethod = Body.GetQueryString("jsMethod"); _itemIndex = Body.GetQueryInt("itemIndex"); _additional.Add("isProtocol", _isProtocol.ToString()); _additional.Add("jsMethod", _jsMethod); _additional.Add("itemIndex", _itemIndex.ToString()); if (!IsPostBack) { if (Body.IsQueryExists("NodeID")) { var nodeId = Body.GetQueryInt("NodeID"); var nodeNames = NodeManager.GetNodeNameNavigation(PublishmentSystemId, nodeId); if (!string.IsNullOrEmpty(_jsMethod)) { string scripts = $"window.parent.{_jsMethod}({_itemIndex}, '{nodeNames}', {nodeId});"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { var pageUrl = PageUtility.GetChannelUrl(PublishmentSystemInfo, NodeManager.GetNodeInfo(PublishmentSystemId, nodeId)); if (_isProtocol) { pageUrl = PageUtils.AddProtocolToUrl(pageUrl); } string scripts = $"window.parent.selectChannel('{nodeNames}', '{nodeId}', '{pageUrl}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } } else { var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, PublishmentSystemId); var linkUrl = PageUtils.GetCmsUrl(nameof(ModalChannelSelect), new NameValueCollection { { "PublishmentSystemID", PublishmentSystemId.ToString() }, { "NodeID", nodeInfo.NodeId.ToString() }, { "isProtocol", _isProtocol.ToString() }, { "jsMethod", _jsMethod }, { "itemIndex", _itemIndex.ToString() } }); ltlPublishmentSystem.Text = $"<a href='{linkUrl}'>{nodeInfo.NodeName}</a>"; ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.ChannelSelect, null)); BindGrid(); } } }
public override void Submit_OnClick(object sender, EventArgs e) { try { var isAdd = false; var appointmentItemInfo = new AppointmentItemInfo(); appointmentItemInfo.PublishmentSystemId = PublishmentSystemId; if (_appointmentItemId > 0) { appointmentItemInfo = DataProviderWx.AppointmentItemDao.GetItemInfo(_appointmentItemId); } appointmentItemInfo.AppointmentId = _appointmentId; appointmentItemInfo.Title = TbTitle.Text; appointmentItemInfo.TopImageUrl = TopImageUrl.Value; appointmentItemInfo.IsDescription = CbIsDescription.Checked; appointmentItemInfo.DescriptionTitle = TbDescriptionTitle.Text; appointmentItemInfo.Description = TbDescription.Text; appointmentItemInfo.IsImageUrl = CbIsImageUrl.Checked; appointmentItemInfo.ImageUrlTitle = TbImageUrlTitle.Text; appointmentItemInfo.ImageUrl = TbContentImageUrl.Text; appointmentItemInfo.IsVideoUrl = CbIsVideoUrl.Checked; appointmentItemInfo.VideoUrlTitle = TbVideoUrlTitle.Text; appointmentItemInfo.VideoUrl = TbContentVideoUrl.Text; appointmentItemInfo.IsImageUrlCollection = CbIsImageUrlCollection.Checked; appointmentItemInfo.ImageUrlCollectionTitle = TbImageUrlCollectionTitle.Text; appointmentItemInfo.ImageUrlCollection = ImageUrlCollection.Value; appointmentItemInfo.LargeImageUrlCollection = LargeImageUrlCollection.Value; appointmentItemInfo.IsMap = CbIsMap.Checked; appointmentItemInfo.MapTitle = TbMapTitle.Text; appointmentItemInfo.MapAddress = TbMapAddress.Text; appointmentItemInfo.IsTel = CbIsTel.Checked; appointmentItemInfo.TelTitle = TbTelTitle.Text; appointmentItemInfo.Tel = TbTel.Text; if (_appointmentItemId > 0) { DataProviderWx.AppointmentItemDao.Update(appointmentItemInfo); Body.AddSiteLog(PublishmentSystemId, "修改预约项目", $"预约项目:{TbTitle.Text}"); } else { isAdd = true; _appointmentItemId = DataProviderWx.AppointmentItemDao.Insert(appointmentItemInfo); Body.AddSiteLog(PublishmentSystemId, "新增预约项目", $"预约项目:{TbTitle.Text}"); } string scripts = $"window.parent.addItem('{TbTitle.Text}', '{TbMapAddress.Text}','{TbTel.Text}','{PublishmentSystemId}','{_appointmentId}','{_appointmentItemId}','{isAdd}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } catch (Exception ex) { FailMessage(ex, "失败:" + ex.Message); } }
public override void Submit_OnClick(object sender, EventArgs e) { try { var isAdd = false; var appointmentItemInfo = new AppointmentItemInfo(); appointmentItemInfo.PublishmentSystemID = PublishmentSystemId; if (appointmentItemID > 0) { appointmentItemInfo = DataProviderWX.AppointmentItemDAO.GetItemInfo(appointmentItemID); } appointmentItemInfo.AppointmentID = appointmentID; appointmentItemInfo.Title = tbTitle.Text; appointmentItemInfo.TopImageUrl = topImageUrl.Value; appointmentItemInfo.IsDescription = cbIsDescription.Checked; appointmentItemInfo.DescriptionTitle = tbDescriptionTitle.Text; appointmentItemInfo.Description = tbDescription.Text; appointmentItemInfo.IsImageUrl = cbIsImageUrl.Checked; appointmentItemInfo.ImageUrlTitle = tbImageUrlTitle.Text; appointmentItemInfo.ImageUrl = tbContentImageUrl.Text; appointmentItemInfo.IsVideoUrl = cbIsVideoUrl.Checked; appointmentItemInfo.VideoUrlTitle = tbVideoUrlTitle.Text; appointmentItemInfo.VideoUrl = tbContentVideoUrl.Text; appointmentItemInfo.IsImageUrlCollection = cbIsImageUrlCollection.Checked; appointmentItemInfo.ImageUrlCollectionTitle = tbImageUrlCollectionTitle.Text; appointmentItemInfo.ImageUrlCollection = imageUrlCollection.Value; appointmentItemInfo.LargeImageUrlCollection = largeImageUrlCollection.Value; appointmentItemInfo.IsMap = cbIsMap.Checked; appointmentItemInfo.MapTitle = tbMapTitle.Text; appointmentItemInfo.MapAddress = tbMapAddress.Text; appointmentItemInfo.IsTel = cbIsTel.Checked; appointmentItemInfo.TelTitle = tbTelTitle.Text; appointmentItemInfo.Tel = tbTel.Text; if (appointmentItemID > 0) { DataProviderWX.AppointmentItemDAO.Update(appointmentItemInfo); Body.AddLog(PublishmentSystemId, "修改预约项目", $"预约项目:{tbTitle.Text}"); } else { isAdd = true; appointmentItemID = DataProviderWX.AppointmentItemDAO.Insert(appointmentItemInfo); Body.AddLog(PublishmentSystemId, "新增预约项目", $"预约项目:{tbTitle.Text}"); } string scripts = $"window.parent.addItem('{tbTitle.Text}', '{tbMapAddress.Text}','{tbTel.Text}','{PublishmentSystemId}','{appointmentID}','{appointmentItemID}','{isAdd.ToString()}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } catch (Exception ex) { FailMessage(ex, "失败:" + ex.Message); } }
public override void Submit_OnClick(object sender, EventArgs e) { var isChanged = false; try { var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _nodeId); nodeInfo.Additional.SigninPriority = TranslateUtils.ToInt(Priority.SelectedValue); nodeInfo.Additional.SigninEndDate = EndDate.Text; if (TypeList.SelectedValue == "Group") { var GroupID = ""; for (var i = 0; i < GroupIDList.Items.Count; i++) { if (GroupIDList.Items[i].Selected) { GroupID += GroupIDList.Items[i].Value + ","; //用户组列表 } } nodeInfo.Additional.SigninUserGroupCollection = GroupID.TrimEnd(','); nodeInfo.Additional.SigninUserNameCollection = ""; nodeInfo.Additional.IsSigninGroup = true; } else if (TypeList.SelectedValue == "User") { nodeInfo.Additional.SigninUserGroupCollection = ""; nodeInfo.Additional.SigninUserNameCollection = UserNameList.Text.Trim(); nodeInfo.Additional.IsSigninGroup = false; } DataProvider.NodeDao.UpdateNodeInfo(nodeInfo); isChanged = true; } catch (Exception ex) { FailMessage(ex, ex.Message); isChanged = false; } if (isChanged) { PageUtils.CloseModalPageWithoutRefresh(Page, "alert('内容签收设置成功!');"); } }
public override void Submit_OnClick(object sender, EventArgs e) { var width = TranslateUtils.ToInt(TbWidth.Text); var height = TranslateUtils.ToInt(TbHeight.Text); if (width > 0 && height > 0 && (width != PublishmentSystemInfo.Additional.ConfigVideoContentInsertWidth || height != PublishmentSystemInfo.Additional.ConfigVideoContentInsertHeight)) { PublishmentSystemInfo.Additional.ConfigVideoContentInsertWidth = width; PublishmentSystemInfo.Additional.ConfigVideoContentInsertHeight = height; DataProvider.PublishmentSystemDao.Update(PublishmentSystemInfo); } var playUrl = TbPlayUrl.Text; var script = "parent." + ETextEditorTypeUtils.GetInsertVideoScript(_attributeName, playUrl, width, height, CbIsAutoPlay.Checked); PageUtils.CloseModalPageWithoutRefresh(Page, script); }
public void Page_Load(object sender, EventArgs e) { _additional.Add("UrlFormatString", PageUtils.GetAdminUrl(nameof(ModalDepartmentSelect), null)); if (!IsPostBack) { if (Body.IsQueryExists("DepartmentID")) { var departmentId = Body.GetQueryInt("DepartmentID"); var departmentName = DepartmentManager.GetDepartmentName(departmentId); string scripts = $"window.parent.showCategoryDepartment('{departmentName}', '{departmentId}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { ClientScriptRegisterClientScriptBlock("NodeTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.DepartmentSelect, _additional)); BindGrid(); } } }
public override void Submit_OnClick(object sender, EventArgs e) { var userNameArrayList = TranslateUtils.StringCollectionToStringList(Request.Form["UserNameCollection"]); if (userNameArrayList.Count == 0) { FailMessage("请勾选所需用户"); } else { PageUtils.CloseModalPageWithoutRefresh(Page, $@" var textBox = parent.$('#{_textBoxId}'); if (textBox.val()){{ textBox.val(textBox.val() + ',{Request.Form["UserNameCollection"]}'); }}else{{ textBox.val('{Request.Form["UserNameCollection"]}'); }} "); } }
public override void Submit_OnClick(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.Form["IDsCollection"])) { var builder = new StringBuilder(); foreach (var pair in TranslateUtils.StringCollectionToStringList(Request.Form["IDsCollection"])) { var channelId = TranslateUtils.ToInt(pair.Split('_')[0]); var contentId = TranslateUtils.ToInt(pair.Split('_')[1]); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, channelId); var title = BaiRongDataProvider.ContentDao.GetValue(tableName, contentId, ContentAttribute.Title); builder.Append($@"parent.{_jsMethod}('{title}', '{pair}');"); } PageUtils.CloseModalPageWithoutRefresh(Page, builder.ToString()); } else { PageUtils.CloseModalPageWithoutRefresh(Page); } }
public void Page_Load(object sender, EventArgs e) { _departmentId = Body.GetQueryInt("departmentID"); _scriptName = Body.GetQueryString("ScriptName"); var url = PageUtils.GetAdminUrl(nameof(ModalAdminSelect), new NameValueCollection { { "scriptName", _scriptName } }); _additional.Add("UrlFormatString", url); if (!IsPostBack) { ltlDepartment.Text = "管理员列表"; if (Body.IsQueryExists("UserName")) { var userName = Body.GetQueryString("UserName"); var displayName = AdminManager.GetDisplayName(userName, true); string scripts = $"window.parent.{_scriptName}('{displayName}', '{userName}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else if (Body.IsQueryExists("departmentID")) { if (_departmentId > 0) { ltlDepartment.Text = DepartmentManager.GetDepartmentName(_departmentId); rptUser.DataSource = BaiRongDataProvider.AdministratorDao.GetUserNameArrayList(_departmentId, false); rptUser.ItemDataBound += rptUser_ItemDataBound; rptUser.DataBind(); } } else { ClientScriptRegisterClientScriptBlock("NodeTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.DepartmentSelect, _additional)); } } BindGrid(); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (!IsPostBack) { if (Body.IsQueryExists("NodeID")) { var nodeId = TranslateUtils.ToInt(Request.QueryString["NodeID"]); var nodeNames = NodeManager.GetNodeNameNavigationByGovPublic(PublishmentSystemId, nodeId); string scripts = $"window.parent.showCategoryChannel('{nodeNames}', '{nodeId}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.GovPublicChannelAdd, null)); BindGrid(); } } }
public override void Submit_OnClick(object sender, EventArgs e) { var taskID = 0; var checkedLevel = TranslateUtils.ToIntWithNagetive(rblCheckType.SelectedValue); var isChecked = false; var isTask = false; if (checkedLevel >= PublishmentSystemInfo.CheckContentLevel) { isChecked = true; } else { isChecked = false; } var contentInfoArrayListToCheck = new List <ContentInfo>(); var idsDictionaryToCheck = new Dictionary <int, List <int> >(); foreach (var nodeID in _idsDictionary.Keys) { var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeID); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeID); var contentIDArrayList = _idsDictionary[nodeID]; var contentIDArrayListToCheck = new List <int>(); var checkedLevelOfUser = 0; var isCheckedOfUser = CheckManager.GetUserCheckLevel(Body.AdministratorName, PublishmentSystemInfo, nodeID, out checkedLevelOfUser); foreach (int contentID in contentIDArrayList) { var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentID); if (contentInfo != null) { if (LevelManager.IsCheckable(PublishmentSystemInfo, contentInfo.NodeId, contentInfo.IsChecked, contentInfo.CheckedLevel, isCheckedOfUser, checkedLevelOfUser)) { contentInfoArrayListToCheck.Add(contentInfo); contentIDArrayListToCheck.Add(contentID); } DataProvider.ContentDao.Update(tableName, PublishmentSystemInfo, contentInfo); if (contentInfo.IsChecked) { CreateManager.CreateContentAndTrigger(PublishmentSystemId, contentInfo.NodeId, contentID); } } } if (contentIDArrayListToCheck.Count > 0) { idsDictionaryToCheck[nodeID] = contentIDArrayListToCheck; } } if (contentInfoArrayListToCheck.Count == 0) { PageUtils.CloseModalPageWithoutRefresh(Page, "alert('您的审核权限不足,无法审核所选内容!');"); } else { try { var translateNodeID = TranslateUtils.ToInt(ddlTranslateNodeID.SelectedValue); foreach (int nodeID in idsDictionaryToCheck.Keys) { var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeID); var contentIDArrayList = idsDictionaryToCheck[nodeID]; BaiRongDataProvider.ContentDao.UpdateIsChecked(tableName, PublishmentSystemId, nodeID, contentIDArrayList, translateNodeID, true, Body.AdministratorName, isChecked, checkedLevel, tbCheckReasons.Text); DataProvider.NodeDao.UpdateContentNum(PublishmentSystemInfo, nodeID, true); } if (translateNodeID > 0) { DataProvider.NodeDao.UpdateContentNum(PublishmentSystemInfo, translateNodeID, true); } Body.AddSiteLog(PublishmentSystemId, PublishmentSystemId, 0, "设置内容状态为" + rblCheckType.SelectedItem.Text, tbCheckReasons.Text); if (isChecked) { foreach (int nodeID in idsDictionaryToCheck.Keys) { var contentIDArrayList = _idsDictionary[nodeID]; if (contentIDArrayList != null) { foreach (int contentID in contentIDArrayList) { CreateManager.CreateContent(PublishmentSystemId, nodeID, contentID); } } } } PageUtils.CloseModalPageAndRedirect(Page, _returnUrl); } catch (Exception ex) { FailMessage(ex, "操作失败!"); } } }
public override void Submit_OnClick(object sender, EventArgs e) { try { var idsCollection = Request.Form["IDsCollection"]; if (string.IsNullOrEmpty(idsCollection)) { FailMessage("操作失败,请选择需要显示的内容"); return; } if (_isKeywordAdd) { if (_keywordId > 0) { var idsList = TranslateUtils.StringCollectionToStringList(idsCollection); var resourceId = 0; foreach (var ids in idsList) { var nodeId = TranslateUtils.ToInt(ids.Split('_')[0]); var contentId = TranslateUtils.ToInt(ids.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); var resourceInfo = new KeywordResourceInfo(); resourceInfo.ResourceId = 0; resourceInfo.PublishmentSystemId = PublishmentSystemId; resourceInfo.KeywordId = _keywordId; resourceInfo.Title = contentInfo.Title; resourceInfo.ImageUrl = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.ImageUrl); resourceInfo.Summary = MPUtils.GetSummary(contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Summary), contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content)); resourceInfo.ResourceType = EResourceType.Site; resourceInfo.IsShowCoverPic = false; resourceInfo.Content = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content); resourceInfo.NavigationUrl = string.Empty; resourceInfo.ChannelId = contentInfo.NodeId; resourceInfo.ContentId = contentInfo.Id; resourceInfo.Taxis = 0; var id = DataProviderWx.KeywordResourceDao.Insert(resourceInfo); if (resourceId == 0) { resourceId = id; } } var redirectUrl = PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId, _keywordId, resourceId, !_isMultiple); PageUtils.CloseModalPageAndRedirect(Page, redirectUrl); } } else { var scripts = string.Empty; if (_isMultiple) { var titleBuilder = new StringBuilder(); var idsList = TranslateUtils.StringCollectionToStringList(idsCollection); foreach (var ids in idsList) { var nodeId = TranslateUtils.ToInt(ids.Split('_')[0]); var contentId = TranslateUtils.ToInt(ids.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); titleBuilder.AppendFormat("{0} <a href='{1}' target='blank'>查看</a><br />", contentInfo.Title, PageUtilityWX.GetContentUrl(PublishmentSystemInfo, contentInfo)); } scripts = $@"window.parent.{_jsMethod}(""{idsCollection}"", ""{titleBuilder}"");"; } else { var nodeId = TranslateUtils.ToInt(idsCollection.Split('_')[0]); var contentId = TranslateUtils.ToInt(idsCollection.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); var imageUrl = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.ImageUrl); var imageSrc = PageUtility.ParseNavigationUrl(PublishmentSystemInfo, imageUrl); var summary = MPUtils.GetSummary(contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Summary), contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content)); var pageUrl = PageUtilityWX.GetContentUrl(PublishmentSystemInfo, contentInfo); scripts = $@"window.parent.{_jsMethod}(""{contentInfo.Title}"", ""{nodeId}"", ""{contentId}"", ""{pageUrl}"", ""{imageUrl}"", ""{imageSrc}"", ""{summary}"");"; if (Request.QueryString["itemIndex"] != null) { scripts = $@"window.parent.{_jsMethod}({_itemIndex}, ""{contentInfo.Title}"", {nodeId}, {contentId});"; } } PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } } catch (Exception ex) { FailMessage(ex, "失败:" + ex.Message); } }
public override void Submit_OnClick(object sender, EventArgs e) { string scripts = $"window.parent.document.all.{_textBoxClientId}.value = '{tbRule.Text}';"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); }
private void Save(bool isClose) { var isSuccess = false; var errorMessage = string.Empty; var content = TranslateUtils.ToBool(IsPureText.SelectedValue) ? FileContentTextBox.Text : FileContent.Text; if (_isCreate == false) { string filePath; var fileExtName = PathUtils.GetExtension(_theFileName); if (!PathUtility.IsFileExtenstionAllowed(PublishmentSystemInfo, fileExtName)) { FailMessage("此格式不允许创建,请选择有效的文件名"); return; } if (PublishmentSystemInfo != null) { filePath = PathUtility.MapPath(PublishmentSystemInfo, PathUtils.Combine(_relatedPath, _theFileName)); } else { filePath = PathUtils.MapPath(PathUtils.Combine(_relatedPath, _theFileName)); } try { try { if (!string.IsNullOrEmpty(Charset.SelectedValue)) { _fileCharset = ECharsetUtils.GetEnumType(Charset.SelectedValue); } FileUtils.WriteText(filePath, _fileCharset, content); } catch { FileUtils.RemoveReadOnlyAndHiddenIfExists(filePath); FileUtils.WriteText(filePath, _fileCharset, content); } Body.AddSiteLog(PublishmentSystemId, "新建文件", $"文件名:{_theFileName}"); isSuccess = true; } catch (Exception ex) { errorMessage = ex.Message; } } else { string filePath; var fileExtName = PathUtils.GetExtension(FileName.Text); if (!PathUtility.IsFileExtenstionAllowed(PublishmentSystemInfo, fileExtName)) { FailMessage("此格式不允许创建,请选择有效的文件名"); return; } if (PublishmentSystemInfo != null) { filePath = PathUtility.MapPath(PublishmentSystemInfo, PathUtils.Combine(_relatedPath, FileName.Text)); } else { filePath = PathUtils.MapPath(PathUtils.Combine(_relatedPath, FileName.Text)); } if (FileUtils.IsFileExists(filePath)) { errorMessage = "文件名已存在!"; } else { try { try { FileUtils.WriteText(filePath, _fileCharset, content); } catch { FileUtils.RemoveReadOnlyAndHiddenIfExists(filePath); FileUtils.WriteText(filePath, _fileCharset, content); } Body.AddSiteLog(PublishmentSystemId, "编辑文件", $"文件名:{_theFileName}"); isSuccess = true; } catch (Exception ex) { errorMessage = ex.Message; } } } if (isSuccess) { if (isClose) { if (_isCreate) { PageUtils.CloseModalPage(Page); } else { PageUtils.CloseModalPageWithoutRefresh(Page); } } else { SuccessMessage("文件保存成功!"); } } else { FailMessage(errorMessage); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _isPublishmentSystemSelect = Body.GetQueryBool("isPublishmentSystemSelect"); _jsMethod = Body.GetQueryString("jsMethod"); _targetPublishmentSystemId = Body.GetQueryInt("TargetPublishmentSystemID"); if (_targetPublishmentSystemId == 0) { _targetPublishmentSystemId = PublishmentSystemId; } if (!IsPostBack) { PhPublishmentSystemId.Visible = _isPublishmentSystemSelect; var publishmentSystemIdList = ProductPermissionsManager.Current.PublishmentSystemIdList; var mySystemInfoArrayList = new ArrayList(); var parentWithChildren = new Hashtable(); foreach (var publishmentSystemId in publishmentSystemIdList) { var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); if (publishmentSystemInfo.ParentPublishmentSystemId == 0) { mySystemInfoArrayList.Add(publishmentSystemInfo); } else { var children = new ArrayList(); if (parentWithChildren.Contains(publishmentSystemInfo.ParentPublishmentSystemId)) { children = (ArrayList)parentWithChildren[publishmentSystemInfo.ParentPublishmentSystemId]; } children.Add(publishmentSystemInfo); parentWithChildren[publishmentSystemInfo.ParentPublishmentSystemId] = children; } } foreach (PublishmentSystemInfo publishmentSystemInfo in mySystemInfoArrayList) { AddSite(DdlPublishmentSystemId, publishmentSystemInfo, parentWithChildren, 0); } ControlUtils.SelectListItems(DdlPublishmentSystemId, _targetPublishmentSystemId.ToString()); var targetNodeId = Body.GetQueryInt("TargetNodeID"); if (targetNodeId > 0) { var siteName = PublishmentSystemManager.GetPublishmentSystemInfo(_targetPublishmentSystemId).PublishmentSystemName; var nodeNames = NodeManager.GetNodeNameNavigation(_targetPublishmentSystemId, targetNodeId); if (_targetPublishmentSystemId != PublishmentSystemId) { nodeNames = siteName + ":" + nodeNames; } string value = $"{_targetPublishmentSystemId}_{targetNodeId}"; if (!_isPublishmentSystemSelect) { value = targetNodeId.ToString(); } string scripts = $"window.parent.{_jsMethod}('{nodeNames}', '{value}');"; PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } else { var nodeInfo = NodeManager.GetNodeInfo(_targetPublishmentSystemId, _targetPublishmentSystemId); var linkUrl = GetRedirectUrl(_targetPublishmentSystemId.ToString(), _targetPublishmentSystemId.ToString()); LtlChannelName.Text = $"<a href='{linkUrl}'>{nodeInfo.NodeName}</a>"; var additional = new NameValueCollection { ["linkUrl"] = GetRedirectUrl(_targetPublishmentSystemId.ToString(), string.Empty) }; ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemManager.GetPublishmentSystemInfo(_targetPublishmentSystemId), ELoadingType.ChannelSelect, additional)); RptChannel.DataSource = DataProvider.NodeDao.GetNodeIdListByParentId(_targetPublishmentSystemId, _targetPublishmentSystemId); RptChannel.ItemDataBound += RptChannel_ItemDataBound; RptChannel.DataBind(); } } }
public void Cancel_OnClick(object sender, EventArgs e) { PageUtils.CloseModalPageWithoutRefresh(Page); }
public override void Submit_OnClick(object sender, EventArgs e) { var displayAttributes = ControlUtils.SelectedItemsValueToStringCollection(DisplayAttributeCheckBoxList.Items); if (_tableStyle == ETableStyle.Channel) { if (!_isList) { if (DisplayAttributeCheckBoxList.Items.Count == 0) { FailMessage("必须至少选择一项!"); return; } PublishmentSystemInfo.Additional.ChannelEditAttributes = displayAttributes; Body.AddSiteLog(PublishmentSystemId, "设置栏目编辑项", $"编辑项:{displayAttributes}"); } else { if (!CompareUtils.Contains(displayAttributes, NodeAttribute.ChannelName)) { FailMessage("必须选择栏目名称项!"); return; } if (!CompareUtils.Contains(displayAttributes, NodeAttribute.ChannelIndex)) { FailMessage("必须选择栏目索引项!"); return; } PublishmentSystemInfo.Additional.ChannelDisplayAttributes = displayAttributes; Body.AddSiteLog(PublishmentSystemId, "设置栏目显示项", $"显示项:{displayAttributes}"); } DataProvider.PublishmentSystemDao.Update(PublishmentSystemInfo); } else if (ETableStyleUtils.IsContent(_tableStyle)) { var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _relatedIdentity); var attributesOfDisplay = ControlUtils.SelectedItemsValueToStringCollection(DisplayAttributeCheckBoxList.Items); nodeInfo.Additional.ContentAttributesOfDisplay = attributesOfDisplay; DataProvider.NodeDao.UpdateNodeInfo(nodeInfo); Body.AddSiteLog(PublishmentSystemId, "设置内容显示项", $"显示项:{attributesOfDisplay}"); } else if (_tableStyle == ETableStyle.InputContent) { var inputInfo = DataProvider.InputDao.GetInputInfo(_relatedIdentity); var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, DataProvider.InputContentDao.TableName, _relatedIdentities); var selectedValues = ControlUtils.GetSelectedListControlValueArrayList(DisplayAttributeCheckBoxList); foreach (var styleInfo in styleInfoList) { if (_isList) { styleInfo.IsVisibleInList = selectedValues.Contains(styleInfo.AttributeName); } else { styleInfo.IsVisible = selectedValues.Contains(styleInfo.AttributeName); } styleInfo.RelatedIdentity = _relatedIdentity; if (styleInfo.TableStyleId == 0) { TableStyleManager.Insert(styleInfo, _tableStyle); } else { TableStyleManager.Update(styleInfo); } } if (_isList) { Body.AddSiteLog(PublishmentSystemId, "设置提交表单显示项", $"表单名称:{inputInfo.InputName},显示项:{TranslateUtils.ObjectCollectionToString(selectedValues)}"); } else { Body.AddSiteLog(PublishmentSystemId, "设置提交表单编辑项", $"表单名称:{inputInfo.InputName},编辑项:{TranslateUtils.ObjectCollectionToString(selectedValues)}"); } } if (!_isList) { PageUtils.CloseModalPageWithoutRefresh(Page); } else { PageUtils.CloseModalPage(Page); } }