protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string str = BasePage.RequestString("Action", "Add");
         if (str == "Modify")
         {
             SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(BasePage.RequestInt32("SpecialCategoryID"));
             if (!specialCategoryInfoById.IsNull)
             {
                 this.TxtSpecialCategoryName.Text   = specialCategoryInfoById.SpecialCategoryName;
                 this.TxtSpecialCategoryDir.Enabled = false;
                 this.TxtSpecialCategoryDir.Text    = specialCategoryInfoById.SpecialCategoryDir;
                 this.FileCSpecialTemplatePath.Text = specialCategoryInfoById.SpecialTemplatePath;
                 this.FileCSearchTemplatePath.Text  = specialCategoryInfoById.SearchTemplatePath;
                 this.TxtDescription.Text           = specialCategoryInfoById.Description;
                 this.PagePostfix.Value             = specialCategoryInfoById.PagePostfix;
                 BasePage.SetSelectedIndexByValue(this.RadlCreatHtml, specialCategoryInfoById.IsCreateHtml.ToString());
                 BasePage.SetSelectedIndexByValue(this.RadOpenType, specialCategoryInfoById.OpenType.ToString());
                 this.HdnAction.Value = str;
                 this.HdnSpecialCategoryName.Value = specialCategoryInfoById.SpecialCategoryName;
                 this.HdnOrderId.Value             = specialCategoryInfoById.OrderId.ToString();
             }
         }
     }
 }
Esempio n. 2
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;
        }
 protected void EgvSpecial_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         int         specialCategoryId = BasePage.RequestInt32("SpecialCategoryID");
         SpecialInfo dataItem          = e.Row.DataItem as SpecialInfo;
         if (dataItem != null)
         {
             HyperLink link = e.Row.FindControl("HypTitle") as HyperLink;
             if (link != null)
             {
                 link.Text        = StringHelper.SubString(dataItem.SpecialName, 20, "...");
                 link.NavigateUrl = "Special.aspx?Action=Modify&SpecialID=" + dataItem.SpecialId;
             }
             if (specialCategoryId == 0)
             {
                 specialCategoryId = dataItem.SpecialCategoryId;
                 SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialCategoryId);
                 ExtendedHyperLink   link2 = e.Row.FindControl("LblSpecialCategoryLink") as ExtendedHyperLink;
                 link2.BeginTag    = "<strong>[";
                 link2.Text        = specialCategoryInfoById.SpecialCategoryName;
                 link2.EndTag      = "]</strong>";
                 link2.NavigateUrl = "SpecialManage.aspx?SpecialCategoryID=" + specialCategoryId.ToString();
             }
         }
     }
 }
Esempio n. 4
0
        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;
            }
        }
        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();
        }
Esempio n. 6
0
        private SpecialInfo GetSpecialInfo()
        {
            int specialCategoryId = DataConverter.CLng(this.DropSpecialCategory.SelectedValue);

            if (specialCategoryId <= 0)
            {
                AdminPage.WriteErrMsg("<li>请选择专题所属的类别!</li>", "Special.aspx");
            }
            SpecialInfo         info = new SpecialInfo();
            SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialCategoryId);

            info.SpecialCategoryId = specialCategoryId;
            if (BasePage.RequestString("AddType").CompareTo("BatchSpecial") != 0)
            {
                info.SpecialName       = this.TxtSpecialName.Text;
                info.SpecialDir        = specialCategoryInfoById.SpecialCategoryDir + "/" + this.TxtSpecialDir.Text;
                info.SpecialIdentifier = this.TxtSpecialIdentifier.Text;
            }
            info.SpecialPic           = this.TxtSpecialPic.Text;
            info.SpecialTips          = this.TxtSpecialTips.Text;
            info.SpecialTemplatePath  = this.FileCSpecialTemplatePath.Text;
            info.SearchTemplatePath   = this.FileCSearchTemplatePath.Text;
            info.IsElite              = DataConverter.CBoolean(this.RadlIsElite.SelectedValue);
            info.OpenType             = DataConverter.CLng(this.RadOpenType.SelectedValue);
            info.Description          = this.TxtDescription.Text;
            info.IsCreateListPage     = DataConverter.CBoolean(this.RadlCreatHtml.SelectedValue);
            info.ListPageSavePathType = (ListPagePathType)Enum.Parse(typeof(ListPagePathType), this.RadlListPageHtmlDirType.SelectedValue);
            info.ListPagePostfix      = this.PagePostfix.Value;
            int           num2 = DataConverter.CLng(this.DropCustomNum.SelectedValue);
            StringBuilder sb   = new StringBuilder();

            for (int i = 1; i <= num2; i++)
            {
                StringHelper.AppendString(sb, ((TextBox)this.PnlCustomFileds.FindControl("Custom_Content" + i)).Text, "{#$$$#}");
            }
            info.CustomContent  = sb.ToString();
            info.NeedCreateHtml = false;
            return(info);
        }
Esempio n. 7
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))
            {
                List <SpecialCategoryInfo> list = new List <SpecialCategoryInfo>();
                string[] strArray = str.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(DataConverter.CLng(strArray[i]));
                    if (!specialCategoryInfoById.IsNull)
                    {
                        specialCategoryInfoById.OrderId = i + 1;
                        list.Add(specialCategoryInfoById);
                    }
                }
                Special.OrderSpecialCategory(list);
                this.Repeater1.DataBind();
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("专题类别排序成功!", "SpecialCategoryOrder.aspx");
            }
        }
        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);
            }
        }
 private string InitSiteMapCategory(int categoryId)
 {
     return(Special.GetSpecialCategoryInfoById(categoryId).SpecialCategoryName);
 }