public async Task <ActionResult> ApplyViewPromocionProduct(int?idProd, int?idPromo) { var result = await Utils.PrepareDataPage("ProductPage", "~/Content/rsc/imgs", "PreviewProduct", new ProductPagePreview { ProductPageName = "PreviewProduct", ProductPageId = idProd, PromocionPageId = idPromo }, FileType.Image, FillDataTextProductPage, FillDataImageProductPage); if (result.Key) { PagePreview productPromocion = await db.PagePreviews.FindAsync("PreviewProduct"); var str = new MemoryStream(productPromocion.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as ProductPagePreview; if (preview != null) { var page = await GetProductPagePreview(preview); if (preview.ProductPageId == 0) { db.ProductPages.Add(page); } else { db.Entry(page).State = EntityState.Modified; } await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("SaDPage", "~/Content/rsc/imgs", "PreviewSaD", new SaDPagePreview { SaDPageName = "PreviewSaD" }, FileType.Image, FillDataTextSaDPage, FillDataImageSaDPage); if (result.Key) { PagePreview previewSaD = await db.PagePreviews.FindAsync("PreviewSaD"); var str = new MemoryStream(previewSaD.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as SaDPagePreview; if (preview != null) { var SaDPageActive = await GetActiveSaDPage(); var lastIdSaDPage = await db.SaDPages.MaxAsync(x => x.SaDPageId) + 1; var SaDPageEdit = GetSaDPagePreview(SaDPageActive, preview, lastIdSaDPage); db.SaDPages.Add(SaDPageEdit); await db.SaveChangesAsync(); SaDPageActive.SaDPageActive = false; db.Entry(SaDPageActive).State = EntityState.Modified; await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("BlogPage", "~/Content/rsc/imgs", "PreviewBlog", new BlogPagePreview { BlogPageName = "PreviewBlog" }, FileType.ImagePdf, FillDataTextBlogPage, FillDataImageBlogPage); if (result.Key) { PagePreview previewBlog = await db.PagePreviews.FindAsync("PreviewBlog"); var str = new MemoryStream(previewBlog.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as BlogPagePreview; if (preview != null) { var BlogPagePreview = await GetBlogPagePreview(preview); db.BlogPages.Add(BlogPagePreview); await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("BillingPage", "~/Content/rsc/imgs", "PreviewBilling", new BillingPagePreview { BillingPageName = "PreviewBilling" }, FileType.Image, FillDataTextCardPage, FillDataImageCardPage); if (result.Key) { PagePreview previewBilling = await db.PagePreviews.FindAsync("PreviewBilling"); var str = new MemoryStream(previewBilling.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as BillingPagePreview; if (preview != null) { var BillingPageActive = await GetActiveBillingPage(); var lastIdBillingPage = await db.BillingPages.MaxAsync(x => x.BillingPageId) + 1; var lastIdLab = await db.LabSections.MaxAsync(x => x.LabSectionId); var lastIdBenefict = await db.BenefitSections.MaxAsync(x => x.BenefitSectionId); var lastIdIncrementBenefit = await db.IncrementBenefitSections.MaxAsync(x => x.IncrementBenefitSectionId); var BillingPageEdit = GetBillingPagePreview(BillingPageActive, preview, lastIdBillingPage, lastIdBenefict, lastIdIncrementBenefit, lastIdLab); var id = db.BillingPages.Add(BillingPageEdit); await db.SaveChangesAsync(); foreach (var h in BillingPageEdit.HeadImages) { h.ImageSectionPageId = id.BillingPageId; db.ImageSections.Add(h); } await db.SaveChangesAsync(); foreach (var h in BillingPageEdit.LabSection.ImageSections) { h.ImageSectionPageId = id.LabSectionId; db.ImageSections.Add(h); } await db.SaveChangesAsync(); BillingPageActive.BillingPageActive = false; db.Entry(BillingPageActive).State = EntityState.Modified; await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public void Page_Load(object sender, EventArgs e) { var type = Request["type"]; if (type == "DynamicPage") { var redirectUrl = PagePreview.GetRedirectUrl(PublishmentSystemId, 0, 0, 0, 0); PageUtils.Redirect(redirectUrl); } }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("HomePage", "~/Content/rsc/imgs", "PreviewHome", new HomePagePreview { HomePageName = "PreviewHome" }, FileType.Image, FillDataTextHomePage, FillDataImageHomePage); if (result.Key) { PagePreview previewHome = await db.PagePreviews.FindAsync("PreviewHome"); var str = new MemoryStream(previewHome.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as HomePagePreview; if (preview != null) { var homePageActive = await GetActiveHomePage(); var lastIdHomePage = await db.HomePages.MaxAsync(x => x.HomePageId) + 1; var lastIdProduct = await db.Products.MaxAsync(x => x.ProductId); var lastIdTitle = await db.TitleTypes.MaxAsync(x => x.TitleTypeId); var lastIdOffer = await db.OfferSections.MaxAsync(x => x.OfferSectionId); var lastIdCard = await db.CardSections.MaxAsync(x => x.CardSectionId); var lastIdMakeup = await db.FoseSections.MaxAsync(x => x.FoseSectionId); var lastIdBlog = await db.BlogSections.MaxAsync(x => x.BlogSectionId); var homePageEdit = GetHomePagePreview(homePageActive, preview, lastIdHomePage, lastIdProduct, lastIdTitle, lastIdOffer, lastIdCard, lastIdMakeup, lastIdBlog); var id = db.HomePages.Add(homePageEdit); await db.SaveChangesAsync(); foreach (var h in homePageEdit.HeadImages) { h.ImageSectionPageId = id.HomePageId; db.ImageSections.Add(h); } await db.SaveChangesAsync(); homePageActive.HomePageActive = false; db.Entry(homePageActive).State = EntityState.Modified; await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("BranchPage", "~/UploadedFiles", "PreviewBranch", new BranchPagePreview { BranchPageName = "PreviewBranch" }, FileType.Image, FillDataTextBranchPage, null); if (result.Key) { PagePreview previewBranch = await db.PagePreviews.FindAsync("PreviewBranch"); var str = new MemoryStream(previewBranch.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as BranchPagePreview; if (preview != null) { var BranchPageActive = await GetActiveBranchPage(); var lastIdBranchPage = await db.BranchPages.MaxAsync(x => x.BranchPageId) + 1; var BranchPageEdit = await GetBranchPagePreview(BranchPageActive, preview, lastIdBranchPage); var id = db.BranchPages.Add(BranchPageEdit); await db.SaveChangesAsync(); foreach (var h in BranchPageEdit.HeadImages) { h.ImageSectionPageId = id.BranchPageId; db.ImageSections.Add(h); } await db.SaveChangesAsync(); BranchPageActive.BranchPageActive = false; db.Entry(BranchPageActive).State = EntityState.Modified; await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> ApplyViewNews(int?idNews, int?idBlog) { var result = await Utils.PrepareDataPage("NewsPage", "~/Content/rsc/imgs", "PreviewNews", new NewsPagePreview { NewsPageName = "PreviewNews", NewsPageId = idNews }, FileType.Image, FillDataTextNewsPage, FillDataImageNewsPage); if (result.Key) { PagePreview previewNews = await db.PagePreviews.FindAsync("PreviewNews"); var str = new MemoryStream(previewNews.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as NewsPagePreview; if (preview != null) { var NewsPageEdit = await GetNewsPagePreview(preview); if (idNews == 0) { if (idBlog != null) { NewsPageEdit.BlogPageId = idBlog.Value; } db.NewsPages.Add(NewsPageEdit); } else { db.Entry(NewsPageEdit).State = EntityState.Modified; } await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); }
private void InitializeComponent() { this.groupbox_paper = new System.Windows.Forms.GroupBox(); this.combobox_source = new System.Windows.Forms.ComboBox(); this.combobox_size = new System.Windows.Forms.ComboBox(); this.label_source = new System.Windows.Forms.Label(); this.label_size = new System.Windows.Forms.Label(); this.groupbox_orientation = new System.Windows.Forms.GroupBox(); this.radio_landscape = new System.Windows.Forms.RadioButton(); this.radio_portrait = new System.Windows.Forms.RadioButton(); this.groupbox_margin = new System.Windows.Forms.GroupBox(); this.label_left = new System.Windows.Forms.Label(); this.button_ok = new System.Windows.Forms.Button(); this.button_cancel = new System.Windows.Forms.Button(); this.button_printer = new System.Windows.Forms.Button(); this.label_top = new System.Windows.Forms.Label(); this.label_right = new System.Windows.Forms.Label(); this.label_bottom = new System.Windows.Forms.Label(); this.textbox_left = new System.Windows.Forms.NumericTextBox(); this.textbox_top = new System.Windows.Forms.NumericTextBox(); this.textbox_right = new System.Windows.Forms.NumericTextBox(); this.textbox_bottom = new System.Windows.Forms.NumericTextBox(); this.pagePreview = new PagePreview(); this.groupbox_paper.SuspendLayout(); this.groupbox_orientation.SuspendLayout(); this.groupbox_margin.SuspendLayout(); form.SuspendLayout(); // // groupbox_paper // this.groupbox_paper.Controls.Add(this.combobox_source); this.groupbox_paper.Controls.Add(this.combobox_size); this.groupbox_paper.Controls.Add(this.label_source); this.groupbox_paper.Controls.Add(this.label_size); this.groupbox_paper.Location = new System.Drawing.Point(12, 157); this.groupbox_paper.Name = "groupbox_paper"; this.groupbox_paper.Size = new System.Drawing.Size(336, 90); this.groupbox_paper.TabIndex = 0; this.groupbox_paper.TabStop = false; this.groupbox_paper.Text = "Paper"; // // combobox_source // this.combobox_source.Location = new System.Drawing.Point(84, 54); this.combobox_source.Name = "combobox_source"; this.combobox_source.Size = new System.Drawing.Size(240, 21); this.combobox_source.TabIndex = 3; // // combobox_size // this.combobox_size.ItemHeight = 13; this.combobox_size.Location = new System.Drawing.Point(84, 22); this.combobox_size.Name = "combobox_size"; this.combobox_size.Size = new System.Drawing.Size(240, 21); this.combobox_size.TabIndex = 2; this.combobox_size.SelectedIndexChanged += new EventHandler(this.OnPaperSizeChange); // // label_source // this.label_source.Location = new System.Drawing.Point(13, 58); this.label_source.Name = "label_source"; this.label_source.Size = new System.Drawing.Size(48, 16); this.label_source.TabIndex = 1; this.label_source.Text = "&Source:"; // // label_size // this.label_size.Location = new System.Drawing.Point(13, 25); this.label_size.Name = "label_size"; this.label_size.Size = new System.Drawing.Size(52, 16); this.label_size.TabIndex = 0; this.label_size.Text = "Si&ze:"; // // groupbox_orientation // this.groupbox_orientation.Controls.Add(this.radio_landscape); this.groupbox_orientation.Controls.Add(this.radio_portrait); this.groupbox_orientation.Location = new System.Drawing.Point(12, 255); this.groupbox_orientation.Name = "groupbox_orientation"; this.groupbox_orientation.Size = new System.Drawing.Size(96, 90); this.groupbox_orientation.TabIndex = 1; this.groupbox_orientation.TabStop = false; this.groupbox_orientation.Text = "Orientation"; // // radio_landscape // this.radio_landscape.Location = new System.Drawing.Point(13, 52); this.radio_landscape.Name = "radio_landscape"; this.radio_landscape.Size = new System.Drawing.Size(80, 24); this.radio_landscape.TabIndex = 7; this.radio_landscape.Text = "L&andscape"; this.radio_landscape.CheckedChanged += new EventHandler(this.OnLandscapeChange); // // radio_portrait // this.radio_portrait.Location = new System.Drawing.Point(13, 19); this.radio_portrait.Name = "radio_portrait"; this.radio_portrait.Size = new System.Drawing.Size(72, 24); this.radio_portrait.TabIndex = 6; this.radio_portrait.Text = "P&ortrait"; // // groupbox_margin // this.groupbox_margin.Controls.Add(this.textbox_bottom); this.groupbox_margin.Controls.Add(this.textbox_right); this.groupbox_margin.Controls.Add(this.textbox_top); this.groupbox_margin.Controls.Add(this.textbox_left); this.groupbox_margin.Controls.Add(this.label_bottom); this.groupbox_margin.Controls.Add(this.label_right); this.groupbox_margin.Controls.Add(this.label_top); this.groupbox_margin.Controls.Add(this.label_left); this.groupbox_margin.Location = new System.Drawing.Point(120, 255); this.groupbox_margin.Name = "groupbox_margin"; this.groupbox_margin.Size = new System.Drawing.Size(228, 90); this.groupbox_margin.TabIndex = 2; this.groupbox_margin.TabStop = false; this.groupbox_margin.Text = LocalizedLengthUnit(); // // label_left // this.label_left.Location = new System.Drawing.Point(11, 25); this.label_left.Name = "label_left"; this.label_left.Size = new System.Drawing.Size(40, 23); this.label_left.TabIndex = 0; this.label_left.Text = "&Left:"; // // button_ok // this.button_ok.Location = new System.Drawing.Point(120, 358); this.button_ok.Name = "button_ok"; this.button_ok.Size = new System.Drawing.Size(72, 23); this.button_ok.TabIndex = 3; this.button_ok.Text = "OK"; this.button_ok.Click += new EventHandler(OnClickOkButton); // // button_cancel // this.button_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button_cancel.Location = new System.Drawing.Point(198, 358); this.button_cancel.Name = "button_cancel"; this.button_cancel.Size = new System.Drawing.Size(72, 23); this.button_cancel.TabIndex = 4; this.button_cancel.Text = "Cancel"; // // button_printer // this.button_printer.Location = new System.Drawing.Point(276, 358); this.button_printer.Name = "button_printer"; this.button_printer.Size = new System.Drawing.Size(72, 23); this.button_printer.TabIndex = 5; this.button_printer.Text = "&Printer..."; this.button_printer.Click += new EventHandler(OnClickPrinterButton); // // label_top // this.label_top.Location = new System.Drawing.Point(11, 57); this.label_top.Name = "label_top"; this.label_top.Size = new System.Drawing.Size(40, 23); this.label_top.TabIndex = 1; this.label_top.Text = "&Top:"; // // label_right // this.label_right.Location = new System.Drawing.Point(124, 25); this.label_right.Name = "label_right"; this.label_right.Size = new System.Drawing.Size(40, 23); this.label_right.TabIndex = 2; this.label_right.Text = "&Right:"; // // label_bottom // this.label_bottom.Location = new System.Drawing.Point(124, 57); this.label_bottom.Name = "label_bottom"; this.label_bottom.Size = new System.Drawing.Size(40, 23); this.label_bottom.TabIndex = 3; this.label_bottom.Text = "&Bottom:"; // // textbox_left // this.textbox_left.Location = new System.Drawing.Point(57, 21); this.textbox_left.Name = "textbox_left"; this.textbox_left.Size = new System.Drawing.Size(48, 20); this.textbox_left.TabIndex = 4; this.textbox_left.TextChanged += new EventHandler(OnMarginChange); // // textbox_top // this.textbox_top.Location = new System.Drawing.Point(57, 54); this.textbox_top.Name = "textbox_top"; this.textbox_top.Size = new System.Drawing.Size(48, 20); this.textbox_top.TabIndex = 5; this.textbox_top.TextChanged += new EventHandler(OnMarginChange); // // textbox_right // this.textbox_right.Location = new System.Drawing.Point(171, 21); this.textbox_right.Name = "textbox_right"; this.textbox_right.Size = new System.Drawing.Size(48, 20); this.textbox_right.TabIndex = 6; this.textbox_right.TextChanged += new EventHandler(OnMarginChange); // // textbox_bottom // this.textbox_bottom.Location = new System.Drawing.Point(171, 54); this.textbox_bottom.Name = "textbox_bottom"; this.textbox_bottom.Size = new System.Drawing.Size(48, 20); this.textbox_bottom.TabIndex = 7; this.textbox_bottom.TextChanged += new EventHandler(OnMarginChange); // // pagePreview // this.pagePreview.Location = new System.Drawing.Point(130, 10); this.pagePreview.Name = "pagePreview"; this.pagePreview.Size = new System.Drawing.Size(150, 150); this.pagePreview.TabIndex = 6; // // Form3 // form.AcceptButton = this.button_ok; form.AutoScaleBaseSize = new System.Drawing.Size(5, 13); form.CancelButton = this.button_cancel; form.ClientSize = new System.Drawing.Size(360, 390); form.Controls.Add(this.pagePreview); form.Controls.Add(this.button_printer); form.Controls.Add(this.button_cancel); form.Controls.Add(this.button_ok); form.Controls.Add(this.groupbox_margin); form.Controls.Add(this.groupbox_orientation); form.Controls.Add(this.groupbox_paper); form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; form.HelpButton = true; form.MaximizeBox = false; form.MinimizeBox = false; form.Name = "Form3"; form.ShowInTaskbar = false; form.Text = "Page Setup"; this.groupbox_paper.ResumeLayout(false); this.groupbox_orientation.ResumeLayout(false); this.groupbox_margin.ResumeLayout(false); form.ResumeLayout(false); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ReturnUrl"); var nodeId = Body.GetQueryInt("NodeID"); _nodeInfo = NodeManager.GetNodeInfo(1, nodeId); var contentId = Body.GetQueryInt("ID"); string contentType = WebUtils.GetContentType(_nodeInfo.ContentModelId); ReturnUrl = $@"/siteserver/cms/{contentType}.aspx?PublishmentSystemID=1&NodeId={nodeId}"; ReturnPUrl = $@"/siteserver/cms/{contentType}.aspx?PublishmentSystemID=1&NodeId={ (Body.GetQueryInt("PNodeID")==0? nodeId:Body.GetQueryInt("PNodeID"))}"; //ReturnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl")); _isAjaxSubmit = Body.GetQueryBool("isAjaxSubmit"); _isPreview = Body.GetQueryBool("isPreview"); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, _nodeInfo); //_tableName = "model_content"; _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId); ContentInfo contentInfo = null; if (_isAjaxSubmit == false) { if (contentId == 0) { if (_nodeInfo != null && _nodeInfo.Additional.IsContentAddable == false) { PageUtils.RedirectToErrorPage("此栏目不能添加内容!"); return; } if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentAdd)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } else { PageUtils.RedirectToErrorPage("您无此栏目的添加内容权限!"); return; } } } else { contentInfo = DataProvider.ContentDao.GetContentInfo(_tableStyle, _tableName, contentId); if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的修改内容权限!"); return; } } if (!IsPostBack) { var nodeNames = NodeManager.GetNodeNameNavigation(PublishmentSystemId, _nodeInfo.NodeId); var pageTitle = (contentId == 0) ? $"添加{ContentModelManager.GetContentModelInfo(PublishmentSystemInfo, _nodeInfo.ContentModelId).ModelName}" : $"编辑{ContentModelManager.GetContentModelInfo(PublishmentSystemInfo, _nodeInfo.ContentModelId).ModelName}"; BreadCrumbWithItemTitle(AppManager.Cms.LeftMenu.IdContent, pageTitle, nodeNames, string.Empty); LtlPageTitle.Text = pageTitle; LtlPageTitle.Text += $@" <script language=""javascript"" type=""text/javascript""> var previewUrl = '{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeInfo.NodeId, contentId, 0, 0)}'; </script> "; if (PublishmentSystemInfo.Additional.IsAutoSaveContent && PublishmentSystemInfo.Additional.AutoSaveContentInterval > 0) { LtlPageTitle.Text += $@" <input type=""hidden"" id=""savedContentID"" name=""savedContentID"" value=""{contentId}""> <script language=""javascript"" type=""text/javascript"">setInterval(""autoSave()"",{PublishmentSystemInfo.Additional.AutoSaveContentInterval*1000});</script> "; } //专题 if (contentId == 0) { var specialParentId = DataProvider.NodeDao.GetSpecialParentId(); NodeIdDic = new Dictionary <NodeInfo, List <NodeInfo> >(); if (nodeId != 0 && nodeId == specialParentId) { PhSpecial.Visible = true; PhCategory.Visible = true; var specialNodeIdList = DataProvider.NodeDao.GetNodeInfoListByParentId(1, specialParentId); List <NodeInfo> secondLevel = new List <NodeInfo>(); foreach (var nodeInfo in specialNodeIdList) { var secondChild = DataProvider.NodeDao.GetNodeInfoListByParentId(1, nodeInfo.NodeId); if (secondChild != null && secondChild.Count > 0) { NodeIdDic.Add(nodeInfo, secondChild); } } if (NodeIdDic != null && NodeIdDic.Count > 0) { KeyValuePair <NodeInfo, List <NodeInfo> > kv = NodeIdDic.First(); var defaultItem = new ListItem(kv.Key.NodeName, kv.Key.NodeId.ToString()); defaultItem.Selected = true; TbSpecial.Items.Add(defaultItem); foreach (var info in kv.Value) { TbCategory.Items.Add(new ListItem(info.NodeName, info.NodeId.ToString())); } foreach (var info in specialNodeIdList) { if (info.NodeId != kv.Key.NodeId) { TbSpecial.Items.Add(new ListItem(info.NodeName, info.NodeId.ToString())); } } } } else { //信息类型 var childSpecial = DataProvider.NodeDao.GetNodeInfoListByParentId(1, nodeId); if (childSpecial != null && childSpecial.Count > 0) { PhCategory.Visible = true; foreach (var nodeInfo in childSpecial) { var item = new ListItem(nodeInfo.NodeName, nodeInfo.NodeId.ToString()); TbCategory.Items.Add(item); } } } } else { PhSpecial.Visible = false; PhCategory.Visible = true; TbCategory.Items.Add(new ListItem(_nodeInfo.NodeName, _nodeInfo.NodeId.ToString())); //if (_nodeInfo.ParentsCount == 1) //{ // PhSpecial.Visible = false; // PhCategory.Visible = true; // TbSpecial.Items.Add(new ListItem(_nodeInfo.NodeName, _nodeInfo.NodeId.ToString())); //}else if(_nodeInfo.ParentsCount == 1) } //转移 if (AdminUtility.HasChannelPermissions(Body.AdministratorName, PublishmentSystemId, _nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate)) { PhTranslate.Visible = PublishmentSystemInfo.Additional.IsTranslate; DivTranslateAdd.Attributes.Add("onclick", ModalChannelMultipleSelect.GetOpenWindowString(PublishmentSystemId, true)); ETranslateContentTypeUtils.AddListItems(DdlTranslateType, true); ControlUtils.SelectListItems(DdlTranslateType, ETranslateContentTypeUtils.GetValue(ETranslateContentType.Copy)); } else { PhTranslate.Visible = false; } //内容属性 var excludeAttributeNames = TableManager.GetExcludeAttributeNames(_tableStyle); AcAttributes.AddExcludeAttributeNames(excludeAttributeNames); if (excludeAttributeNames.Count == 0) { PhContentAttributes.Visible = false; } else { PhContentAttributes.Visible = true; foreach (var attributeName in excludeAttributeNames) { var styleInfo = TableStyleManager.GetTableStyleInfo(_tableStyle, _tableName, attributeName, _relatedIdentities); if (styleInfo.IsVisible) { var listItem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName); if (contentId > 0) { listItem.Selected = TranslateUtils.ToBool(contentInfo?.GetExtendedAttribute(styleInfo.AttributeName)); } else { if (TranslateUtils.ToBool(styleInfo.DefaultValue)) { listItem.Selected = true; } } CblContentAttributes.Items.Add(listItem); } } } //内容组 var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId); if (!PublishmentSystemInfo.Additional.IsGroupContent || contentGroupNameList.Count == 0) { PhContentGroup.Visible = false; } else { foreach (var groupName in contentGroupNameList) { var item = new ListItem(groupName, groupName); if (contentId > 0) { item.Selected = StringUtils.In(contentInfo?.ContentGroupNameCollection, groupName); } CblContentGroupNameCollection.Items.Add(item); } } //标签 if (!PublishmentSystemInfo.Additional.IsRelatedByTags) { PhTags.Visible = false; } else { var tagScript = @" <script type=""text/javascript""> function getTags(tag){ $.get('[url]&tag=' + encodeURIComponent(tag) + '&r=' + Math.random(), function(data) { if(data !=''){ var arr = data.split('|'); var temp=''; for(i=0;i<arr.length;i++) { temp += '<li><a>'+arr[i].replace(tag,'<b>' + tag + '</b>') + '</a></li>'; } var myli='<ul>'+temp+'</ul>'; $('#tagTips').html(myli); $('#tagTips').show(); }else{ $('#tagTips').hide(); } $('#tagTips li').click(function () { var tag = $('#TbTags').val(); var i = tag.lastIndexOf(' '); if (i > 0) { tag = tag.substring(0, i) + ' ' + $(this).text(); }else{ tag = $(this).text(); } $('#TbTags').val(tag); $('#tagTips').hide(); }) }); } $(document).ready(function () { $('#TbTags').keyup(function (e) { if (e.keyCode != 40 && e.keyCode != 38) { var tag = $('#TbTags').val(); var i = tag.lastIndexOf(' '); if (i > 0){ tag = tag.substring(i + 1);} if (tag != '' && tag != ' '){ window.setTimeout(""getTags('"" + tag + ""');"", 200); }else{ $('#tagTips').hide(); } } }).blur(function () { window.setTimeout(""$('#tagTips').hide();"", 200); })}); </script> <div id=""tagTips"" class=""inputTips""></div> "; LtlTags.Text = tagScript.Replace("[url]", AjaxCmsService.GetTagsUrl(PublishmentSystemId)); } if (contentId == 0) { var formCollection = new NameValueCollection(); if (Body.IsQueryExists("isUploadWord")) { var isFirstLineTitle = Body.GetQueryBool("isFirstLineTitle"); var isFirstLineRemove = Body.GetQueryBool("isFirstLineRemove"); var isClearFormat = Body.GetQueryBool("isClearFormat"); var isFirstLineIndent = Body.GetQueryBool("isFirstLineIndent"); var isClearFontSize = Body.GetQueryBool("isClearFontSize"); var isClearFontFamily = Body.GetQueryBool("isClearFontFamily"); var isClearImages = Body.GetQueryBool("isClearImages"); var contentLevel = Body.GetQueryInt("contentLevel"); var fileName = Body.GetQueryString("fileName"); formCollection = WordUtils.GetWordNameValueCollection(PublishmentSystemId, _nodeInfo.ContentModelId, isFirstLineTitle, isFirstLineRemove, isClearFormat, isFirstLineIndent, isClearFontSize, isClearFontFamily, isClearImages, contentLevel, fileName); } AcAttributes.SetParameters(formCollection, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } else { AcAttributes.SetParameters(contentInfo?.Attributes, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); TbTags.Text = contentInfo?.Tags; } if (HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentCheck)) { PhStatus.Visible = true; int checkedLevel; var isChecked = CheckManager.GetUserCheckLevel(Body.AdministratorName, PublishmentSystemInfo, _nodeInfo.NodeId, out checkedLevel); if (Body.IsQueryExists("contentLevel")) { checkedLevel = TranslateUtils.ToIntWithNagetive(Body.GetQueryString("contentLevel")); if (checkedLevel != LevelManager.LevelInt.NotChange) { isChecked = checkedLevel >= PublishmentSystemInfo.CheckContentLevel; } } LevelManager.LoadContentLevelToEdit(RblContentLevel, PublishmentSystemInfo, nodeId, contentInfo, isChecked, checkedLevel); } else { PhStatus.Visible = false; } BtnSubmit.Attributes.Add("onclick", InputParserUtils.GetValidateSubmitOnClickScript("myForm", true, "autoCheckKeywords()")); //自动检测敏感词 ClientScriptRegisterStartupScript("autoCheckKeywords", WebUtils.GetAutoCheckKeywordsScript(PublishmentSystemInfo)); } else { AcAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, contentId != 0, IsPostBack); } DataBind(); } else { var success = false; string errorMessage; var savedContentId = SaveContentInfo(true, _isPreview, out errorMessage); if (savedContentId > 0) { success = true; } string jsonString = $@"{{success:'{success.ToString().ToLower()}',savedContentID:'{savedContentId}'}}"; PageUtils.ResponseToJson(jsonString); } }
public async Task <ActionResult> ApplyView(string v, string p) { var result = await Utils.PrepareDataPage("FosePage", "~/Content/rsc/imgs", "PreviewFose", new FosePagePreview { FosePageName = "PreviewFose" }, FileType.Image, FillDataTextFosePage, null); if (result.Key) { PagePreview previewFose = await db.PagePreviews.FindAsync("PreviewFose"); var str = new MemoryStream(previewFose.PageValue); var binaryFormatter = new BinaryFormatter(); var preview = binaryFormatter.Deserialize(str) as FosePagePreview; if (preview != null) { var FosePagePreview = await GetFosePagePreview(preview); var id = db.FosePages.Add(FosePagePreview); await db.SaveChangesAsync(); foreach (var fose in FosePagePreview.HeadImages) { fose.ImageSectionPageId = id.FosePageId; db.ImageSections.Add(fose); } await db.SaveChangesAsync(); return(Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet)); } } return(Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet)); //var result = await Utils.PrepareDataPage("FosePage", "~/Content/rsc/imgs", "PreviewFose", new FosePagePreview { FosePageName = "PreviewFose" }, FileType.Image, FillDataTextFosePage, null); //if (result.Key) //{ // PagePreview previewFose = await db.PagePreviews.FindAsync("PreviewFose"); // var str = new MemoryStream(previewFose.PageValue); // var binaryFormatter = new BinaryFormatter(); // var preview = binaryFormatter.Deserialize(str) as FosePagePreview; // if (preview != null) // { // var FosePageEdit = await GetFosePagePreview(preview); // var lastIdProduct = await db.Products.MaxAsync(x => x.ProductId) + 1; // var lastIdProductPage = await db.ProductPages.MaxAsync(x => x.ProductPageId) + 1; // var id = db.FosePages.Add(FosePageEdit); // await db.SaveChangesAsync(); // foreach (var fose in FosePageEdit.HeadImages) // { // fose.ImageSectionPageId = id.FosePageId; // db.ImageSections.Add(fose); // } // await db.SaveChangesAsync(); // foreach (var promocion in FosePageEdit.Promocions) // { // if(promocion.HeadImage.ImageSectionPageId > 0) // { // PromocionPage prom = await db.PromocionPages.FindAsync(promocion.HeadImage.ImageSectionPageId); // if(prom != null) // { // var i = 1; // foreach (var prod in prom.ProductPages) // { // var ProductPage = new ProductPage(); // ProductPage.ProductPageActive = "EnEdicion"; // ProductPage.ProductPageCreatedDate = DateTime.Now; // ProductPage.ProductPageCustomValue = $"ProductPage_{lastIdProductPage}"; // ProductPage.Product = new Product // { // ProductName = $"Product_{lastIdProduct++}", // ProductCustomValue = $"Product_Promocion_{lastIdProductPage++}", // ProductImage = prod.Product.ProductImage, // ProductOrder = i++, // ProductURL = "", // ProductSubtitle = prod.Product.ProductSubtitle, // }; // ProductPage.ProductPageBgColor = prod.ProductPageBgColor; // ProductPage.ProductPageTextTitle = prod.ProductPageTextTitle; // ProductPage.ProductPageColorTextTitle = prod.ProductPageColorTextTitle; // ProductPage.ProductPageTextDescription1 = prod.ProductPageTextDescription1; // ProductPage.ProductPageTextDescription2 = prod.ProductPageTextDescription2; // ProductPage.ProductPageTextCharacteristic1 = prod.ProductPageTextCharacteristic1; // ProductPage.ProductPageTextCharacteristic2 = prod.ProductPageTextCharacteristic2; // ProductPage.ProductPageColorTextDescription1 = prod.ProductPageColorTextDescription1; // ProductPage.ProductPageColorTextDescription2 = prod.ProductPageColorTextDescription2; // ProductPage.ProductPageColorTextCharacteristic1 = prod.ProductPageColorTextCharacteristic1; // ProductPage.ProductPageColorTextCharacteristic2 = prod.ProductPageColorTextCharacteristic2; // promocion.ProductPages.Add(ProductPage); // } // promocion.PromocionPageImageLogo1 = prom.PromocionPageImageLogo1; // promocion.PromocionPageImageLogo2 = prom.PromocionPageImageLogo2; // promocion.PromocionPageHeadText = prom.PromocionPageHeadText; // promocion.PromocionPageSpanHeadText = prom.PromocionPageSpanHeadText; // promocion.PromocionPageColorHeadBg = prom.PromocionPageColorHeadBg; // promocion.PromocionPageSpanHeadtextColor = prom.PromocionPageSpanHeadtextColor; // promocion.PromocionPageHeadtextColor = prom.PromocionPageHeadtextColor; // promocion.PromocionPageSubText1 = prom.PromocionPageSubText1; // promocion.PromocionPageSubText2 = prom.PromocionPageSubText2; // } // promocion.PromocionPageActive = "EnEdicion"; // } // promocion.HeadImage.ImageSectionPageId = promocion.PromocionPageId; // db.ImageSections.Add(promocion.HeadImage); // } // await db.SaveChangesAsync(); // return Json(new AjaxResponse { Success = true, Message = "Los cambios se aplicaron correctamente en el servidor" }, JsonRequestBehavior.AllowGet); // } //} //return Json(new AjaxResponse { Success = false, Message = result.Value }, JsonRequestBehavior.AllowGet); }
private void InitializeComponent() { this.groupbox_paper = new System.Windows.Forms.GroupBox(); this.combobox_source = new System.Windows.Forms.ComboBox(); this.combobox_size = new System.Windows.Forms.ComboBox(); this.label_source = new System.Windows.Forms.Label(); this.label_size = new System.Windows.Forms.Label(); this.groupbox_orientation = new System.Windows.Forms.GroupBox(); this.radio_landscape = new System.Windows.Forms.RadioButton(); this.radio_portrait = new System.Windows.Forms.RadioButton(); this.groupbox_margin = new System.Windows.Forms.GroupBox(); this.label_left = new System.Windows.Forms.Label(); this.button_ok = new System.Windows.Forms.Button(); this.button_cancel = new System.Windows.Forms.Button(); this.button_printer = new System.Windows.Forms.Button(); this.label_top = new System.Windows.Forms.Label(); this.label_right = new System.Windows.Forms.Label(); this.label_bottom = new System.Windows.Forms.Label(); this.textbox_left = new System.Windows.Forms.NumericTextBox(); this.textbox_top = new System.Windows.Forms.NumericTextBox(); this.textbox_right = new System.Windows.Forms.NumericTextBox(); this.textbox_bottom = new System.Windows.Forms.NumericTextBox(); this.pagePreview = new PagePreview (); this.groupbox_paper.SuspendLayout(); this.groupbox_orientation.SuspendLayout(); this.groupbox_margin.SuspendLayout(); form.SuspendLayout(); // // groupbox_paper // this.groupbox_paper.Controls.Add(this.combobox_source); this.groupbox_paper.Controls.Add(this.combobox_size); this.groupbox_paper.Controls.Add(this.label_source); this.groupbox_paper.Controls.Add(this.label_size); this.groupbox_paper.Location = new System.Drawing.Point(12, 157); this.groupbox_paper.Name = "groupbox_paper"; this.groupbox_paper.Size = new System.Drawing.Size(336, 90); this.groupbox_paper.TabIndex = 0; this.groupbox_paper.TabStop = false; this.groupbox_paper.Text = "Paper"; // // combobox_source // this.combobox_source.Location = new System.Drawing.Point(84, 54); this.combobox_source.Name = "combobox_source"; this.combobox_source.Size = new System.Drawing.Size(240, 21); this.combobox_source.TabIndex = 3; // // combobox_size // this.combobox_size.ItemHeight = 13; this.combobox_size.Location = new System.Drawing.Point(84, 22); this.combobox_size.Name = "combobox_size"; this.combobox_size.Size = new System.Drawing.Size(240, 21); this.combobox_size.TabIndex = 2; this.combobox_size.SelectedIndexChanged += new EventHandler(this.OnPaperSizeChange); // // label_source // this.label_source.Location = new System.Drawing.Point(13, 58); this.label_source.Name = "label_source"; this.label_source.Size = new System.Drawing.Size(48, 16); this.label_source.TabIndex = 1; this.label_source.Text = "&Source:"; // // label_size // this.label_size.Location = new System.Drawing.Point(13, 25); this.label_size.Name = "label_size"; this.label_size.Size = new System.Drawing.Size(52, 16); this.label_size.TabIndex = 0; this.label_size.Text = "Si&ze:"; // // groupbox_orientation // this.groupbox_orientation.Controls.Add(this.radio_landscape); this.groupbox_orientation.Controls.Add(this.radio_portrait); this.groupbox_orientation.Location = new System.Drawing.Point(12, 255); this.groupbox_orientation.Name = "groupbox_orientation"; this.groupbox_orientation.Size = new System.Drawing.Size(96, 90); this.groupbox_orientation.TabIndex = 1; this.groupbox_orientation.TabStop = false; this.groupbox_orientation.Text = "Orientation"; // // radio_landscape // this.radio_landscape.Location = new System.Drawing.Point(13, 52); this.radio_landscape.Name = "radio_landscape"; this.radio_landscape.Size = new System.Drawing.Size(80, 24); this.radio_landscape.TabIndex = 7; this.radio_landscape.Text = "L&andscape"; this.radio_landscape.CheckedChanged += new EventHandler(this.OnLandscapeChange); // // radio_portrait // this.radio_portrait.Location = new System.Drawing.Point(13, 19); this.radio_portrait.Name = "radio_portrait"; this.radio_portrait.Size = new System.Drawing.Size(72, 24); this.radio_portrait.TabIndex = 6; this.radio_portrait.Text = "P&ortrait"; // // groupbox_margin // this.groupbox_margin.Controls.Add(this.textbox_bottom); this.groupbox_margin.Controls.Add(this.textbox_right); this.groupbox_margin.Controls.Add(this.textbox_top); this.groupbox_margin.Controls.Add(this.textbox_left); this.groupbox_margin.Controls.Add(this.label_bottom); this.groupbox_margin.Controls.Add(this.label_right); this.groupbox_margin.Controls.Add(this.label_top); this.groupbox_margin.Controls.Add(this.label_left); this.groupbox_margin.Location = new System.Drawing.Point(120, 255); this.groupbox_margin.Name = "groupbox_margin"; this.groupbox_margin.Size = new System.Drawing.Size(228, 90); this.groupbox_margin.TabIndex = 2; this.groupbox_margin.TabStop = false; this.groupbox_margin.Text = LocalizedLengthUnit (); // // label_left // this.label_left.Location = new System.Drawing.Point(11, 25); this.label_left.Name = "label_left"; this.label_left.Size = new System.Drawing.Size(40, 23); this.label_left.TabIndex = 0; this.label_left.Text = "&Left:"; // // button_ok // this.button_ok.Location = new System.Drawing.Point(120, 358); this.button_ok.Name = "button_ok"; this.button_ok.Size = new System.Drawing.Size(72, 23); this.button_ok.TabIndex = 3; this.button_ok.Text = "OK"; this.button_ok.Click += new EventHandler (OnClickOkButton); // // button_cancel // this.button_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button_cancel.Location = new System.Drawing.Point(198, 358); this.button_cancel.Name = "button_cancel"; this.button_cancel.Size = new System.Drawing.Size(72, 23); this.button_cancel.TabIndex = 4; this.button_cancel.Text = "Cancel"; // // button_printer // this.button_printer.Location = new System.Drawing.Point(276, 358); this.button_printer.Name = "button_printer"; this.button_printer.Size = new System.Drawing.Size(72, 23); this.button_printer.TabIndex = 5; this.button_printer.Text = "&Printer..."; this.button_printer.Click += new EventHandler (OnClickPrinterButton); // // label_top // this.label_top.Location = new System.Drawing.Point(11, 57); this.label_top.Name = "label_top"; this.label_top.Size = new System.Drawing.Size(40, 23); this.label_top.TabIndex = 1; this.label_top.Text = "&Top:"; // // label_right // this.label_right.Location = new System.Drawing.Point(124, 25); this.label_right.Name = "label_right"; this.label_right.Size = new System.Drawing.Size(40, 23); this.label_right.TabIndex = 2; this.label_right.Text = "&Right:"; // // label_bottom // this.label_bottom.Location = new System.Drawing.Point(124, 57); this.label_bottom.Name = "label_bottom"; this.label_bottom.Size = new System.Drawing.Size(40, 23); this.label_bottom.TabIndex = 3; this.label_bottom.Text = "&Bottom:"; // // textbox_left // this.textbox_left.Location = new System.Drawing.Point(57, 21); this.textbox_left.Name = "textbox_left"; this.textbox_left.Size = new System.Drawing.Size(48, 20); this.textbox_left.TabIndex = 4; this.textbox_left.TextChanged +=new EventHandler(OnMarginChange); // // textbox_top // this.textbox_top.Location = new System.Drawing.Point(57, 54); this.textbox_top.Name = "textbox_top"; this.textbox_top.Size = new System.Drawing.Size(48, 20); this.textbox_top.TabIndex = 5; this.textbox_top.TextChanged +=new EventHandler(OnMarginChange); // // textbox_right // this.textbox_right.Location = new System.Drawing.Point(171, 21); this.textbox_right.Name = "textbox_right"; this.textbox_right.Size = new System.Drawing.Size(48, 20); this.textbox_right.TabIndex = 6; this.textbox_right.TextChanged +=new EventHandler(OnMarginChange); // // textbox_bottom // this.textbox_bottom.Location = new System.Drawing.Point(171, 54); this.textbox_bottom.Name = "textbox_bottom"; this.textbox_bottom.Size = new System.Drawing.Size(48, 20); this.textbox_bottom.TabIndex = 7; this.textbox_bottom.TextChanged +=new EventHandler(OnMarginChange); // // pagePreview // this.pagePreview.Location = new System.Drawing.Point (130, 10); this.pagePreview.Name = "pagePreview"; this.pagePreview.Size = new System.Drawing.Size (150, 150); this.pagePreview.TabIndex = 6; // // Form3 // form.AcceptButton = this.button_ok; form.AutoScaleBaseSize = new System.Drawing.Size(5, 13); form.CancelButton = this.button_cancel; form.ClientSize = new System.Drawing.Size(360, 390); form.Controls.Add (this.pagePreview); form.Controls.Add (this.button_printer); form.Controls.Add(this.button_cancel); form.Controls.Add(this.button_ok); form.Controls.Add(this.groupbox_margin); form.Controls.Add(this.groupbox_orientation); form.Controls.Add(this.groupbox_paper); form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; form.HelpButton = true; form.MaximizeBox = false; form.MinimizeBox = false; form.Name = "Form3"; form.ShowInTaskbar = false; form.Text = "Page Setup"; this.groupbox_paper.ResumeLayout(false); this.groupbox_orientation.ResumeLayout(false); this.groupbox_margin.ResumeLayout(false); form.ResumeLayout(false); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ID", "ReturnUrl"); _nodeId = Body.GetQueryInt("NodeID"); var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _nodeId); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeInfo); _contentId = Body.GetQueryInt("ID"); _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl")); _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, _nodeId); _contentInfo = DataProvider.ContentDao.GetContentInfo(_tableStyle, _tableName, _contentId); if (!IsPostBack) { BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "查看内容", string.Empty); var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, _tableName, _relatedIdentities); var myStyleInfoArrayList = new ArrayList(); if (styleInfoList != null) { foreach (var styleInfo in styleInfoList) { if (styleInfo.IsVisible) { myStyleInfoArrayList.Add(styleInfo); } } } MyRepeater.DataSource = myStyleInfoArrayList; MyRepeater.ItemDataBound += MyRepeater_ItemDataBound; MyRepeater.DataBind(); ltlNodeName.Text = NodeManager.GetNodeName(PublishmentSystemId, _nodeId); ltlNodeName.Text += $@" <script> function submitPreview(){{ window.open(""{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeId, _contentId, 0, 0)}""); }} </script> "; if (PublishmentSystemInfo.Additional.IsRelatedByTags) { ltlTags.Text = _contentInfo.Tags; } if (string.IsNullOrEmpty(ltlTags.Text)) { RowTags.Visible = false; } ltlContentGroup.Text = _contentInfo.ContentGroupNameCollection; if (string.IsNullOrEmpty(ltlContentGroup.Text)) { RowContentGroup.Visible = false; } ltlLastEditDate.Text = DateUtils.GetDateAndTimeString(_contentInfo.LastEditDate); ltlAddUserName.Text = AdminManager.GetDisplayName(_contentInfo.AddUserName, true); ltlLastEditUserName.Text = AdminManager.GetDisplayName(_contentInfo.LastEditUserName, true); ltlContentLevel.Text = LevelManager.GetCheckState(PublishmentSystemInfo, _contentInfo.IsChecked, _contentInfo.CheckedLevel); if (_contentInfo.ReferenceId > 0 && _contentInfo.GetExtendedAttribute(ContentAttribute.TranslateContentType) != ETranslateContentType.ReferenceContent.ToString()) { var referencePublishmentSystemID = DataProvider.NodeDao.GetPublishmentSystemId(_contentInfo.SourceId); var referencePublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(referencePublishmentSystemID); var referenceTableStyle = NodeManager.GetTableStyle(referencePublishmentSystemInfo, _contentInfo.SourceId); var referenceTableName = NodeManager.GetTableName(referencePublishmentSystemInfo, _contentInfo.SourceId); var referenceContentInfo = DataProvider.ContentDao.GetContentInfo(referenceTableStyle, referenceTableName, _contentInfo.ReferenceId); if (referenceContentInfo != null) { var pageUrl = PageUtility.GetContentUrl(referencePublishmentSystemInfo, referenceContentInfo); var referenceNodeInfo = NodeManager.GetNodeInfo(referenceContentInfo.PublishmentSystemId, referenceContentInfo.NodeId); var addEditUrl = WebUtils.GetContentAddEditUrl(referencePublishmentSystemInfo.PublishmentSystemId, referenceNodeInfo, _contentInfo.ReferenceId, Body.GetQueryString("ReturnUrl")); ltlScripts.Text += $@" <div class=""tips"">此内容为对内容 (站点:{referencePublishmentSystemInfo.PublishmentSystemName},栏目:{referenceNodeInfo.NodeName})“<a href=""{pageUrl}"" target=""_blank"">{_contentInfo.Title}</a>”(<a href=""{addEditUrl}"">编辑</a>) 的引用,内容链接将和原始内容链接一致</div>"; } } Submit.Attributes.Add("onclick", ModalContentCheck.GetOpenWindowString(PublishmentSystemInfo.PublishmentSystemId, _nodeId, _contentId, _returnUrl)); } }
public void Page_Load(object sender, EventArgs e) { PageUtils.CheckRequestParameter("PublishmentSystemID"); var nodeId = TranslateUtils.ToInt(Request.QueryString["NodeID"]); if (nodeId == 0) { nodeId = PublishmentSystemInfo.Additional.GovPublicNodeId; } _contentId = TranslateUtils.ToInt(Request.QueryString["ID"]); ReturnUrl = StringUtils.ValueFromUrl(Request.QueryString["ReturnUrl"]); _nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, _nodeInfo); _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId); GovPublicContentInfo contentInfo = null; if (_contentId == 0) { if (_nodeInfo != null && _nodeInfo.Additional.IsContentAddable == false) { PageUtils.RedirectToErrorPage("此栏目不能添加内容!"); return; } if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentAdd)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的添加内容权限!"); return; } } else { contentInfo = DataProvider.GovPublicContentDao.GetContentInfo(PublishmentSystemInfo, _contentId); if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的修改内容权限!"); return; } } if (!IsPostBack) { var nodeNames = NodeManager.GetNodeNameNavigationByGovPublic(PublishmentSystemId, nodeId); var departmentId = 0; var departmentName = string.Empty; var pageTitle = _contentId == 0 ? "添加信息" : "修改信息"; BreadCrumbWithItemTitle(AppManager.Wcm.LeftMenu.IdGovPublic, AppManager.Wcm.LeftMenu.GovPublic.IdGovPublicContent, pageTitle, nodeNames, AppManager.Wcm.Permission.WebSite.GovPublicContent); ltlPageTitle.Text = pageTitle; ltlPageTitle.Text += $@" <script language=""javascript"" type=""text/javascript""> var previewUrl = '{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeInfo.NodeId, _contentId, 0, 0)}'; </script> "; EBooleanUtils.AddListItems(rblIsAbolition); ControlUtils.SelectListItemsIgnoreCase(rblIsAbolition, false.ToString()); //转移 if (_tableStyle == ETableStyle.BackgroundContent && AdminUtility.HasChannelPermissions(Body.AdministratorName, PublishmentSystemId, _nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate)) { phTranslate.Visible = PublishmentSystemInfo.Additional.IsTranslate; divTranslateAdd.Attributes.Add("onclick", ModalChannelMultipleSelect.GetOpenWindowString(PublishmentSystemId, true)); ETranslateContentTypeUtils.AddListItems(ddlTranslateType, true); ControlUtils.SelectListItems(ddlTranslateType, ETranslateContentTypeUtils.GetValue(ETranslateContentType.Copy)); } else { phTranslate.Visible = false; } //内容属性 var excludeAttributeNames = TableManager.GetExcludeAttributeNames(_tableStyle); acAttributes.AddExcludeAttributeNames(excludeAttributeNames); if (excludeAttributeNames.Count == 0) { phContentAttributes.Visible = false; } else { phContentAttributes.Visible = true; foreach (var attributeName in GovPublicContentAttribute.CheckBoxAttributes) { var styleInfo = TableStyleManager.GetTableStyleInfo(_tableStyle, _tableName, attributeName, _relatedIdentities); if (styleInfo.IsVisible) { var listItem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName); if (_contentId > 0) { listItem.Selected = TranslateUtils.ToBool(contentInfo.GetExtendedAttribute(styleInfo.AttributeName)); } ContentAttributes.Items.Add(listItem); } } } //内容组 var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId); if (!PublishmentSystemInfo.Additional.IsGroupContent || contentGroupNameList.Count == 0) { phContentGroup.Visible = false; } else { foreach (var groupName in contentGroupNameList) { var item = new ListItem(groupName, groupName); if (_contentId > 0) { item.Selected = StringUtils.In(contentInfo.ContentGroupNameCollection, groupName); } ContentGroupNameCollection.Items.Add(item); } } if (!PublishmentSystemInfo.Additional.IsRelatedByTags || _tableStyle != ETableStyle.BackgroundContent) { phTags.Visible = false; } else { var tagScript = @" <script type=""text/javascript""> function getTags(tag){ $.get('[url]&tag=' + encodeURIComponent(tag) + '&r=' + Math.random(), function(data) { if(data !=''){ var arr = data.split('|'); var temp=''; for(i=0;i<arr.length;i++) { temp += '<li><a>'+arr[i].replace(tag,'<b>' + tag + '</b>') + '</a></li>'; } var myli='<ul>'+temp+'</ul>'; $('#tagTips').html(myli); $('#tagTips').show(); }else{ $('#tagTips').hide(); } $('#tagTips li').click(function () { var tag = $('#Tags').val(); var i = tag.lastIndexOf(' '); if (i > 0) { tag = tag.substring(0, i) + ' ' + $(this).text(); }else{ tag = $(this).text(); } $('#Tags').val(tag); $('#tagTips').hide(); }) }); } $(document).ready(function () { $('#Tags').keyup(function (e) { if (e.keyCode != 40 && e.keyCode != 38) { var tag = $('#Tags').val(); var i = tag.lastIndexOf(' '); if (i > 0){ tag = tag.substring(i + 1);} if (tag != '' && tag != ' '){ window.setTimeout(""getTags('"" + tag + ""');"", 200); }else{ $('#tagTips').hide(); } } }).blur(function () { window.setTimeout(""$('#tagTips').hide();"", 200); })}); </script> <div id=""tagTips"" class=""inputTips""></div> "; ltlTags.Text = tagScript.Replace("[url]", AjaxCmsService.GetTagsUrl(PublishmentSystemId)); } divAddChannel.Attributes.Add("onclick", ModalGovPublicCategoryChannelSelect.GetOpenWindowString(PublishmentSystemId)); divAddDepartment.Attributes.Add("onclick", ModalGovPublicCategoryDepartmentSelect.GetOpenWindowString(PublishmentSystemId)); var categoryBuilder = new StringBuilder(); var categoryClassInfoArrayList = DataProvider.GovPublicCategoryClassDao.GetCategoryClassInfoArrayList(PublishmentSystemId, ETriState.False, ETriState.True); if (categoryClassInfoArrayList.Count > 0) { var categoryIndex = 1; foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList) { categoryIndex++; if (categoryIndex % 2 == 0) { categoryBuilder.Append("<tr>"); } categoryBuilder.Append( $@"<td height=""30"">{categoryClassInfo.ClassName}分类:</td><td height=""30""> <div class=""fill_box"" id=""category{categoryClassInfo.ClassCode}Container"" style=""display:none""> <div class=""addr_base addr_normal""> <b id=""category{categoryClassInfo.ClassCode}Name""></b> <a class=""addr_del"" href=""javascript:;"" onClick=""showCategory{categoryClassInfo .ClassCode}('', '0')""></a> <input id=""category{categoryClassInfo.ClassCode}ID"" name=""category{categoryClassInfo.ClassCode}ID"" value=""0"" type=""hidden""> </div> </div> <div ID=""divAdd{categoryClassInfo.ClassCode}"" class=""btn_pencil"" onclick=""{ModalGovPublicCategorySelect .GetOpenWindowString(PublishmentSystemId, categoryClassInfo.ClassCode)}""><span class=""pencil""></span> 修改</div> <script language=""javascript""> function showCategory{categoryClassInfo.ClassCode}({categoryClassInfo.ClassCode}Name, {categoryClassInfo.ClassCode}ID){{ $('#category{categoryClassInfo.ClassCode}Name').html({categoryClassInfo.ClassCode}Name); $('#category{categoryClassInfo.ClassCode}ID').val({categoryClassInfo.ClassCode}ID); if ({categoryClassInfo.ClassCode}ID == '0'){{ $('#category{categoryClassInfo.ClassCode}Container').hide(); }}else{{ $('#category{categoryClassInfo.ClassCode}Container').show(); }} }} </script> </td>"); if (categoryIndex % 2 == 1) { categoryBuilder.Append("</tr>"); } } } if (_contentId == 0) { var formCollection = new NameValueCollection(); if (Body.IsQueryExists("isUploadWord")) { var isFirstLineTitle = TranslateUtils.ToBool(Request.QueryString["isFirstLineTitle"]); var isFirstLineRemove = TranslateUtils.ToBool(Request.QueryString["isFirstLineRemove"]); var isClearFormat = TranslateUtils.ToBool(Request.QueryString["isClearFormat"]); var isFirstLineIndent = TranslateUtils.ToBool(Request.QueryString["isFirstLineIndent"]); var isClearFontSize = TranslateUtils.ToBool(Request.QueryString["isClearFontSize"]); var isClearFontFamily = TranslateUtils.ToBool(Request.QueryString["isClearFontFamily"]); var isClearImages = TranslateUtils.ToBool(Request.QueryString["isClearImages"]); var contentLevel = TranslateUtils.ToInt(Request.QueryString["contentLevel"]); var fileName = Request.QueryString["fileName"]; formCollection = WordUtils.GetWordNameValueCollection(PublishmentSystemId, _nodeInfo.ContentModelId, isFirstLineTitle, isFirstLineRemove, isClearFormat, isFirstLineIndent, isClearFontSize, isClearFontFamily, isClearImages, contentLevel, fileName); } ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, formCollection, false, IsPostBack); acAttributes.SetParameters(formCollection, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } //else //{ // this.Tags.Text = contentInfo.Tags; //} //if (contentID == 0) //{ // NameValueCollection formCollection = new NameValueCollection(); // this.ascContent.SetParameters(base.PublishmentSystemInfo, base.PublishmentSystemInfo.Additional.GovPublicNodeID, ETableStyle.GovPublicContent, base.PublishmentSystemInfo.AuxiliaryTableForGovPublic, GovPublicContentAttribute.Content, formCollection, false, base.IsPostBack); //} else { departmentId = contentInfo.DepartmentId; departmentName = DepartmentManager.GetDepartmentName(departmentId); foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList) { var categoryId = TranslateUtils.ToInt(contentInfo.GetExtendedAttribute(categoryClassInfo.ContentAttributeName)); if (categoryId > 0) { var categoryName = DataProvider.GovPublicCategoryDao.GetCategoryName(categoryId); categoryBuilder.Append( $@"<script>showCategory{categoryClassInfo.ClassCode}('{categoryName}', '{categoryId}');</script>"); } } tbIdentifier.Text = contentInfo.Identifier; tbPublisher.Text = contentInfo.Publisher; tbDocumentNo.Text = contentInfo.DocumentNo; dtbPublishDate.DateTime = contentInfo.PublishDate; tbKeywords.Text = contentInfo.Keywords; dtbEffectDate.DateTime = contentInfo.EffectDate; ControlUtils.SelectListItemsIgnoreCase(rblIsAbolition, contentInfo.IsAbolition.ToString()); dtbAbolitionDate.DateTime = contentInfo.AbolitionDate; tbDescription.Text = contentInfo.Description; ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, contentInfo.Attributes, true, IsPostBack); acAttributes.SetParameters(contentInfo.Attributes, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); Tags.Text = contentInfo.Tags; } if (departmentId == 0) { departmentId = BaiRongDataProvider.AdministratorDao.GetDepartmentId(Body.AdministratorName); if (departmentId > 0) { departmentName = DepartmentManager.GetDepartmentName(departmentId); } } categoryBuilder.Append( $@"<script>showCategoryChannel('{nodeNames}', '{nodeId}');showCategoryDepartment('{departmentName}', '{departmentId}');</script>"); ltlCategoryScript.Text = categoryBuilder.ToString(); if (HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentCheck)) { phStatus.Visible = true; int checkedLevel; var isChecked = CheckManager.GetUserCheckLevel(Body.AdministratorName, PublishmentSystemInfo, PublishmentSystemId, out checkedLevel); LevelManager.LoadContentLevelToEdit(ContentLevel, PublishmentSystemInfo, nodeId, contentInfo, isChecked, checkedLevel); } else { phStatus.Visible = false; } Submit.Attributes.Add("onclick", InputParserUtils.GetValidateSubmitOnClickScript("myForm")); if (PublishmentSystemInfo.Additional.GovPublicIsPublisherRelatedDepartmentId && string.IsNullOrEmpty(tbPublisher.Text)) { tbPublisher.Text = departmentName; } } else { if (_contentId == 0) { ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, Request.Form, false, IsPostBack); acAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } else { ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, Request.Form, true, IsPostBack); acAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); } //this.ascContent.SetParameters(base.PublishmentSystemInfo, base.PublishmentSystemInfo.Additional.GovPublicNodeID, ETableStyle.GovPublicContent, base.PublishmentSystemInfo.AuxiliaryTableForGovPublic, GovPublicContentAttribute.Content, base.Request.Form, true, base.IsPostBack); } DataBind(); }
/// <summary> /// Освободить все используемые ресурсы. /// </summary> /// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param> protected override void Dispose(bool disposing) { if (disposing) { if (this.PagePreview != null) { this.PagePreview.SelectedIndexChanged -= PagePreviewSelectedIndexChanged; this.PagePreview.Items.Clear(); if (InvokeRequired) { Invoke((MethodInvoker)(PagePreview.Dispose)); } else { PagePreview.Dispose(); } this.PagePreview = null; } if (PagePreviewImages != null) { PagePreviewImages.Images.Clear(); if (InvokeRequired) { Invoke((MethodInvoker)(PagePreviewImages.Dispose)); } else { PagePreviewImages.Dispose(); } PagePreviewImages = null; } if (this.PageView != null) { Subscribe_PageView_ClientSizeChanged(false); if (InvokeRequired) { Invoke((MethodInvoker)(PageView.Dispose)); } else { PageView.Dispose(); } this.PageView = null; } if (DocPages != null) { DocPages.Clear(); } } System.GC.Collect(); if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }