Beispiel #1
0
    //会员组等下拉框绑定
    private void DPBind()
    {
        DataTable dt = groupBll.GetGroupList();

        UserGroup_DP.DataSource = dt;
        UserGroup_DP.DataBind();
        SelectGroup.DataSource = dt;//数据绑定
        SelectGroup.DataBind();
        this.SelectGroup.Items.Insert(0, new ListItem("选择等级", "0"));
        ddlGroup.DataSource = dt;
        ddlGroup.DataBind();
    }
        //会员组等下拉框绑定
        private void DPBind()
        {
            DataTable dt = groupBll.GetGroupList();

            UserGroup_DP.DataSource = dt;
            UserGroup_DP.DataBind();
            SelectGroup.DataSource = dt;//数据绑定
            SelectGroup.DataBind();
            SelectGroup.Items.Insert(0, new ListItem(Resources.L.择等级, "0"));
            ddlGroup_DP.DataSource = dt;
            ddlGroup_DP.DataBind();
            ddlGroup_DP.Items.Insert(0, new ListItem(Resources.L.全部会员, "0"));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <M_UserInfo> Dinfo = new List <M_UserInfo>();
                List <M_Uinfo>    Iinfo = new List <M_Uinfo>();
                mu = buser.SelReturnModel(UserID);
                if (mu.IsNull)
                {
                    function.WriteErrMsg("用户[" + UserID + "]不存在");
                }
                basemu = buser.GetUserBaseByuserid(UserID);
                //判断是否是认证用户
                ApproveFailure_B.Visible = (mu.State == 2);
                if (DataConvert.CLng(mu.ParentUserID) > 0)
                {
                    pmu = buser.SelReturnModel(Convert.ToInt32(mu.ParentUserID));
                }
                Dinfo.Add(mu);
                Iinfo.Add(basemu);
                UInfo_RPT.DataSource = Dinfo;
                UInfo_RPT.DataBind();
                BaseMU_RPT.DataSource = Iinfo;
                BaseMU_RPT.DataBind();
                #region 增加模型选项卡
                DataTable dtModelUser = bm.GetListUser();
                string    labstr      = "";
                int       tabnum      = 3;
                for (int i = 0; i < dtModelUser.Rows.Count; i++)
                {
                    string    tablename = dtModelUser.Rows[i]["TableName"].ToString();
                    DataTable info      = bmf.SelectTableName(tablename, "userid=" + UserID);
                    if (info != null && info.Rows.Count > 0)
                    {
                        int       modelid    = Convert.ToInt32(dtModelUser.Rows[i]["ModelId"].ToString());
                        DataTable modelfiled = bmf.GetModelFieldList(modelid);
                        labstr      += "<td id=\"TabTitle" + (tabnum) + ("\" class=\"tabtitle\" onclick=\"ShowTabss(" + (tabnum)) + ")\">\r";
                        labstr      += dtModelUser.Rows[i]["ModelName"].ToString() + "\r";
                        labstr      += ("</td>\r");
                        tabTitles   += ", \"TabTitle" + (tabnum) + "\"";
                        tabs        += ", \"Tabs" + (tabnum) + "\"";
                        ltlTab.Text += "<tbody id=\"Tabs" + (tabnum) + "\" style=\"display: none\">";
                        ltlTab.Text += "<tr>";
                        ltlTab.Text += "<td colspan=\"4\">";
                        ltlTab.Text += " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";

                        for (int k = 0; k < modelfiled.Rows.Count; k++)
                        {
                            if (k % 2 == 0)
                            {
                                ltlTab.Text += "<tr class=\"tdbg\">\r";
                            }
                            ltlTab.Text += "<td class=\"tdbgleft\" style=\"width: 15%; height: 22px\" align=\"right\">\r";
                            ltlTab.Text += modelfiled.Rows[k]["FieldAlias"].ToString() + "\r";
                            ltlTab.Text += "</td>\r";
                            ltlTab.Text += "<td style=\"width: 35%; height: 22px\" align=\"left\">\r";
                            ltlTab.Text += info.Rows[0][modelfiled.Rows[k]["FieldName"].ToString()].ToString() + "\r";
                            ltlTab.Text += "</td>\r";
                            if (k % 2 != 0)
                            {
                                ltlTab.Text += "</tr>\r";
                            }
                        }
                        ltlTab.Text += " </table>";
                        ltlTab.Text += " </td>";
                        ltlTab.Text += " </tr>";
                        ltlTab.Text += "</tbody>";
                        tabnum++;
                    }
                }
                #endregion
                tbSign.Text                = basemu.Sign;
                txtDeadLine.Text           = mu.DeadLine.ToString();//有效期截止时间
                txtCerificateDeadLine.Text = mu.CerificateDeadLine.ToString();
                Privancy.Text              = tbPrivacy.SelectedValue.ToString();
                Privancy.Text              = tbPrivacy.Items[basemu.Privating].Text;
                DataTable dtuser2 = buser.GetUserBaseByuserid(UserID.ToString());
                lblHtml.Text = bub.GetUpdateHtml(dtuser2);
                BindUserRole(mu);
                AuthorDT = null;
                //-----------------
                try
                {
                    DataTable gpdt = gpBll.Sel();
                    UserGroup_DP.DataSource = gpdt;
                    UserGroup_DP.DataBind();
                    UserGroup_DP.Items.Insert(0, new ListItem("未分组", "0"));
                    UserGroup_DP.SelectedValue = mu.GroupID.ToString();
                }
                catch { UserGroup_DP.Items[0].Text = "会员组[" + mu.GroupID + "]不存在"; }
                M_User_BindPro ubpMod = ubpBll.SelModelByUid(UserID);
                if (ubpMod != null && !string.IsNullOrEmpty(ubpMod.ProIDS))
                {
                    UPProDT = proBll.SelByIDS(StrHelper.PureIDSForDB(ubpMod.ProIDS));
                    string pids = "", nids = "";
                    foreach (DataRow dr in UPProDT.Rows)
                    {
                        pids += dr["ID"] + ",";
                    }
                    foreach (DataRow dr in UPProDT.Rows)
                    {
                        nids += dr["NodeID"] + ",";
                    }
                    nids = nids.TrimEnd(','); pids.TrimEnd(',');
                    DataTable nodedt = nodeBll.SelByIDS(nids);
                    UPRONode_RPT.DataSource = nodedt;
                    UPRONode_RPT.DataBind();
                    UProIDS_Hid.Value = StrHelper.IdsFormat(pids);
                }
                if (DataConvert.CStr(Request["show"]) == "diag")
                {
                    Call.HideBread(Master);
                }
                else
                {
                    Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='AdminManage.aspx'>用户管理</a></li><li><a href='UserManage.aspx'>会员管理</a></li><li class='active'><a href='" + Request.RawUrl + "'>会员信息</a> 当前用户:" + mu.UserName + "</li>");
                }
            }
        }