protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { foreach (var current in UserGroup.FindAllWithCache()) { if (current.RadminID == 0) { this.sourceusergroup.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); this.targetusergroup.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } foreach (var current2 in UserGroup.GetAdminAndSpecialGroup()) { this.sourceadminusergroup.Items.Add(new ListItem(current2.GroupTitle, current2.ID.ToString())); this.targetadminusergroup.Items.Add(new ListItem(current2.GroupTitle, current2.ID.ToString())); } } }
private void DeleteUserGroupInf_Click(object sender, EventArgs e) { if (base.CheckCookie()) { int @int = DNTRequest.GetInt("groupid", -1); if (AdminUserGroups.DeleteUserGroupInfo(@int)) { DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST); UserGroup.FindAllWithCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户组", "组ID:" + DNTRequest.GetInt("groupid", -1)); base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';"); return; } if (AdminUserGroups.opresult != "") { base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>"); return; } base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>"); } }
private void InitializeComponent() { this.StopTalk.Click += new EventHandler(this.StopTalk_Click); this.DelPosts.Click += new EventHandler(this.DelPosts_Click); this.SaveUserInfo.Click += new EventHandler(this.SaveUserInfo_Click); this.ResetPassWord.Click += new EventHandler(this.ResetPassWord_Click); this.IsEditUserName.CheckedChanged += new EventHandler(this.IsEditUserName_CheckedChanged); this.DelUserInfo.Click += new EventHandler(this.DelUserInfo_Click); this.ReSendEmail.Click += new EventHandler(this.ReSendEmail_Click); this.CalculatorScore.Click += new EventHandler(this.CalculatorScore_Click); this.ResetUserDigestPost.Click += new EventHandler(this.ResetUserDigestPost_Click); this.ResetUserPost.Click += new EventHandler(this.ResetUserPost_Click); this.GivenMedal.Click += new EventHandler(this.GivenMedal_Click); this.userInfo = Users.GetUserInfo(DNTRequest.GetInt("uid", -1)); var creditsUserGroupId = CreditsFacade.GetCreditsUserGroupId((float)this.userInfo.Credits); this.groupid.Items.Add(new ListItem(UserGroup.FindByID(creditsUserGroupId.ID).GroupTitle, creditsUserGroupId.ID.ToString())); foreach (var current in UserGroup.FindAllWithCache()) { if ((current.System != 0 || current.RadminID != 0) && current.ID != 7) { this.groupid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); this.extgroupids.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } } this.templateid.AddTableData(Templates.GetValidTemplateList(), "name", "templateid"); this.templateid.Items[0].Text = "默认"; this.TabControl1.InitTabPage(); if (Request["uid"] == "") { base.Response.Redirect("global_usergrid.aspx"); return; } this.LoadCurrentUserInfo(DNTRequest.GetInt("uid", -1)); this.LoadScoreInf(Request["uid"], Request["fieldname"]); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { foreach (var current in UserGroup.FindAllWithCache()) { this.groupid.Items.Add(new ListItem(current.GroupTitle, current.ID.ToString())); } this.AddUserInfo.Attributes.Add("onclick", "return IsValidPost();"); string text = "var creditarray = new Array("; for (int i = 1; i < this.groupid.Items.Count; i++) { text = text + UserGroup.FindByID(Convert.ToInt32(this.groupid.Items[i].Value)).Creditshigher.ToString() + ","; } text = text.TrimEnd(',') + ");"; base.RegisterStartupScript("begin", "<script type='text/javascript'>" + text + "</script>"); this.groupid.Attributes.Add("onchange", "document.getElementById('" + this.credits.ClientID + "').value=creditarray[this.selectedIndex];"); this.groupid.Items.RemoveAt(0); try { this.groupid.SelectedValue = "10"; } catch { this.groupid.SelectedValue = ((CreditsFacade.GetCreditsUserGroupId(0f) != null) ? CreditsFacade.GetCreditsUserGroupId(0f).ID.ToString() : "3"); } try { var userGroupInfo = UserGroup.FindByID(Convert.ToInt32(this.groupid.SelectedValue)); this.credits.Text = userGroupInfo.Creditshigher.ToString(); } catch { } } }
private void UpdateUserGroupInf_Click(object sender, EventArgs e) { if (base.CheckCookie()) { foreach (DictionaryEntry dictionaryEntry in new Hashtable { { "附件最大尺寸", this.maxattachsize.Text }, { "每天最大附件总尺寸", this.maxsizeperday.Text }, { "个人空间附件总尺寸", this.maxspaceattachsize.Text }, { "相册空间总尺寸", this.maxspacephotosize.Text } }) { if (!Utils.IsInt(dictionaryEntry.Value.ToString())) { base.RegisterStartupScript("", "<script>alert('输入错误," + dictionaryEntry.Key.ToString() + "只能是0或者正整数');window.location.href='global_editusergroup.aspx';</script>"); return; } } if (this.creditshigher.Enabled && (Convert.ToInt32(this.creditshigher.Text) < Convert.ToInt32(this.ViewState["creditshigher"].ToString()) || Convert.ToInt32(this.creditslower.Text) > Convert.ToInt32(this.ViewState["creditslower"].ToString()))) { base.RegisterStartupScript("", "<script>alert('操作失败, 您所输入的积分上下限范围应在" + this.ViewState["creditshigher"].ToString() + "至" + this.ViewState["creditslower"].ToString() + "之间');</script>"); } else { this.userGroupInfo = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1)); this.userGroupInfo.System = 0; this.userGroupInfo.Type = 0; this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text); this.usergrouppowersetting.GetSetting(ref this.userGroupInfo); this.userGroupInfo.GroupTitle = this.groupTitle.Text; this.userGroupInfo.Creditshigher = Convert.ToInt32(this.creditshigher.Text); this.userGroupInfo.Creditslower = Convert.ToInt32(this.creditslower.Text); if (this.userGroupInfo.Creditshigher >= this.userGroupInfo.Creditslower) { base.RegisterStartupScript("", "<script>alert('操作失败, 积分下限必须小于积分上限');</script>"); return; } if (this.userGroupInfo.AllowBonus && this.userGroupInfo.MinBonusprice >= this.userGroupInfo.MaxBonusprice) { base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>"); return; } this.userGroupInfo.Stars = Convert.ToInt32(this.stars.Text); this.userGroupInfo.Color = this.color.Text; this.userGroupInfo.Groupavatar = this.groupavatar.Text; this.userGroupInfo.MaxPrice = Convert.ToInt32(this.maxprice.Text); this.userGroupInfo.MaxPmNum = Convert.ToInt32(this.maxpmnum.Text); this.userGroupInfo.MaxSigSize = Convert.ToInt32(this.maxsigsize.Text); this.userGroupInfo.MaxAttachSize = Convert.ToInt32(this.maxattachsize.Text); this.userGroupInfo.MaxSizeperday = Convert.ToInt32(this.maxsizeperday.Text); this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text); this.userGroupInfo.MaxSpacephotoSize = Convert.ToInt32(this.maxspacephotosize.Text); this.userGroupInfo.AttachExtensions = this.attachextensions.GetSelectString(","); //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo)) userGroupInfo.Save(); { DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST); UserGroup.FindAllWithCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新用户组", "组ID:" + DNTRequest.GetInt("groupid", -1)); base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';"); return; } if (AdminUserGroups.opresult != "") { base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>"); return; } base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>"); return; } return; } }
private void UpdateUserGroupInf_Click(object sender, EventArgs e) { if (base.CheckCookie()) { foreach (DictionaryEntry dictionaryEntry in new Hashtable { { "附件最大尺寸", this.maxattachsize.Text }, { "每天最大附件总尺寸", this.maxsizeperday.Text }, { "个人空间附件总尺寸", this.maxspaceattachsize.Text }, { "相册空间总尺寸", this.maxspacephotosize.Text } }) { if (!Utils.IsInt(dictionaryEntry.Value.ToString())) { base.RegisterStartupScript("", "<script>alert('输入错误," + dictionaryEntry.Key.ToString() + "只能是0或者正整数');window.location.href='global_usergroupspecialgrid.aspx';</script>"); return; } } this.userGroupInfo = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1)); this.userGroupInfo.System = 0; this.userGroupInfo.Type = 0; this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text); int num = (this.radminid.SelectedValue == "0") ? -1 : Convert.ToInt32(this.radminid.SelectedValue); this.userGroupInfo.RadminID = num; if (num.ToString() != this.ViewState["radminid"].ToString()) { Users.UpdateUserAdminIdByGroupId(this.userGroupInfo.RadminID, this.userGroupInfo.ID); } this.userGroupInfo.GroupTitle = this.groupTitle.Text; this.userGroupInfo.Stars = Convert.ToInt32(this.stars.Text); this.userGroupInfo.Color = this.color.Text; this.userGroupInfo.Groupavatar = this.groupavatar.Text; this.userGroupInfo.MaxPrice = Convert.ToInt32(this.maxprice.Text); this.userGroupInfo.MaxPmNum = Convert.ToInt32(this.maxpmnum.Text); this.userGroupInfo.MaxSigSize = Convert.ToInt32(this.maxsigsize.Text); this.userGroupInfo.MaxAttachSize = Convert.ToInt32(this.maxattachsize.Text); this.userGroupInfo.MaxSizeperday = Convert.ToInt32(this.maxsizeperday.Text); this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text); this.userGroupInfo.MaxSpacephotoSize = Convert.ToInt32(this.maxspacephotosize.Text); this.userGroupInfo.AttachExtensions = this.attachextensions.GetSelectString(","); this.usergrouppowersetting.GetSetting(ref this.userGroupInfo); //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo)) userGroupInfo.Save(); { DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST); UserGroup.FindAllWithCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除特殊用户组", "组ID:" + DNTRequest.GetInt("groupid", -1)); base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupspecialgrid.aspx';"); return; } if (AdminUserGroups.opresult != "") { base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>"); return; } base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>"); } }