protected void Page_Load(object sender, EventArgs e)
 {
     //取栏目数据
     dt = bllModuleNode.GetList("SITEWEB", Utils.getOneParams(this.SiteID.ToString()));
     if (!IsPostBack)
     {
         //绑定ListBox
         this.BindDate();
     }
 }
示例#2
0
        //绑定栏目名称
        private void BindDate()
        {
            lsbColumn1.Items.Clear();
            lsbColumn2.Items.Clear();
            dt = bllModuleNode.GetList("SITEWEB", Utils.getOneParams(this.SiteID.ToString()));
            if (dt.Rows.Count > 0)
            {
                ListItem ls = new ListItem(dt.Rows[0]["NodeName"].ToString(), dt.Rows[0]["NodeCode"].ToString());
                this.lsbColumn1.Items.Add(ls);
                this.lsbColumn2.Items.Add(ls);
            }
            for (int j = 1; j < dt.Rows.Count; j++)
            {
                DataRow dr = dt.Rows[j];
                //文件栏目
                if (dr["NodeType"].ToString() == "0")
                {
                    //根据NodeCode的长度产生多个"└"
                    string strMark = "└─";
                    for (int i = 6; i < dr["NodeCode"].ToString().Length; i = i + 3)
                    {
                        strMark = strMark + "└─";
                    }
                    ListItem ls = new ListItem(strMark + dr["NodeName"].ToString(), dr["NodeCode"].ToString());
                    this.lsbColumn1.Items.Add(ls);
                    //this.lsbColumn2.Items.Add(ls);
                }
                //文件夹栏目

                else
                {
                    //如果是IsContainWebContent=1的节点下面的栏目,不产生"└"
                    if (dr["ParentNode"].ToString() == SysNodeCode)
                    {
                        ListItem ls = new ListItem(dr["NodeName"].ToString(), dr["NodeCode"].ToString());
                        this.lsbColumn1.Items.Add(ls);
                        this.lsbColumn2.Items.Add(ls);
                    }
                    else
                    {
                        //根据NodeCode的长度产生多个"└"
                        string strMark = "└─";
                        for (int i = 6; i < dr["NodeCode"].ToString().Length; i = i + 3)
                        {
                            strMark = strMark + "└─";
                        }
                        ListItem ls = new ListItem(strMark + dr["NodeName"].ToString(), dr["NodeCode"].ToString());
                        this.lsbColumn1.Items.Add(ls);
                        this.lsbColumn2.Items.Add(ls);
                    }
                }
            }
        }
示例#3
0
        private void PageInit()
        {
            //页面控件数据加载
            if (this.Action == "EDIT")
            {
                DataTable dt = bllModuleNode.GetList("ONE", Utils.getOneParams(ID));
                btnEdit.Text       = Utils.GetResourcesValue("Common", "Update");
                dlMenuType.Visible = true;
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    txtNodeID.Text            = dr["NodeID"].ToString();
                    txtNodeCode.Text          = dr["NodeCode"].ToString();
                    txtNodeName.Text          = dr["NodeName"].ToString();
                    hidLogTitle.Value         = dr["NodeName"].ToString();
                    txtNodelIcon.Text         = dr["NodelIcon"].ToString();
                    txtCurrentImg.Text        = dr["CurrentImg"].ToString();
                    txtMouseOverImg.Text      = dr["MouseOverImg"].ToString();
                    chkIsLeftDisplay.Checked  = Utils.ParseBool(Convert.ToInt32(dr["IsLeftDisplay"]));
                    chkIsTopMenuShow.Checked  = Utils.ParseBool(dr["IsTopMenuShow"].ToString());
                    chkIsLeftMenuShow.Checked = Utils.ParseBool(dr["IsLeftMenuShow"].ToString());
                    txtLinkURL.Text           = dr["LinkURL"].ToString();
                    RBL_IsValid.SelectedValue = dr["IsValid"].ToString();
                    txtNodelOrder.Text        = dr["NodelOrder"].ToString();
                    Editor1.Content           = dr["NodelDesc"].ToString();
                    txtNodelEngDesc.Text      = dr["NodelEngDesc"].ToString();
                    txtTips.Text      = dr["Tips"].ToString();
                    txtPageTitle.Text = dr["PageTitle"].ToString();
                    txtKeyWords.Text  = dr["Meta_Keywords"].ToString();
                    txtMetaDesc.Text  = dr["Meta_Description"].ToString();
                    txtBanner.Text    = dr["Banner"].ToString();
                    switch (dr["OpenType"].ToString())
                    {
                    case ("1"): { radSelf.Checked = true; break; }

                    case ("2"): { radNew.Checked = true; break; }

                    default: { radSelf.Checked = true; break; }
                    }
                }
            }
            else
            {
                btnDel.Visible     = false;
                dlMenuType.Visible = false;
                btnEdit.Text       = Utils.GetResourcesValue("Common", "Add");
                //生成新GUID用于新增操作产生Nodeid
                txtNodeID.Text = Guid.NewGuid().ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            OnDel();
            if (!IsPostBack)
            {
                sb.Append("\n<script Type='text/javascript'>").Append("\n");
                sb.Append("<!--").Append("\n");
                sb.Append("d = new dTree('d');").Append("\n");
                sb.Append("d.config.closeSameLevel=true;");

                //读取数据
                KingTop.BLL.SysManage.ModuleNode bll = new KingTop.BLL.SysManage.ModuleNode();
                DataTable dt = bll.GetList("SITEWEB", Utils.getOneParams(this.SiteID.ToString()));

                if (dt != null)
                {
                    try
                    {
                        CreateTree(dt, "0");
                    }
                    catch (Exception err)
                    {
                        string stremp = err.Message;
                    }
                }

                sb.Append("document.write(d);").Append("\n");
                //打开所有节点
                sb.Append(" d.openAll();").Append("\n");
                sb.Append("//-->").Append("\n");
                sb.Append("</script>").Append("\n");
                menutree.InnerHtml = sb.ToString();
            }
        }
示例#5
0
        private void PageInit()
        {
            //页面控件数据加载
            if (this.Action == "EDIT")
            {
                DataTable dt = bllModuleNode.GetList("ONE", Utils.getOneParams(ID));
                btnEdit.Text       = Utils.GetResourcesValue("Common", "Update");
                dlMenuType.Visible = true;
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    txtNodeID.Text    = dr["NodeID"].ToString();
                    txtNodeCode.Text  = dr["NodeCode"].ToString();
                    txtNodeName.Text  = dr["NodeName"].ToString();
                    hidLogTitle.Value = dr["NodeName"].ToString();
                    if (Utils.ParseBool(dr["NodeType"].ToString()))
                    {
                        chkIsFolder.Checked        = Utils.ParseBool(dr["NodeType"].ToString());
                        this.lblModel.Text         = "*";
                        dlContentTemplate.Visible  = false;
                        dlListPageTemplate.Visible = false;
                    }
                    //else
                    //{
                    //    ddlModel.Enabled = false;
                    //}
                    txtLinkURL.Text = dr["LinkURL"].ToString();
                    if (dr["ModuleID"].ToString().Length == 0 || dr["ModuleID"].ToString() == Guid.Empty.ToString())
                    {
                        ddlModel.SelectedValue = "0";
                    }
                    else
                    {
                        ddlModel.SelectedValue = dr["ModuleID"].ToString();
                    }
                    chkIsLeftDisplay.Checked  = Utils.ParseBool(Convert.ToInt32(dr["IsLeftDisplay"]));
                    chkIsTopMenuShow.Checked  = Utils.ParseBool(dr["IsTopMenuShow"].ToString());
                    chkIsLeftMenuShow.Checked = Utils.ParseBool(dr["IsLeftMenuShow"].ToString());
                    RBL_IsValid.SelectedValue = dr["IsValid"].ToString();
                    txtNodelOrder.Text        = dr["NodelOrder"].ToString();
                    //txtNodelDesc.Text = dr["NodelDesc"].ToString();
                    Editor1.Content                  = dr["NodelDesc"].ToString();
                    txtNodelEngDesc.Text             = dr["NodelEngDesc"].ToString();
                    txtNodelIcon.Text                = dr["NodelIcon"].ToString();
                    txtCurrentImg.Text               = dr["CurrentImg"].ToString();
                    txtMouseOverImg.Text             = dr["MouseOverImg"].ToString();
                    txtNodeDir.Text                  = dr["NodeDir"].ToString();
                    txtTips.Text                     = dr["Tips"].ToString();
                    txtPageTitle.Text                = dr["PageTitle"].ToString();
                    txtKeyWords.Text                 = dr["Meta_Keywords"].ToString();
                    txtMetaDesc.Text                 = dr["Meta_Description"].ToString();
                    txtDefaultTemplate.Text          = dr["DefaultTemplate"].ToString();
                    txtListPageTemplate.Text         = dr["ListPageTemplate"].ToString();
                    txtContentTemplate.Text          = dr["ContentTemplate"].ToString();
                    txtSubDomain.Text                = dr["SubDomain"].ToString();
                    RbtEnableSubDomain.SelectedValue = dr["EnableSubDomain"].ToString();
                    if (!string.IsNullOrEmpty(dr["ReviewFlowID"].ToString()))
                    {
                        ddlReviewFlow.SelectedValue = dr["ReviewFlowID"].ToString();
                    }
                    switch (dr["OpenType"].ToString())
                    {
                    case ("1"): { radSelf.Checked = true; break; }

                    case ("2"): { radNew.Checked = true; break; }

                    default: { radSelf.Checked = true; break; }
                    }
                    switch (dr["PurviewType"].ToString())
                    {
                    case ("1"): { radkf.Checked = true; break; }

                    case ("2"): { radbkf.Checked = true; break; }

                    case ("3"): { radrz.Checked = true; break; }

                    case ("4"): { radgd.Checked = true; break; }

                    default: { radSelf.Checked = true; break; }
                    }
                    chkIsEnableComment.Checked = Utils.ParseBool(dr["IsEnableComment"].ToString());
                    switch (dr["IsCreateListPage"].ToString())
                    {
                    case ("False"): { radCreateListPageTrue.Checked = true; break; }

                    case ("True"): { radCreateListPageFalse.Checked = true; break; }

                    default: { radCreateListPageTrue.Checked = true; break; }
                    }
                    txtIncrementalUpdatePages.Text = dr["IncrementalUpdatePages"].ToString();
                    chkIsEnableIndexCache.Checked  = Utils.ParseBool(dr["IsEnableIndexCache"].ToString());
                    switch (dr["ListPageSavePathType"].ToString())
                    {
                    case ("1"): { radListPageSavePathType1.Checked = true; break; }

                    case ("2"): { radListPageSavePathType2.Checked = true; break; }

                    case ("3"): { radListPageSavePathType3.Checked = true; break; }

                    default: { radListPageSavePathType1.Checked = true; break; }
                    }
                    if (string.IsNullOrEmpty(dr["ListPagePostFix"].ToString()))
                    {
                        try
                        {
                            ddlListPagePostFix.SelectedValue = dr["ListPagePostFix"].ToString();
                        }
                        catch
                        {
                            throw new Exception("没有相应项与之匹配");
                        }
                    }
                    switch (dr["IsCreateContentPage"].ToString())
                    {
                    case ("False"): { radCreateContentPageTrue.Checked = true; break; }

                    case ("True"): { radCreateContentPageFalse.Checked = true; break; }

                    default: { radCreateContentPageTrue.Checked = true; break; }
                    }
                    switch (dr["ContentPageHtmlRule"].ToString())
                    {
                    case ("4"): { radContentPageSavePathType4.Checked = true; break; }

                    case ("2"): { radContentPageSavePathType2.Checked = true; break; }

                    case ("3"): { radContentPageSavePathType3.Checked = true; break; }

                    case ("5"): { radContentPageSavePathType5.Checked = true; break; }

                    case ("1"): { radContentPageSavePathType1.Checked = true; break; }

                    case ("6"): { radContentPageSavePathType6.Checked = true; break; }

                    case ("8"): { radContentPageSavePathType8.Checked = true; break; }

                    default: {
                        radContentPageSavePathType7.Checked = true;
                        txtzdyURL.Text = mode.CustomManageLink;
                        break;
                    }
                    }
                    switch (dr["AutoCreateHtmlType"].ToString())
                    {
                    case ("1"): { radAutoCreateHtmlType1.Checked = true; break; }

                    case ("2"): { radAutoCreateHtmlType2.Checked = true; break; }

                    case ("3"): { radAutoCreateHtmlType3.Checked = true; break; }

                    case ("4"): { radAutoCreateHtmlType4.Checked = true; break; }

                    case ("5"): { radAutoCreateHtmlType5.Checked = true; break; }

                    case ("6"): { radAutoCreateHtmlType6.Checked = true; break; }

                    default: { radAutoCreateHtmlType1.Checked = true; break; }
                    }

                    //自定义内容绑定

                    string strCustomContent = dr["Custom_Content"].ToString();
                    InitEditor(strCustomContent);
                    txtBanner.Text = dr["Banner"].ToString();
                    //if (strCustomContent.IndexOf("###") > 0)
                    //{
                    //    //有多个自定义内容
                    //    string[] arrCustomContent = Regex.Split(strCustomContent, "###");
                    //    //选中下拉框

                    //    ddlCustomContentCount.SelectedValue = arrCustomContent.Length.ToString();
                    //    //给第一个TextBox赋值

                    //    txtCustomContent1.Text = arrCustomContent[0];
                    //    //创建控件并赋值

                    //    for (var i = 2; i <= arrCustomContent.Length; i++)
                    //    {
                    //       tdCustomContent.InnerHtml += "自设内容" + i.ToString() + ":";
                    //       tdCustomContent.InnerHtml += "<textarea rows='10' cols='50' name='" + "txtCustomContent" + i.ToString() + "' ID='" + "txtCustomContent" + i.ToString() + "'>" + arrCustomContent[i-1] + "</textarea><br>";
                    //    }

                    //}
                    //else
                    //{
                    //    //只有一个自定义内容
                    //    //选中下拉框

                    //    ddlCustomContentCount.SelectedValue = "1";
                    //    //给第一个TextBox赋值

                    //    txtCustomContent1.Text = strCustomContent;
                    //}
                    ////隐藏域保存数据库信息
                    //this.hiddenCustomContent.Value = strCustomContent;
                }
            }
            else
            {
                btnDel.Visible     = false;
                dlMenuType.Visible = false;
                btnEdit.Text       = Utils.GetResourcesValue("Common", "Add");
                //生成新GUID用于新增操作产生Nodeid
                txtNodeID.Text = Guid.NewGuid().ToString();

                //新增选中一级审核

                ddlReviewFlow.SelectedValue = "000000000000000";
            }
        }
示例#6
0
        private void PageInit()
        {
            //页面控件数据加载
            if (this.Action == "EDIT")
            {
                DataTable dt;
                dt = bllModuleNode.GetList("ONE", Utils.getOneParams(ID));

                btnEdit.Text = Utils.GetResourcesValue("Common", "Update");

                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    txtNodeID.Text            = dr["NodeID"].ToString();
                    txtNodeCode.Text          = NCode;
                    txtNodeName.Text          = dr["NodeName"].ToString();
                    hidLogTitle.Value         = dr["NodeName"].ToString();
                    txtLinkURL.Text           = dr["LinkURL"].ToString();
                    txtCustomManageLink.Text  = dr["CustomManageLink"].ToString();
                    chkIsLeftDisplay.Checked  = Utils.ParseBool(Convert.ToInt32(dr["IsLeftDisplay"]));
                    RBL_IsValid.SelectedValue = dr["IsValid"].ToString();
                    txtNodelOrder.Text        = dr["NodelOrder"].ToString();
                    txtNodelDesc.Text         = dr["NodelDesc"].ToString();
                    txtNodelEngDesc.Text      = dr["NodelEngDesc"].ToString();
                    txtNodelIcon.Text         = dr["NodelIcon"].ToString();
                    chkIsFolder.Checked       = Utils.ParseBool(dr["NodeType"].ToString());
                    ddlModel.Enabled          = !chkIsFolder.Checked;
                    if (dr["ModuleID"].ToString().Length == 0 || dr["ModuleID"].ToString() == Guid.Empty.ToString())
                    {
                        ddlModel.SelectedValue = "0";
                    }
                    else
                    {
                        ddlModel.SelectedValue = dr["ModuleID"].ToString();
                    }
                    chkIsSystem.Checked            = Utils.ParseBool(dr["IsSystem"].ToString());
                    chkIsContainWebContent.Checked = Utils.ParseBool(dr["IsContainWebContent"].ToString());
                    if (!string.IsNullOrEmpty(dr["ReviewFlowID"].ToString()))
                    {
                        try
                        {
                            ddlReviewFlow.SelectedValue = dr["ReviewFlowID"].ToString();
                        }
                        catch {
                            throw new Exception("没有相应项与之匹配");
                        }
                    }
                }
            }
            else
            {
                if (NodeType == "1")//添加一级目录

                {
                    chkIsFolder.Checked    = true;
                    ddlModel.SelectedValue = "0";
                    ddlModel.Enabled       = false;
                }
                btnDel.Visible = false;
                btnEdit.Text   = Utils.GetResourcesValue("Common", "Add");
                txtNodeID.Text = Guid.NewGuid().ToString();
                //新增选中一级审核

                ddlReviewFlow.SelectedValue = "000000000000000";
            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ////判断是否有当前操作的新建权限
            if (!IsHaveRightByOperCode("New"))
            {
                btnNew.Visible = false;
            }
            OnDel();
            if (!IsPostBack)
            {
                Utils.SetVisiteList(SystemConst.COOKIES_PAGE_KEY, Session.SessionID, Utils.GetUrlParams().Replace("&", "|"), SystemConst.intMaxCookiePageCount); //把当前url全部参数存入cookie中
                StringBuilder sb = new StringBuilder();
                sb.Append("\n<script Type='text/javascript'>").Append("\n");
                sb.Append("<!--").Append("\n");
                sb.Append("d = new dTree('d');").Append("\n");
                sb.Append("d.config.closeSameLevel=true;");

                //读取数据
                KingTop.BLL.SysManage.ModuleNode bll = new KingTop.BLL.SysManage.ModuleNode();
                DataTable dt = bll.GetList("SITESYS", Utils.getOneParams(this.SiteID.ToString()));

                if (dt != null)
                {
                    try
                    {
                        string stremp2  = dt.Rows.Count.ToString();
                        string parentid = "";
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["NodeCode"].ToString().Length <= 3)
                            {
                                parentid = "-1";
                            }
                            else
                            {
                                parentid = dr["NodeCode"].ToString().Substring(0, dr["NodeCode"].ToString().Length - 3);
                            }
                            string strPer = "&nbsp;&nbsp;";
                            if (dr["NodeType"].ToString() == "1")
                            {
                                strPer += "<a HREF=ModelNodeEdit.aspx?Action=New&NodeID=" + NodeID + "&ID=" + dr["NodeID"] + "&NCode=" + dr["NodeCode"] + "&NodeCode=" + NodeCode + "&IsParent=" + dr["NodeType"] + " title=添加子栏目><img SRC=../images/folder.gif border=0></a>&nbsp;&nbsp;";
                            }
                            strPer += "<a HREF=ModelNodeEdit.aspx?Action=Edit&NodeID=" + NodeID + "&ID=" + dr["NodeID"] + "&NCode=" + dr["NodeCode"] + "&NodeCode=" + NodeCode + "&IsParent=" + dr["NodeType"] + " title=修改><img SRC=../images/pen.gif border=0></a>";
                            strPer += "<a HREF=ModelNodeList.aspx?Action=Del&NodeID=" + NodeID + "&ID=" + dr["NodeID"] + "&NCode=" + dr["NodeCode"] + "&NodeCode=" + NodeCode + "&ColumnType=" + dr["ColumnType"] + "&IsParent=" + dr["NodeType"] + " title=删除 onclick=\"selfconfirm({msg:\\'确定要执行删除操作吗?\\',fn:function(data){setAction1(data,\\'" + dr["NodeID"] + "\\',\\'" + dr["NodeCode"] + "\\')}});return false;\"><img SRC=../images/DTree/Del.gif border=0   style=padding-right:5px;padding-left:5px></a>";
                            sb.Append("d.add(").Append(dr["NodeCode"]).Append(",")
                            .Append(parentid).Append(",'").Append(dr["NodeName"]).Append(strPer)
                            .Append("');").Append("\n");
                        }
                    }
                    catch (Exception err)
                    {
                        string stremp = err.Message;
                    }
                }

                sb.Append("document.write(d);").Append("\n");
                //打开所有节点
                sb.Append(" d.openAll();").Append("\n");
                sb.Append("//-->").Append("\n");
                sb.Append("</script>").Append("\n");
                menutree.InnerHtml = sb.ToString();
            }
        }