示例#1
0
        public void LoadDataInfo(string begivenmedal)
        {
            //DataTable availableMedal = Medals.GetAvailableMedal();
            var availableMedal = Medal.GetAvailable().ToDataTable(false);

            if (availableMedal != null)
            {
                DataColumn dataColumn = new DataColumn();
                dataColumn.ColumnName   = "isgiven";
                dataColumn.DataType     = typeof(Boolean);
                dataColumn.DefaultValue = false;
                dataColumn.AllowDBNull  = false;
                availableMedal.Columns.Add(dataColumn);
                foreach (DataRow dataRow in availableMedal.Rows)
                {
                    if (begivenmedal.IndexOf("," + dataRow["medalid"].ToString() + ",") >= 0)
                    {
                        dataRow["isgiven"] = true;
                    }
                }
                this.medallist.DataSource = availableMedal;
                this.medallist.DataBind();
            }
        }
示例#2
0
        public void LoadCurrentUserInfo(int uid)
        {
            this.ViewState["username"] = this.userInfo.Name;
            this.userName.Text         = this.userInfo.Name;
            if (this.userInfo.GroupID == 8 && this.config.Regverify == 1)
            {
                this.ReSendEmail.Visible = true;
            }
            else
            {
                this.ReSendEmail.Visible = false;
            }
            this.nickname.Text             = this.userInfo.NickName;
            this.accessmasks.SelectedValue = this.userInfo.AccessMasks + "";
            this.bday.Text            = this.userInfo.Bday;
            this.credits.Text         = this.userInfo.Credits.ToString();
            this.digestposts.Text     = this.userInfo.DigestPosts.ToString();
            this.email.Text           = this.userInfo.Email;
            this.gender.SelectedValue = this.userInfo.Gender.ToString();
            //if (this.userInfo.GroupID.ToString() == "")
            //{
            //    this.groupid.SelectedValue = "0";
            //}
            //else
            //{
            if (this.groupid.Items.FindByValue(this.userInfo.GroupID.ToString()) != null)
            {
                this.groupid.SelectedValue = this.userInfo.GroupID.ToString();
            }
            else
            {
                UserGroup ug = CreditsFacade.GetCreditsUserGroupId((float)this.userInfo.Credits);
                if (ug != null)
                {
                    this.groupid.SelectedValue = ug.ID.ToString();
                }
            }
            //}
            if (uid == BaseConfigs.GetFounderUid)
            {
                this.groupid.Enabled = false;
            }
            if (this.userInfo.GroupID == 4)
            {
                this.StopTalk.Text     = "取消禁言";
                this.StopTalk.HintInfo = "取消禁言将会把当前用户所在的 \\'系统禁言\\' 组进行系统调整成为非禁言组";
            }
            this.ViewState["GroupID"]    = this.userInfo.GroupID.ToString();
            this.invisible.SelectedValue = this.userInfo.Invisible.ToString();
            this.joindate.Text           = this.userInfo.JoinDate.ToString("yyyy-MM-dd HH:mm:ss");
            this.lastactivity.Text       = this.userInfo.LastActivity.ToString("yyyy-MM-dd HH:mm:ss");
            this.lastip.Text             = this.userInfo.LastIP;
            this.lastpost.Text           = this.userInfo.LastPost.ToString("yyyy-MM-dd HH:mm:ss");
            this.lastvisit.Text          = this.userInfo.LastVisit.ToString("yyyy-MM-dd HH:mm:ss");;
            this.newpm.SelectedValue     = this.userInfo.Newpm.ToString();
            switch ((ReceivePMSettingType)this.userInfo.NewsLetter)
            {
            case ReceivePMSettingType.ReceiveNone:
                this.SetNewsLetter(false, false, false);
                break;

            case ReceivePMSettingType.ReceiveSystemPM:
                this.SetNewsLetter(true, false, false);
                break;

            case ReceivePMSettingType.ReceiveUserPM:
                this.SetNewsLetter(false, true, false);
                break;

            case ReceivePMSettingType.ReceiveAllPM:
                this.SetNewsLetter(true, true, false);
                break;

            case ReceivePMSettingType.ReceiveSystemPMWithHint:
                this.SetNewsLetter(true, false, true);
                break;

            case ReceivePMSettingType.ReceiveUserPMWithHint:
                this.SetNewsLetter(false, true, true);
                break;

            default:
                this.SetNewsLetter(true, true, true);
                break;
            }
            this.oltime.Text             = this.userInfo.OLTime.ToString();
            this.pageviews.Text          = this.userInfo.PageViews.ToString();
            this.pmsound.Text            = this.userInfo.Pmsound.ToString();
            this.posts.Text              = this.userInfo.Posts.ToString();
            this.ppp.Text                = this.userInfo.Ppp.ToString();
            this.regip.Text              = this.userInfo.RegIP;
            this.showemail.SelectedValue = this.userInfo.ShowEmail.ToString();
            this.sigstatus.SelectedValue = this.userInfo.Sigstatus.ToString();
            if (this.userInfo.TemplateID != 0)
            {
                this.templateid.SelectedValue = this.userInfo.TemplateID.ToString();
            }
            this.tpp.Text         = this.userInfo.Tpp.ToString();
            this.extcredits1.Text = this.userInfo.ExtCredits1.ToString();
            this.extcredits2.Text = this.userInfo.ExtCredits2.ToString();
            this.extcredits3.Text = this.userInfo.ExtCredits3.ToString();
            this.extcredits4.Text = this.userInfo.ExtCredits4.ToString();
            this.extcredits5.Text = this.userInfo.ExtCredits5.ToString();
            this.extcredits6.Text = this.userInfo.ExtCredits6.ToString();
            this.extcredits7.Text = this.userInfo.ExtCredits7.ToString();
            this.extcredits8.Text = this.userInfo.ExtCredits8.ToString();

            IUserField uf = userInfo.Field;

            this.website.Text       = uf.Website;
            this.icq.Text           = uf.Icq;
            this.qq.Text            = uf.qq;
            this.yahoo.Text         = uf.Yahoo;
            this.msn.Text           = uf.Msn;
            this.skype.Text         = uf.Skype;
            this.location.Text      = uf.Location;
            this.customstatus.Text  = uf.Customstatus;
            this.bio.Text           = uf.Bio;
            this.signature.Text     = uf.Signature;
            this.realname.Text      = uf.RealName;
            this.idcard.Text        = uf.Idcard;
            this.mobile.Text        = uf.Mobile;
            this.phone.Text         = uf.Phone;
            this.givenusername.Text = this.userInfo.Name;
            if (String.IsNullOrEmpty(uf.Medals))
            {
                uf.Medals = "0";
            }

            string text = "," + uf.Medals + ",";
            //DataTable availableMedal = Medals.GetAvailableMedal();
            DataTable availableMedal = Medal.GetAvailable().ToDataTable(false);

            if (availableMedal != null)
            {
                DataColumn dataColumn = new DataColumn();
                dataColumn.ColumnName   = "isgiven";
                dataColumn.DataType     = typeof(Boolean);
                dataColumn.DefaultValue = false;
                dataColumn.AllowDBNull  = false;
                availableMedal.Columns.Add(dataColumn);
                foreach (DataRow dataRow in availableMedal.Rows)
                {
                    if (text.IndexOf("," + dataRow["id"].ToString() + ",") >= 0)
                    {
                        dataRow["isgiven"] = true;
                    }
                }
                this.medalslist.DataSource = availableMedal;
                this.medalslist.DataBind();
            }
        }