示例#1
0
        public void RaiseCallbackEvent(string eventArgument)
        {
            SpecialInfo         specialInfoById         = Special.GetSpecialInfoById(DataConverter.CLng(eventArgument));
            SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId);

            this.result = specialCategoryInfoById.SpecialCategoryName + ">>" + specialInfoById.SpecialName;
        }
示例#2
0
        private void BindSpecial()
        {
            SpecialInfo specialInfoById = Special.GetSpecialInfoById(this.specialId);

            if (specialInfoById.IsNull)
            {
                AdminPage.WriteErrMsg("发生错误,请传入正确的专题ID!");
            }
            BasePage.SetSelectedIndexByValue(this.DropSpecialCategory, specialInfoById.SpecialCategoryId.ToString());
            this.TxtSpecialName.Text       = specialInfoById.SpecialName;
            this.TxtSpecialIdentifier.Text = specialInfoById.SpecialIdentifier;
            this.TxtSpecialDir.Enabled     = false;
            string[] strArray = specialInfoById.SpecialDir.Split(new char[] { '/' });
            if (strArray.Length > 1)
            {
                this.TxtSpecialDir.Text = strArray[1];
            }
            else
            {
                this.TxtSpecialDir.Text = strArray[0];
            }
            this.TxtSpecialPic.Text  = specialInfoById.SpecialPic;
            this.TxtSpecialTips.Text = specialInfoById.SpecialTips;
            this.TxtDescription.Text = specialInfoById.Description;
            BasePage.SetSelectedIndexByValue(this.RadlIsElite, specialInfoById.IsElite.ToString());
            BasePage.SetSelectedIndexByValue(this.RadOpenType, specialInfoById.OpenType.ToString());
            this.FileCSpecialTemplatePath.Text = specialInfoById.SpecialTemplatePath;
            this.FileCSearchTemplatePath.Text  = specialInfoById.SearchTemplatePath;
            BasePage.SetSelectedIndexByValue(this.RadlCreatHtml, specialInfoById.IsCreateListPage.ToString());
            this.PagePostfix.Value = specialInfoById.ListPagePostfix;
            BasePage.SetSelectedIndexByValue(this.RadlListPageHtmlDirType, specialInfoById.ListPageSavePathType.ToString());
            int num = 1;

            if (!string.IsNullOrEmpty(specialInfoById.CustomContent))
            {
                string[] strArray2 = specialInfoById.CustomContent.Split(new string[] { "{#$$$#}" }, StringSplitOptions.None);
                int      num2      = 1;
                foreach (string str in strArray2)
                {
                    num = num2;
                    ((TextBox)this.PnlCustomFileds.FindControl("Custom_Content" + num2)).Text = str;
                    ((HtmlTableRow)this.PnlCustomFileds.FindControl("objFiles" + num2)).Attributes.Add("style", "display: ''");
                    num2++;
                }
            }
            ((DropDownList)this.PnlCustomFileds.FindControl("DropCustomNum")).SelectedValue = num.ToString();
            this.HdnSpecialName.Value = specialInfoById.SpecialName;
            this.HdnSpecialDir.Value  = specialInfoById.SpecialDir;
            this.HdnOrderId.Value     = specialInfoById.OrderId.ToString();
        }
        public override void OnInitTemplatePage(EventArgs e)
        {
            int specialId = BasePage.RequestInt32("id");

            switch (BasePage.RequestStringToLower("action"))
            {
            case "special":
                this.specialInfo = Special.GetSpecialInfoById(specialId);
                break;

            case "specialcategory":
                this.specialCategoryInfo = Special.GetSpecialCategoryInfoById(specialId);
                break;
            }
        }
示例#4
0
        private static void CreateContentAndNodeAndParentNodeAndSpecial(NodeInfo nodeInfo, DataTable dataTable, string generalIds)
        {
            string filterExpression = "FieldLevel=0 AND FieldName ='SpecialId'";

            DataRow[] rowArray = dataTable.Select(filterExpression);
            if (rowArray.Length > 0)
            {
                int specialId = DataConverter.CLng(rowArray[0]["FieldValue"].ToString());
                if (Special.GetSpecialInfoById(specialId).IsCreateListPage)
                {
                    HtmlSpecial special = new HtmlSpecial();
                    special.SpecialIdArray = specialId.ToString();
                    special.CommonCreateHtml();
                }
            }
            CreateContenAndNodeAndParentNode(nodeInfo, generalIds);
        }
        private void InitSpecial()
        {
            StringBuilder builder        = new StringBuilder();
            string        specialInfoIds = "";

            switch (this.m_SpecialInfoType)
            {
            case 1:
            {
                int generalId = DataConverter.CLng(HttpContext.Current.Request["GeneralId"]);
                if (generalId > 0)
                {
                    specialInfoIds = Special.GetSpecialInfoIds(generalId);
                }
                break;
            }

            case 2:
            {
                int id = DataConverter.CLng(HttpContext.Current.Request["ItemId"]);
                if (id > 0)
                {
                    specialInfoIds = CollectionItem.GetInfoById(id).SpecialId;
                }
                break;
            }
            }
            if (!string.IsNullOrEmpty(specialInfoIds))
            {
                this.HdnSpecial.Value = specialInfoIds;
                string[] strArray = specialInfoIds.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    SpecialInfo         specialInfoById         = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i]));
                    SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId);
                    builder.Append("\n<span id='SpecialSpanId" + specialInfoById.SpecialId + "'>");
                    builder.Append(specialCategoryInfoById.SpecialCategoryName + ">>" + specialInfoById.SpecialName);
                    builder.Append(" <input type='button' class='button' onclick=\"javascript:DelSpecial('" + specialInfoById.SpecialId + "')\" value='删除此专题' /><br /></span>");
                }
            }
            if (builder.Length <= 0)
            {
                builder.Append("<span id='SpecialSpanId0'>无专题<br /></span>");
            }
            this.UlSpecial.InnerHtml = builder.ToString();
        }
示例#6
0
        private string GetSpecialTemplate(int specialid, int specialcategoryid)
        {
            string str = "";

            if (specialcategoryid > 0)
            {
                SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialcategoryid);
                if (!specialCategoryInfoById.IsNull)
                {
                    if (!string.IsNullOrEmpty(specialCategoryInfoById.SearchTemplatePath))
                    {
                        return(specialCategoryInfoById.SearchTemplatePath);
                    }
                    TemplatePage.WriteErrMsg("没有设置专题类别模板!", "Special.aspx");
                    return(str);
                }
                TemplatePage.WriteErrMsg("找不到指定的专题类别!", "Special.aspx");
                return(str);
            }
            if (specialid > 0)
            {
                SpecialInfo specialInfoById = Special.GetSpecialInfoById(specialid);
                if (!specialInfoById.IsNull)
                {
                    if (!string.IsNullOrEmpty(specialInfoById.SearchTemplatePath))
                    {
                        return(specialInfoById.SearchTemplatePath);
                    }
                    TemplatePage.WriteErrMsg("没有设置专题模板!", "Special.aspx");
                    return(str);
                }
                TemplatePage.WriteErrMsg("找不到指定的专题!", "Special.aspx");
                return(str);
            }
            TemplatePage.WriteErrMsg("没有设置任何专题模板!", "Special.aspx");
            return(str);
        }
        protected void EBtnSetOrderId_Click(object sender, EventArgs e)
        {
            string str = this.HdnList.Value;

            if (!string.IsNullOrEmpty(str))
            {
                string[]           strArray = str.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                List <SpecialInfo> list     = new List <SpecialInfo>();
                for (int i = 0; i < strArray.Length; i++)
                {
                    SpecialInfo specialInfoById = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i]));
                    if (!specialInfoById.IsNull)
                    {
                        specialInfoById.OrderId = i + 1;
                        list.Add(specialInfoById);
                    }
                }
                Special.OrderSpecial(list);
                this.Repeater1.DataBind();
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("专题排序成功!", "SpecialOrder.aspx?SpecialCategoryId=" + BasePage.RequestString("SpecialCategoryId"));
            }
        }
        protected void RptContent_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item))
            {
                Literal       literal2;
                StringBuilder builder;
                FieldInfo     dataItem = e.Item.DataItem as FieldInfo;
                this.InitTabByFieldType(e, dataItem);
                ExtendedLiteral literal = e.Item.FindControl("LitContentText") as ExtendedLiteral;
                Panel           panel   = e.Item.FindControl("PnlContent") as Panel;
                string          status  = this.contentDataTable.Rows[0][dataItem.FieldName].ToString();
                if (dataItem.FieldType == FieldType.KeywordType)
                {
                    status = StringHelper.ReplaceChar(this.contentDataTable.Rows[0][dataItem.FieldName].ToString(), '|', ' ');
                }
                switch (dataItem.FieldType)
                {
                case FieldType.SpecialType:
                    literal2 = new Literal();
                    builder  = new StringBuilder();
                    if (this.m_GeneralId > 0)
                    {
                        string[] strArray = Special.GetSpecialInfoIds(this.m_GeneralId).Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                        for (int i = 0; i < strArray.Length; i++)
                        {
                            SpecialInfo         specialInfoById         = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i]));
                            SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId);
                            builder.Append("\n<span>");
                            builder.Append(DataSecurity.HtmlEncode(specialCategoryInfoById.SpecialCategoryName) + ">>" + DataSecurity.HtmlEncode(specialInfoById.SpecialName));
                            builder.Append("<br /></span>");
                        }
                    }
                    break;

                case FieldType.StatusType:
                    literal.Text = this.GetStatusShow(status);
                    return;

                case FieldType.ContentType:
                    literal.BeginTag = "<iframe marginwidth='0' marginheight='0' frameborder='0' name='ContentPreview' width='650px' height='500px' src='ContentPreview.aspx?GeneralID=" + this.m_GeneralId.ToString() + "&fieldName=" + base.Server.UrlEncode(dataItem.FieldName) + "'></iframe>";
                    return;

                case FieldType.NodeType:
                    literal.BeginTag = EasyOne.Contents.Nodes.ShowNodeNavigation(DataConverter.CLng(status));
                    return;

                case FieldType.InfoType:
                {
                    Literal       child    = new Literal();
                    StringBuilder builder2 = new StringBuilder();
                    if (this.m_GeneralId > 0)
                    {
                        foreach (CommonModelInfo info4 in ContentManage.GetInfoList(this.m_GeneralId))
                        {
                            builder2.Append("<span>");
                            builder2.Append(EasyOne.Contents.Nodes.ShowNodesAndRootNavigation(info4.NodeId));
                            builder2.Append("<br /></span>");
                        }
                    }
                    if (builder2.Length <= 0)
                    {
                        builder2.Append("<span>无其它节点<br /></span>");
                    }
                    literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder2.ToString() + "</div>";
                    panel.Controls.Add(child);
                    return;
                }

                case FieldType.MultipleHtmlTextType:
                    literal.BeginTag = status;
                    return;

                default:
                    literal.Text = status;
                    return;
                }
                if (builder.Length <= 0)
                {
                    builder.Append("<span id='SpecialSpanId0'>无专题<br /></span>");
                }
                literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder.ToString() + "</div>";
                panel.Controls.Add(literal2);
            }
        }