Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!B_ARoleAuth.Check(ZLEnum.Auth.label, "TemplateEdit"))
     {
         function.WriteErrMsg("没有权限进行此项操作");
     }
     if (!IsPostBack)
     {
         Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li><a href='TemplateManage.aspx'>模板管理</a></li><li>模板编辑</li>" + Call.GetHelp(26));
         dsTable = dsBll.Sel();
         ViewState["dsTable"] = dsTable;
         DPBind();
         if (string.IsNullOrEmpty(Request.QueryString["filepath"]))
         {
             ShowPath = "/";
         }
         else
         {
             ShowPath = Request.QueryString["filepath"];
         }
         string FileExp = Path.GetExtension(FileVPath);
         if (!string.IsNullOrEmpty(FileExp))
         {
             FileName       = Path.GetFileName(FileVPath);
             ShowPath       = ShowPath.Replace(FileName, "").Replace("//", "/");
             TempUrl_L.Text = ShowPath + FileName;
             string fname  = FileName.Contains(".") ? FileName.Split('.')[0] : FileName;
             string exname = FileName.Contains(".") ? FileName.Split('.')[1] : "html";
             if (exname.ToLower().Equals("html"))
             {
                 TxtFilename.Value = fname;
                 name_L.Text       = "." + exname;
             }
             else
             {
                 function.WriteErrMsg("无权修改.html以外的文件!");
             }
             textContent.Text = SafeSC.ReadFileStr(FileVPath);
             Hdnmethod.Value  = "append";
             edit_div.Visible = true;
             if (Path.GetExtension(FileVPath).ToLower().Equals(".html"))
             {
                 ViewEdit_A.Visible = true;
                 ViewEdit_A.HRef    = customPath2 + "Template/Design.aspx?vpath=" + HttpUtility.UrlEncode(FileVPath);
             }
         }
         else
         {
             FileName            = "";
             TxtFilename.Value   = "";
             TxtFilename.Visible = true;
             Hdnmethod.Value     = "add";
             add_div.Visible     = true;
         }
         lblSys.Text       = bfun.GetSysLabel(); //系统标签列表
         lblFun.Text       = bfun.GetFunLabel(); //扩展函数列表
         HdnShowPath.Value = ShowPath;
     }
 }
Ejemplo n.º 2
0
    protected string getExternalConnStr(M_Label label)
    {
        try
        {
            string id = label.DataSourceType;
            dsTable = ViewState["dsTable"] == null?dsBll.Sel() : ViewState["dsTable"] as DataTable;

            return(dsTable.Select("ID='" + id + "'")[0][dsTable.Columns.IndexOf("ConnectionString")] as string);
        }
        catch { return(ConfigurationManager.ConnectionStrings["Connection String"].ConnectionString); }
    }
Ejemplo n.º 3
0
 private void MyBind()
 {
     EGV.DataSource = dsBll.Sel();
     EGV.DataBind();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 返回数据源数据
 /// </summary>
 public DataTable getAllData()
 {
     return(dsBll.Sel());
 }
Ejemplo n.º 5
0
        private void MyBind()
        {
            LabelCate_DP.DataSource = bll.GetLabelCateListXML();
            LabelCate_DP.DataBind();
            //----绑定第二步数据表
            DataTable dsList = dsBll.Sel();

            DBList_DP.Items.Add(new ListItem("系统主数据库", "main"));
            DBList2_DP.Items.Add(new ListItem("系统主数据库", "main"));
            foreach (DataRow dr in dsList.Rows)
            {
                ListItem item = new ListItem("[外]" + dr["DSName"].ToString(), dr["ID"].ToString());
                DBList_DP.Items.Add(item);
                DBList2_DP.Items.Add(item);
            }
            DBList_DP.Items.Add(new ListItem("+添加新数据库", "new"));
            DataTable tableDT = DS_GetByDP(D1).Table_List();

            BindTableListToDP(tableDT, TableList_DP);
            BindTableListToDP(tableDT, TableList2_DP);
            //---最终步
            CustomLabel_DP.DataSource = bll.GetLabelCateListXML();
            CustomLabel_DP.DataBind();
            CustomLabel_DP.Items.Insert(0, new ListItem("选择标签类型", ""));
            lblSys.Text = funBll.GetSysLabel(); //系统标签
            lblFun.Text = funBll.GetFunLabel(); //扩展函数
                                                //-----------------绑定已有数据
            if (!string.IsNullOrEmpty(LabelName))
            {
                M_Label labelMod = bll.GetLabelXML(LabelName);
                labelMod.LabelWhere = ClearTableHolder(labelMod.LabelWhere);
                labelMod.LabelField = ClearTableHolder(labelMod.LabelField);
                labelMod.LabelTable = ClearTableHolder(labelMod.LabelTable);
                labelMod.LabelOrder = ClearTableHolder(labelMod.LabelOrder);
                //第一步
                LabelName_T.Text            = labelMod.LableName;
                LabelCate_T.Text            = labelMod.LabelCate;
                LabelType_Rad.SelectedValue = labelMod.LableType.ToString();
                Desc_T.Text = labelMod.Desc;
                //schema_Text.Text = labelMod.ConnectString;
                //第二步
                string t1 = "", t2 = "";
                if (!string.IsNullOrEmpty(labelMod.DataSourceType) && labelMod.DataSourceType.StartsWith("{"))
                {
                    JObject jobj = JsonConvert.DeserializeObject <JObject>(labelMod.DataSourceType);
                    DBList_DP.SelectedValue  = jobj["ds_m"].ToString();
                    DBList2_DP.SelectedValue = jobj["ds_m"].ToString();
                    t1      = jobj["tb_m"].ToString();
                    t2      = jobj["tb_s"].ToString();
                    tableDT = DS_GetByDP(D1).Table_List();
                    BindTableListToDP(tableDT, TableList_DP);
                    BindTableListToDP(tableDT, TableList2_DP);
                }
                else
                {
                    B_Label.GetT1AndT2(labelMod.LabelTable, ref t1, ref t2);
                }
                TableList_DP.SelectedValue  = t1;
                TableList2_DP.SelectedValue = t2;
                TableList_DP_SelectedIndexChanged(null, null);
                TableList2_DP_SelectedIndexChanged(null, null);
                //是否启用了联接查询
                string joinType = B_Label.GetJoinType(labelMod.LabelTable);
                if (!string.IsNullOrEmpty(joinType))
                {
                    SqlJoin_DP.SelectedValue = joinType;
                    string on1 = "", on2 = "";
                    B_Label.GetOnField(labelMod.LabelTable, ref on1, ref on2);
                    OnField_DP.SelectedValue  = on1;
                    OnField2_DP.SelectedValue = on2;
                }
                SqlTable_T.Text = labelMod.LabelTable;
                SqlField_T.Text = labelMod.LabelField;
                //第三步
                RptParam_Bind(labelMod.Param);
                Param_Hid.Value = labelMod.Param;
                Where_T.Text    = labelMod.LabelWhere;
                Order_T.Text    = labelMod.LabelOrder;
                PSize_T.Text    = labelMod.LabelCount;
                //第四步
                textContent.Text              = labelMod.Content;
                Modeltypeinfo.Text            = labelMod.Modeltypeinfo;
                Modelvalue.Text               = labelMod.Modelvalue;
                setroot.SelectedValue         = labelMod.setroot;
                Valueroot.Text                = labelMod.Valueroot;
                BoolMode_Chk.Checked          = labelMod.IsOpen == 1;
                falsecontent.Text             = labelMod.FalseContent;
                bool_addroot_dp.SelectedValue = labelMod.addroot;
                Bread_L.Text = "当前标签:<a href='" + Request.RawUrl + "'>" + labelMod.LableName + "</a>";
            }
            if (string.IsNullOrEmpty(LabelName))
            {
                Bread_L.Text = "添加新标签";
                if (LabelCate_DP.Items.Count > 0)
                {
                    LabelCate_T.Text = LabelCate_DP.SelectedValue;
                }
            }
        }