예제 #1
0
        //绑定父站点列表

        private void BinParentSite()
        {
            DataTable dt = bll.GetList("ALL", Utils.getOneParams(""));

            if (dt.Rows.Count > 0)
            {
                //this.ddlParentSite.DataSource = dt.DefaultView;
                //this.ddlParentSite.DataTextField = "SiteName";
                //this.ddlParentSite.DataValueField = "SiteID";
                //this.ddlParentSite.DataBind();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ddlSiteTemplate.Items.Add(new ListItem(dt.Rows [i]["SiteName"].ToString(), dt.Rows [i]["SiteID"].ToString() + "|" + dt.Rows [i]["Directory"].ToString()));
                }
                //ddlSiteTemplate.DataSource = dt;
                //ddlSiteTemplate.DataTextField = "SiteName";
                //ddlSiteTemplate.DataValueField = "SiteID";
                //ddlSiteTemplate.DataBind();

                //有记录选中子站,无法更改

                this.rdoMain.Checked = false;
                this.rdoLeaf.Checked = true;
            }
            else
            {
                //没有记录选中主站,无法更改

                this.rdoMain.Checked = true;
                this.rdoLeaf.Checked = false;
                ////主站,无上级站点
                //ListItem ls = new ListItem("无上级站点", "0");//追加一项

                //this.ddlParentSite.Items.Insert(0, ls);
                //this.ddlParentSite.Enabled = false;
            }

            this.rdoMain.Enabled = false;
            this.rdoLeaf.Enabled = false;
        }
예제 #2
0
        private void BindSite()
        {
            KingTop.BLL.SysManage.SysWebSite bllSysWebSite = new KingTop.BLL.SysManage.SysWebSite();
            DataTable dt = bllSysWebSite.GetList("USERIDSITE", Utils.getOneParams(userid));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (int.Parse(dt.Rows[i]["SiteID"].ToString()) == SiteID)
                {
                    strSite += "<option value=\"index.aspx?siteid=" + dt.Rows[i]["SiteID"].ToString() + "&sitedir=" + dt.Rows[i]["Directory"].ToString() + "\" selected>" + dt.Rows[i]["SiteName"].ToString() + "</option>";
                }
                else
                {
                    strSite += "<option value=\"index.aspx?siteid=" + dt.Rows[i]["SiteID"].ToString() + "&sitedir=" + dt.Rows[i]["Directory"].ToString() + "\">" + dt.Rows[i]["SiteName"].ToString() + "</option>";
                }
            }
            strSite += "</select>";
        }