private void InitListLabelType()
 {
     this.RbtLabelType.DataSource     = LabelManage.GetLabelTypeList();
     this.RbtLabelType.DataTextField  = "Name";
     this.RbtLabelType.DataValueField = "Name";
     this.RbtLabelType.DataBind();
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = BasePage.RequestStringToLower("action");

            this.TxtTemplate.Attributes.Add("onmouseup", "dragend(this)");
            this.TxtTemplate.Attributes.Add("onClick", "savePos(this)");
            this.TxtTemplate.Attributes.Add("onmousemove", "DragPos(this)");
            this.RegTxtFileName.ValidationExpression = "^[^\\\\\\./:\\*\\?\\\"<>\\|]{1}[^\\\\/:\\*\\.\\?\\\"<>\\|]{0,254}\\.[^\\\\/:\\*\\.\\?\\\"<>\\|]{1,8}$";
            this.RegTxtFileName.ErrorMessage         = "文件名格式不正确";
            if (!base.IsPostBack)
            {
                ListItem item = new ListItem();
                item.Text = "全部分类";
                this.DropLabelList.DataSource     = LabelManage.GetLabelTypeList();
                this.DropLabelList.DataTextField  = "Name";
                this.DropLabelList.DataValueField = "Name";
                this.DropLabelList.DataBind();
                this.DropLabelList.Items.Insert(0, item);
                this.DropPagerList.DataSource     = PagerManage.GetPagerTypeList();
                this.DropPagerList.DataTextField  = "Name";
                this.DropPagerList.DataValueField = "Name";
                this.DropPagerList.DataBind();
                this.DropPagerList.Items.Insert(0, item);
                this.BuildLabelList(string.Empty);
                this.BuildPagerList(string.Empty);
            }
            if ((str == "modify") && !base.IsPostBack)
            {
                this.BindDataToControls();
            }
        }
示例#3
0
        private void InitDropLabelType()
        {
            this.DropLabelType.DataSource     = LabelManage.GetLabelTypeList();
            this.DropLabelType.DataTextField  = "Name";
            this.DropLabelType.DataValueField = "Name";
            this.DropLabelType.DataBind();
            ListItem item = new ListItem();

            item.Text  = "全部分类";
            item.Value = "全部分类";
            this.DropLabelType.Items.Insert(0, item);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.action         = BasePage.RequestString("action");
     this.labelname      = BasePage.RequestString("name");
     this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
     if (string.IsNullOrEmpty(this.labelname))
     {
         BasePage.ResponseRedirect("Label.aspx");
     }
     else
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.labelname + ".config";
         if (!base.IsPostBack)
         {
             if (LabelManage.GetAttributeList(this.xmlfilepath).Count == 0)
             {
                 this.attlist.Text = "您尚未建立属性!<a href=\"LabelProperty.aspx?action=" + this.action + "&name=" + this.labelname + "\">建立属性</a>";
             }
             else
             {
                 foreach (LabelAttributeInfo info in LabelManage.GetAttributeList(this.xmlfilepath))
                 {
                     string text = this.attlist.Text;
                     this.attlist.Text = text + "<div onclick=\"cit()\" outype=\"2\" class=\"spanfixdiv\" alt=\"" + info.Intro + "&#10默认值:" + info.DefaultValue + "\">" + info.AttributeName + "</div>";
                 }
             }
             if (!string.IsNullOrEmpty(XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate")))
             {
                 this.TxtTemplate.Text = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate");
             }
             ListItem item = new ListItem();
             item.Text = "全部分类";
             this.DropLabelList.DataSource     = LabelManage.GetLabelTypeList();
             this.DropLabelList.DataTextField  = "Name";
             this.DropLabelList.DataValueField = "Name";
             this.DropLabelList.DataBind();
             this.DropLabelList.Items.Insert(0, item);
             this.BuildLabelList(string.Empty);
             this.TxtTemplateTest.Text = "{PE.Label id=\"" + this.labelname + "\" /}";
         }
         this.TxtTemplate.Attributes.Add("onmouseup", "dragend(this)");
         this.TxtTemplate.Attributes.Add("onClick", "savePos(this)");
         this.TxtTemplate.Attributes.Add("onmousemove", "DragPos(this)");
     }
     this.SmpNavigator.AdditionalNode = this.labelname;
 }
        protected void InitPage()
        {
            this.m_action = BasePage.RequestString("Action", "Add");
            this.ValeTxtFileName.ValidationExpression = "^[^\\/ :*?\"<>|.]+\\.html$";
            string str = BasePage.RequestString("Dir").Replace("..", string.Empty);

            this.currentPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + str;
            this.currentPath = this.currentPath.Replace("/", @"\");
            if (!this.Page.IsPostBack)
            {
                string str2 = "TemplateManage.aspx";
                if (!string.IsNullOrEmpty(str))
                {
                    if (str.IndexOf('.') > 0)
                    {
                        str2 = str2 + "?Dir=" + base.Server.UrlEncode(str.Substring(0, str.LastIndexOf('/')));
                    }
                    else
                    {
                        str2 = str2 + "?Dir=" + base.Server.UrlEncode(str);
                    }
                }
                this.ViewState["UrlReferrer"] = str2;
                if (this.m_action == "Modify")
                {
                    this.LblFileName.Text        = str;
                    this.TxtFileName.Visible     = false;
                    this.ValrTxtFileName.Visible = false;
                    this.ValeTxtFileName.Enabled = false;
                    try
                    {
                        this.TxtTemplate.Text = FileSystemObject.ReadFile(this.currentPath);
                    }
                    catch (FileNotFoundException)
                    {
                        AdminPage.WriteErrMsg("文件未找到", this.ViewState["UrlReferrer"].ToString());
                    }
                    catch (UnauthorizedAccessException)
                    {
                        AdminPage.WriteErrMsg("<li>读取文件失败!检查您的服务器是否给模板文件夹写入权限。</li>", this.ViewState["UrlReferrer"].ToString());
                    }
                }
                if (this.m_action == "Add")
                {
                    this.LblFileName.Text = str + "/";
                }
                ListItem item = new ListItem();
                item.Text = "全部分类";
                this.DropLabelList.DataSource     = LabelManage.GetLabelTypeList();
                this.DropLabelList.DataTextField  = "Name";
                this.DropLabelList.DataValueField = "Name";
                this.DropLabelList.DataBind();
                this.DropLabelList.Items.Insert(0, item);
                this.DropPagerList.DataSource     = PagerManage.GetPagerTypeList();
                this.DropPagerList.DataTextField  = "Name";
                this.DropPagerList.DataValueField = "Name";
                this.DropPagerList.DataBind();
                this.DropPagerList.Items.Insert(0, item);
                this.BuildLabelList(string.Empty);
                this.BuildPagerList(string.Empty);
            }
        }