コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //if (!B_ARoleAuth.Check(ZLEnum.Auth.label, "LabelManage"))
     //{
     //    function.WriteErrMsg("没有权限进行此项操作");
     //}
     B_Permission.CheckAuthEx("design");
     if (!IsPostBack)
     {
         //Call.HideBread(Master);
         string cateTlp = "<li class='{0}' role='presentation'><a href='LabelManage.aspx?Cate={1}'>{2}</a></li>";
         lblLabel.Text += string.Format(cateTlp, (string.IsNullOrEmpty(LabelCate) ? "active" : ""), "", "所有标签");
         DataTable CateTable = bll.GetLabelCateListXML();//标签类别
         foreach (DataRow dr in CateTable.Rows)
         {
             if (string.IsNullOrEmpty(dr["name"].ToString()))
             {
                 continue;
             }
             string isactive = dr["name"].ToString().Equals(LabelCate) ? "active" : "";
             lblLabel.Text += string.Format(cateTlp, isactive, HttpUtility.UrlEncode(dr["name"].ToString()), dr["name"]);
         }
         //-----------------
         KeyWord = Request.QueryString["KeyWord"] ?? "";
         DataTable dt = bll.SelAllLabel(LabelCate, KeyWord);
         RPT.DataSource = dt;
         RPT.DataBind();
     }
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                #region ajax
                string result = "";
                switch (Action)
                {
                case "custom":
                {
                    string    cate = Request.Form["cate"];
                    DataTable dt   = labelBll.SelAllLabel(cate);
                    result = JsonConvert.SerializeObject(dt);
                }
                break;

                case "field":
                {
                    int labelid = DataConverter.CLng(Request.Form["labelid"]);
                    if (labelid < 1)
                    {
                        break;
                    }
                    M_Label labelMod = labelBll.GetLabelXML(labelid);
                    string  html = "", connStr = SqlHelper.ConnectionString;
                    html   = labelBll.SetLabelColumn(labelMod.LabelField, labelMod.LabelTable, labelMod.LableName, connStr);
                    result = StringHelper.Base64StringEncode(html);
                }
                break;
                }
                Response.Write(result); Response.Flush(); Response.End();
                #endregion
            }
            B_Permission.CheckAuthEx("design");
            if (!IsPostBack)
            {
                Design_Btn.Visible            = string.IsNullOrEmpty(Mid);
                Save_Btn.Visible              = !string.IsNullOrEmpty(Mid);
                CustomLabel_DP.DataSource     = labelBll.GetLabelCateListXML();
                CustomLabel_DP.DataTextField  = "name";
                CustomLabel_DP.DataValueField = "name";
                CustomLabel_DP.DataBind();
                CustomLabel_DP.Items.Insert(0, new ListItem("选择标签类型", ""));
                Field_DP.DataSource     = labelBll.GetSourceLabelXML();//LabelType
                Field_DP.DataTextField  = "LabelName";
                Field_DP.DataValueField = "LabelID";
                Field_DP.DataBind();
                Field_DP.Items.Insert(0, new ListItem("选择数据源标签", ""));
                lblSys.Text = bfun.GetSysLabel();
                lblFun.Text = bfun.GetFunLabel();
                DealInvoke();
                Alias_T.Text = LabelName;
                if (!string.IsNullOrEmpty(LName))
                {
                    if (badmin.CheckLogin())
                    {
                        Response.Redirect(CustomerPageAction.customPath2 + "Template/LabelSQL.aspx?LabelName=" + HttpUtility.UrlEncode(LabelName));
                    }
                    else
                    {
                        function.WriteErrMsg("修改动态标签,必须以管理员身份登录");
                    }
                }
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_User.CheckIsLogged(Request.RawUrl);
            AutoCreateSite();
            //if (!new B_User().CheckLogin()) { function.Script(this, "AjaxLogin();"); return; }
            M_UserInfo mu = buser.GetLogin(false);

            //-----------获取需要修改的页面
            #region 根据路径与SiteID访问(disuse)
            //if (string.IsNullOrEmpty(Mid) && SiteID < 1 && string.IsNullOrEmpty(Path))
            //{
            //    Response.Redirect("/Design/User/");
            //}
            //if (!string.IsNullOrEmpty(Mid))
            //{
            //    pageMod = pageBll.SelModelByGuid(Mid);
            //}
            //else if (SiteID > 0)
            //{
            //    pageMod = pageBll.SelModelBySiteID(SiteID, Path);
            //}
            #endregion
            M_Design_SiteInfo sfMod = sfBll.SelModelByUid(mu.UserID);
            if (sfMod == null)
            {
                function.WriteErrMsg("尚未创建站点,<a href='/'>返回首页</a>");
            }
            if (string.IsNullOrEmpty(Mid))
            {
                pageMod = pageBll.SelModelBySiteID(sfMod.ID, "");
                if (pageMod == null || pageMod.ID < 1)
                {
                    function.WriteErrMsg("未指定首页 <a href='/Design/User/'>用户中心</a>");
                }
                else
                {
                    Response.Redirect("?ID=" + pageMod.guid);
                }
            }
            else
            {
                pageMod = pageBll.SelModelByGuid(Mid);
            }
            if (pageMod == null)
            {
                function.WriteErrMsg("指定的页面不存在");
            }
            M_Design_Tlp tlpMod = tlpBll.SelReturnModel(pageMod.TlpID);
            if (tlpMod != null)
            {
                TlpName_L.Text = "[" + tlpMod.TlpName + "]";
            }
            //demo应该注释该句
            if (pageMod.IsTemplate)
            {
                B_Permission.CheckAuthEx("design");
            }
            //if (pageMod.UserID != mu.UserID) { function.WriteErrMsg("你无权修改该页面"); }
            pageMod = pageBll.MergeGlobal(pageMod, Source);
            if (pageMod.comp_global.Count > 0)
            {
                comp_global = JsonConvert.SerializeObject(pageMod.comp_global);
            }

            //---------站点//修改模板时无站点数据
            if (sfMod != null)
            {
                sitecfg   = sfBll.ToSiteCfg(sfMod);
                mu.SiteID = sfMod.ID;
                //---------域名(没有则直接创建,只能有一个)
                M_IDC_DomainList domMod = domBll.SelModelByUid(mu.UserID);
                if (domMod != null)
                {
                    domain_a.HRef      = "http://" + domMod.DomName;
                    domain_a.InnerText = domMod.DomName;
                }
            }
            //解析标签
            if (!string.IsNullOrEmpty(pageMod.labelArr))
            {
                DataTable labelDT = new DataTable();
                labelDT.Columns.Add(new DataColumn("guid", typeof(string)));
                labelDT.Columns.Add(new DataColumn("label", typeof(string)));
                labelDT.Columns.Add(new DataColumn("htmlTlp", typeof(string)));
                string[] labelArr = pageMod.labelArr.Trim('|').Split('|');
                foreach (string label in labelArr)
                {
                    DataRow dr = labelDT.NewRow();
                    dr["guid"]  = label.Split(':')[0];
                    dr["label"] = label.Split(':')[1];
                    string html = createBll.CreateHtml(StringHelper.Base64StringDecode(dr["label"].ToString()));
                    dr["htmlTlp"] = StringHelper.Base64StringEncode(html);
                    labelDT.Rows.Add(dr);
                }
                extendData = JsonConvert.SerializeObject(labelDT);
            }
            //用户可选择关闭
            if (DeviceHelper.GetBrower() != DeviceHelper.Brower.Chrome)
            {
                function.Script(this, "ShowIE();"); return;
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Permission.CheckAuthEx("design");
 }