Beispiel #1
0
        private void AddUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 插入相关组信息数据

            if (this.CheckCookie())
            {
                __usergroupinfo.System     = 0;
                __usergroupinfo.Type       = 0;
                __usergroupinfo.Readaccess = Convert.ToInt32(readaccess.Text == "" ? "0" : readaccess.Text);

                __usergroupinfo.Allowdirectpost  = 1;
                __usergroupinfo.Allowmultigroups = 0;
                __usergroupinfo.Allowcstatus     = 0;
                __usergroupinfo.Allowuseblog     = 0;
                __usergroupinfo.Allowinvisible   = 0;
                __usergroupinfo.Allowtransfer    = 0;
                __usergroupinfo.Allowhtml        = 0;
                __usergroupinfo.Allownickname    = 0;
                __usergroupinfo.Allowviewstats   = 0;

                __usergroupinfo.Radminid      = -1;
                __usergroupinfo.Grouptitle    = groupTitle.Text;
                __usergroupinfo.Creditshigher = 0;
                __usergroupinfo.Creditslower  = 0;

                __usergroupinfo.Stars            = Convert.ToInt32(stars.Text);
                __usergroupinfo.Color            = color.Text;
                __usergroupinfo.Groupavatar      = groupavatar.Text;
                __usergroupinfo.Maxprice         = Convert.ToInt32(maxprice.Text);
                __usergroupinfo.Maxpmnum         = Convert.ToInt32(maxpmnum.Text);
                __usergroupinfo.Maxsigsize       = Convert.ToInt32(maxsigsize.Text);
                __usergroupinfo.Maxattachsize    = Convert.ToInt32(maxattachsize.Text);
                __usergroupinfo.Maxsizeperday    = Convert.ToInt32(maxsizeperday.Text);
                __usergroupinfo.Attachextensions = attachextensions.GetSelectString(",");
                __usergroupinfo.Raterange        = "";
                usergrouppowersetting.GetSetting(ref __usergroupinfo);
                if (AdminUserGroups.AddUserGroupInfo(__usergroupinfo))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加特殊用户组", "组名:" + groupTitle.Text);

                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupspecialgrid.aspx';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
        protected void RadPurviewType_CheckedChanged(object sender, EventArgs e)
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            this.EgvPermissions.DataSource = userGroupList;
            this.EgvPermissions.DataBind();
        }
        private void InitControls()
        {
            IList <ProductInfo> productCommonListByCharacter = Product.GetProductCommonListByCharacter(ProductCharacter.Card);
            IList <PresentInfo> presentByCharacter           = Present.GetPresentByCharacter(ProductCharacter.Card);

            this.DropProductId.Items.Add(new ListItem("不通过商店销售", "0"));
            foreach (ProductInfo info in productCommonListByCharacter)
            {
                this.DropProductId.Items.Add(new ListItem(info.ProductName, info.ProductId.ToString() + "|" + info.TableName));
            }
            foreach (PresentInfo info2 in presentByCharacter)
            {
                this.DropProductId.Items.Add(new ListItem(info2.PresentName, info2.PresentId.ToString()));
            }
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            this.DropUserGroup.DataSource     = userGroupList;
            this.DropUserGroup.DataTextField  = "GroupName";
            this.DropUserGroup.DataValueField = "GroupId";
            this.DropUserGroup.DataBind();
            this.DpkEnd.Text = DateTime.Today.AddYears(1).ToString("yyyy-MM-dd");
            this.RadAddTypeSingle.Attributes.Add("onclick", "document.getElementById('trSingle1').style.display='';document.getElementById('trSingle2').style.display='';document.getElementById('trBatch').style.display='none';");
            this.RadAddTypeBatch.Attributes.Add("onclick", "document.getElementById('trSingle1').style.display='none';document.getElementById('trSingle2').style.display='none';document.getElementById('trBatch').style.display='';");
            this.DropUserGroup.Attributes.Add("onchange", "selectValue()");
            this.DropValidUnit.Attributes.Add("onchange", "selectGroup()");
        }
        private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            #region  除用户组
            if (this.CheckCookie())
            {
                if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.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';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                }
            }
            #endregion
        }
Beispiel #5
0
        private void InitControls()
        {
            int cardId = BasePage.RequestInt32("CardId");

            if (cardId > 0)
            {
                CardInfo cardById = Cards.GetCardById(cardId);
                this.ViewState.Add("CardInfo", cardById);
                this.TxtCardNum.Text         = cardById.CardNum;
                this.TdProductName.InnerHtml = Cards.GetProductName(cardById.ProductName);
                this.TxtPassword.Text        = StringHelper.Base64StringDecode(cardById.Password);
                this.TxtMoney.Text           = cardById.Money.ToString("N2");
                this.TxtValidNum.Text        = cardById.ValidNum.ToString();
                this.DropValidUnit.Items.FindByValue(cardById.ValidUnit.ToString()).Selected = true;
                this.DpkEnd.Text       = cardById.EndDate.ToString("yyyy-MM-dd");
                this.TxtAgentName.Text = cardById.AgentName;
                IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
                this.DropUserGroup.DataSource     = userGroupList;
                this.DropUserGroup.DataTextField  = "GroupName";
                this.DropUserGroup.DataValueField = "GroupId";
                this.DropUserGroup.DataBind();
                if (cardById.ValidUnit == 5)
                {
                    BasePage.SetSelectedIndexByValue(this.DropUserGroup, cardById.ValidNum.ToString());
                    this.TxtValidNum.Enabled = false;
                }
                this.DropUserGroup.Attributes.Add("onchange", "selectValue()");
                this.DropValidUnit.Attributes.Add("onchange", "selectGroup()");
                if (!string.IsNullOrEmpty(cardById.UserName) || (cardById.OrderItemId > 0))
                {
                    this.BtnSave.Enabled = false;
                }
            }
        }
Beispiel #6
0
 private void InitControl()
 {
     if (!base.IsPostBack)
     {
         string str = BasePage.RequestString("CartID");
         if (!string.IsNullOrEmpty(str))
         {
             this.TxtMessage.Text = ShoppingCart.GetInformMessage(SiteConfig.SmsConfig.CartInformMessage, str);
         }
         else
         {
             this.TxtMessage.Text = "{$2},您好!这是一条测试短信。----动易网络(请勿回复此短信)";
         }
         this.TxtMessage.Attributes.Add("onpropertychange", "checkLength()");
         this.TxtMessage.Attributes.Add("oninput", "checkLength()");
         this.TxtMessageNumber.Text = this.TxtMessage.Text.Trim().Length.ToString();
         this.Dpk.Text = DateTime.Now.AddDays(1.0).ToString();
         IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
         this.ChklUserGroupList.Items.Clear();
         this.ChklUserGroupList.DataSource     = userGroupList;
         this.ChklUserGroupList.DataTextField  = "GroupName";
         this.ChklUserGroupList.DataValueField = "GroupId";
         this.ChklUserGroupList.DataBind();
         this.Panel2.Visible = false;
         if (!string.IsNullOrEmpty(BasePage.RequestString("UserName")))
         {
             this.RadIncept3.Checked = true;
             this.TxtUserName.Text   = BasePage.RequestString("UserName");
         }
     }
 }
Beispiel #7
0
        private void AddUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 插入相关组信息数据

            if (this.CheckCookie())
            {
                __usergroupinfo.System        = 0;
                __usergroupinfo.Type          = 0;
                __usergroupinfo.Readaccess    = Convert.ToInt32(readaccess.Text == "" ? "0" : readaccess.Text);
                __usergroupinfo.Radminid      = 0;
                __usergroupinfo.Grouptitle    = groupTitle.Text;
                __usergroupinfo.Creditshigher = Convert.ToInt32(creditshigher.Text);
                __usergroupinfo.Creditslower  = Convert.ToInt32(creditslower.Text);
                usergrouppowersetting.GetSetting(ref __usergroupinfo);
                if (__usergroupinfo.Creditshigher >= __usergroupinfo.Creditslower)
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 金币下限必须小于金币上限');</script>");
                    return;
                }
                if (__usergroupinfo.Allowbonus == 1 && (__usergroupinfo.Minbonusprice >= __usergroupinfo.Maxbonusprice))
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>");
                    return;
                }

                __usergroupinfo.Stars            = Convert.ToInt32(stars.Text);
                __usergroupinfo.Color            = color.Text;
                __usergroupinfo.Groupavatar      = groupavatar.Text;
                __usergroupinfo.Maxprice         = Convert.ToInt32(maxprice.Text);
                __usergroupinfo.Maxpmnum         = Convert.ToInt32(maxpmnum.Text);
                __usergroupinfo.Maxsigsize       = Convert.ToInt32(maxsigsize.Text);
                __usergroupinfo.Maxattachsize    = Convert.ToInt32(maxattachsize.Text);
                __usergroupinfo.Maxsizeperday    = Convert.ToInt32(maxsizeperday.Text);
                __usergroupinfo.Attachextensions = attachextensions.GetSelectString(",");
                __usergroupinfo.Raterange        = "";

                if (AdminUserGroups.AddUserGroupInfo(__usergroupinfo))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加用户组", "组名:" + groupTitle.Text);

                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
Beispiel #8
0
        //feltolti a csoportokat tartalmazo comboboxot, amit felhasznalo hozzaadasnal lehet hasznalni
        private void FillUserGroupsCb()
        {
            List <UserGroup> userGroupList = userGroups.GetUserGroupList();

            cbUserGroups.DataSource    = userGroupList;
            cbUserGroups.DisplayMember = "GroupName";
            cbUserGroups.ValueMember   = "GroupName";
        }
 private void InitUserGroupCheckBoxList()
 {
     this.EChklUserGroupList.Items.Clear();
     this.EChklUserGroupList.DataSource     = UserGroups.GetUserGroupList(0, 0);
     this.EChklUserGroupList.DataTextField  = "GroupName";
     this.EChklUserGroupList.DataValueField = "GroupId";
     this.EChklUserGroupList.DataBind();
 }
Beispiel #10
0
        private void InitEChklPermission()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            this.EgvPermissions.DataSource = userGroupList;
            this.EgvPermissions.DataBind();
            this.EgvRoleView.DataSource = UserRole.GetRoleList();
            this.EgvRoleView.DataBind();
        }
Beispiel #11
0
        protected void UserGroupList(ListControl chklUserGroupList)
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            chklUserGroupList.Items.Clear();
            chklUserGroupList.DataSource     = userGroupList;
            chklUserGroupList.DataTextField  = "GroupName";
            chklUserGroupList.DataValueField = "GroupId";
            chklUserGroupList.DataBind();
        }
Beispiel #12
0
        protected void GetUserGroupList()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            this.ChklUserGroupList.Items.Clear();
            this.ChklUserGroupList.DataSource     = userGroupList;
            this.ChklUserGroupList.DataTextField  = "GroupName";
            this.ChklUserGroupList.DataValueField = "GroupId";
            this.ChklUserGroupList.DataBind();
        }
Beispiel #13
0
 /// <summary>
 /// 增加用户信息
 /// </summary>
 /// <returns>成功否</returns>
 private bool AddUserGroupInfo()
 {
     if (AdminUserGroups.AddUserGroupInfo(userGroupInfo))
     {
         Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
         UserGroups.GetUserGroupList();
         AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加特殊用户组", "组名:" + groupTitle.Text);
         return(true);
     }
     return(false);
 }
        private void InitUserGroupCheckBoxList()
        {
            this.EChklUserGroupList.Items.Clear();
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            userGroupList.RemoveAt(0);
            this.EChklUserGroupList.DataSource     = userGroupList;
            this.EChklUserGroupList.DataTextField  = "GroupName";
            this.EChklUserGroupList.DataValueField = "GroupId";
            this.EChklUserGroupList.DataBind();
        }
        private void ChklUserGroupListBind()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            if (userGroupList.Count > 0)
            {
                this.ChklUserGroupList.Items.Clear();
                this.ChklUserGroupList.DataSource     = userGroupList;
                this.ChklUserGroupList.DataTextField  = "GroupName";
                this.ChklUserGroupList.DataValueField = "GroupId";
                this.ChklUserGroupList.DataBind();
            }
        }
        private void ChklUserGroupListBind()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            if (userGroupList.Count > 0)
            {
                this.ChklUserGroupList.Items.Clear();
                this.ChklUserGroupList.DataSource     = userGroupList;
                this.ChklUserGroupList.DataTextField  = "GroupName";
                this.ChklUserGroupList.DataValueField = "GroupId";
                this.ChklUserGroupList.DataBind();
            }
            this.TxtSenderName.Text  = SiteConfig.SiteInfo.Webmaster;
            this.TxtSenderEmail.Text = SiteConfig.SiteInfo.WebmasterEmail;
        }
Beispiel #17
0
        public void BindData()
        {
            DataGrid1.AllowCustomPaging = false;
            DataGrid1.TableHeaderName   = "系统组列表";
            List <UserGroupInfo> list = new List <UserGroupInfo>();

            foreach (UserGroupInfo userGroupInfo in UserGroups.GetUserGroupList())
            {
                if (userGroupInfo.System == 1)
                {
                    list.Add(userGroupInfo);
                }
            }
            DataGrid1.BindData(list);
        }
Beispiel #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack && !SiteConfig.SiteOption.EnablePointMoneyExp)
     {
         this.ListType6.Style.Add("display", "none");
         this.ListType7.Style.Add("display", "none");
         this.ListType8.Style.Add("display", "none");
         this.ListType9.Style.Add("display", "none");
         this.ListType16.Style.Add("display", "none");
         this.ListType17.Style.Add("display", "none");
         this.ListType18.Style.Add("display", "none");
         this.ListType19.Style.Add("display", "none");
     }
     this.RptGroups.DataSource = UserGroups.GetUserGroupList(0, 0);
     this.RptGroups.DataBind();
 }
        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);
            //UserCredits.UpdateUserCredits(DNTRequest.GetInt("uid", -1));
            userInfo = AdminUsers.GetUserInfo(DNTRequest.GetInt("uid", -1));

            UserGroupInfo tmpUserGroupInfo = CreditsFacade.GetCreditsUserGroupId(userInfo.Credits);

            groupid.Items.Add(new ListItem(UserGroups.GetUserGroupInfo(tmpUserGroupInfo.Groupid).Grouptitle, tmpUserGroupInfo.Groupid.ToString()));
            foreach (UserGroupInfo userGroupInfo in UserGroups.GetUserGroupList())
            {
                //if (userGroupInfo.System == 0 && userInfo.Groupid != userGroupInfo.Groupid || userGroupInfo.Groupid == 7)
                //    continue;

                if ((userGroupInfo.System == 0 && userGroupInfo.Radminid == 0) || userGroupInfo.Groupid == 7)
                {
                    continue;
                }
                groupid.Items.Add(new ListItem(userGroupInfo.Grouptitle, userGroupInfo.Groupid.ToString()));
                extgroupids.Items.Add(new ListItem(userGroupInfo.Grouptitle, userGroupInfo.Groupid.ToString()));
            }

            templateid.AddTableData(Templates.GetValidTemplateList(), "name", "templateid");
            templateid.Items[0].Text = "默认";
            TabControl1.InitTabPage();

            if (DNTRequest.GetString("uid") == "")
            {
                Response.Redirect("global_usergrid.aspx");
                return;
            }
            LoadCurrentUserInfo(DNTRequest.GetInt("uid", -1));
            LoadScoreInf(DNTRequest.GetString("uid"), DNTRequest.GetString("fieldname"));
        }
Beispiel #20
0
        protected void UserGroupList()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            foreach (UserGroupsInfo info in userGroupList)
            {
                if (info.GroupId == -2)
                {
                    userGroupList.Remove(info);
                    break;
                }
            }
            this.DropGroupId.DataSource     = userGroupList;
            this.DropGroupId.DataTextField  = "GroupName";
            this.DropGroupId.DataValueField = "GroupId";
            this.DropGroupId.DataBind();
        }
        private void DropDownListBind()
        {
            IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);

            this.DropGroup1.DataSource     = userGroupList;
            this.DropGroup2.DataSource     = userGroupList;
            this.DropGroup1.DataTextField  = "GroupName";
            this.DropGroup1.DataValueField = "GroupId";
            this.DropGroup2.DataTextField  = "GroupName";
            this.DropGroup2.DataValueField = "GroupId";
            this.DropGroup1.DataBind();
            this.DropGroup2.DataBind();
            ListItem item = new ListItem("全部会员", "0");

            this.DropGroup1.Items.Insert(0, item);
            this.DropGroup2.Items.Insert(0, item);
        }
Beispiel #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                #region 初始化控件
                foreach (UserGroupInfo userGroupInfo in UserGroups.GetUserGroupList())
                {
                    groupid.Items.Add(new ListItem(userGroupInfo.Grouptitle, userGroupInfo.Groupid.ToString()));
                }
                AddUserInfo.Attributes.Add("onclick", "return IsValidPost();");
                //将积分设置数据加载到Javascript数组,在前台改变
                string scriptText = "var creditarray = new Array(";
                for (int i = 1; i < groupid.Items.Count; i++)
                {
                    scriptText += AdminUserGroups.AdminGetUserGroupInfo(Convert.ToInt32(groupid.Items[i].Value)).Creditshigher.ToString() + ",";
                }
                scriptText = scriptText.TrimEnd(',') + ");";
                this.RegisterStartupScript("begin", "<script type='text/javascript'>" + scriptText + "</script>");
                groupid.Attributes.Add("onchange", "document.getElementById('" + credits.ClientID + "').value=creditarray[this.selectedIndex];");
                groupid.Items.RemoveAt(0);
                try
                {
                    groupid.SelectedValue = "10";
                }
                catch
                {
                    //当新手上路不存在时
                    groupid.SelectedValue = UserCredits.GetCreditsUserGroupId(0) != null?UserCredits.GetCreditsUserGroupId(0).Groupid.ToString() : "3";
                }

                try
                {
                    UserGroupInfo _usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(Convert.ToInt32(groupid.SelectedValue));
                    credits.Text = _usergroupinfo.Creditshigher.ToString();
                }
                catch
                {
                    ;
                }

                #endregion
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         foreach (UserGroupInfo userGroupInfo in UserGroups.GetUserGroupList())
         {
             if (userGroupInfo.Radminid == 0)
             {
                 sourceusergroup.Items.Add(new ListItem(userGroupInfo.Grouptitle, userGroupInfo.Groupid.ToString()));
                 targetusergroup.Items.Add(new ListItem(userGroupInfo.Grouptitle, userGroupInfo.Groupid.ToString()));
             }
         }
         foreach (UserGroupInfo adminUserGroupInfo in UserGroups.GetAdminAndSpecialGroup())
         {
             sourceadminusergroup.Items.Add(new ListItem(adminUserGroupInfo.Grouptitle, adminUserGroupInfo.Groupid.ToString()));
             targetadminusergroup.Items.Add(new ListItem(adminUserGroupInfo.Grouptitle, adminUserGroupInfo.Groupid.ToString()));
         }
     }
 }
Beispiel #24
0
        private void AddUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 插入相关组信息数据

            if (this.CheckCookie())
            {
                Hashtable ht = new Hashtable();
                ht.Add("附件最大尺寸", maxattachsize.Text);
                ht.Add("每天最大附件总尺寸", maxsizeperday.Text);
                ht.Add("个人空间附件总尺寸", maxspaceattachsize.Text);
                ht.Add("相册空间总尺寸", maxspacephotosize.Text);
                foreach (DictionaryEntry de in ht)
                {
                    if (!Utils.IsInt(de.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + de.Key.ToString() + "只能是0或者正整数');window.location.href='global_editusergroup.aspx';</script>");
                        return;
                    }
                }
                UserGroupInfo userGroupInfo = new UserGroupInfo();
                userGroupInfo.System        = 0;
                userGroupInfo.Type          = 0;
                userGroupInfo.Readaccess    = Convert.ToInt32(readaccess.Text == "" ? "0" : readaccess.Text);
                userGroupInfo.Radminid      = 0;
                userGroupInfo.Grouptitle    = groupTitle.Text;
                userGroupInfo.Creditshigher = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.Creditslower  = Convert.ToInt32(creditslower.Text);
                usergrouppowersetting.GetSetting(ref userGroupInfo);
                if (userGroupInfo.Creditshigher >= userGroupInfo.Creditslower)
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 积分下限必须小于积分上限');</script>");
                    return;
                }
                if (userGroupInfo.Allowbonus == 1 && (userGroupInfo.Minbonusprice >= userGroupInfo.Maxbonusprice))
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>");
                    return;
                }
                userGroupInfo.Stars              = Convert.ToInt32(stars.Text);
                userGroupInfo.Color              = color.Text;
                userGroupInfo.Groupavatar        = groupavatar.Text;
                userGroupInfo.Maxprice           = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum           = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.Maxsigsize         = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Maxattachsize      = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Maxsizeperday      = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.Maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.Maxspacephotosize  = Convert.ToInt32(maxspacephotosize.Text);
                userGroupInfo.Attachextensions   = attachextensions.GetSelectString(",");
                //userGroupInfo.MaxFriendsCount = Convert.ToInt32(maxfriendscount.Text);
                userGroupInfo.Raterange = "";

                if (AdminUserGroups.AddUserGroupInfo(userGroupInfo))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加用户组", "组名:" + groupTitle.Text);

                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
Beispiel #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ContentChargeInfo info4;
            int generalId = BaseUserControl.RequestInt32("GeneralID");

            this.contentDataTable = ContentManage.GetContentDataById(generalId);
            if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0))
            {
                BaseUserControl.WriteErrMsg("指定的信息不存在!");
            }
            if (ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString())).IsNull)
            {
                BaseUserControl.WriteErrMsg("信息隶属模型不存在!");
            }
            IList <UserGroupsInfo> userGroupList             = UserGroups.GetUserGroupList(0, 0);
            ContentPermissionInfo  contentPermissionInfoById = PermissionContent.GetContentPermissionInfoById(generalId);

            if (!contentPermissionInfoById.IsNull)
            {
                switch (contentPermissionInfoById.PermissionType)
                {
                case 0:
                    this.LitInfoPurview.Text = "继承栏目权限";
                    goto Label_0186;

                case 1:
                    this.LitInfoPurview.Text = "所有会员";
                    goto Label_0186;
                }
                this.LitInfoPurview.Text = "指定会员组:";
                if (!string.IsNullOrEmpty(contentPermissionInfoById.ArrGroupId))
                {
                    string[] strArray = contentPermissionInfoById.ArrGroupId.Split(new char[] { ',' });
                    for (int i = 0; i < strArray.Length; i++)
                    {
                        foreach (UserGroupsInfo info3 in userGroupList)
                        {
                            if (info3.GroupId == DataConverter.CLng(strArray[i]))
                            {
                                this.LitInfoPurview.Text = this.LitInfoPurview.Text + " " + info3.GroupName;
                                break;
                            }
                        }
                    }
                }
            }
Label_0186:
            info4 = EasyOne.Contents.ContentCharge.GetContentChargeInfoById(generalId);
            if (!info4.IsNull)
            {
                this.LblInfoPoint.Text = DataConverter.CLng(info4.InfoPoint).ToString();
                switch (info4.ChargeType)
                {
                case 1:
                    this.LblChargeType.Text = "距离上次收费时间" + DataConverter.CLng(info4.PitchTime).ToString() + "小时后重新收费";
                    break;

                case 2:
                    this.LblChargeType.Text = "会员重复阅读此文章" + DataConverter.CLng(info4.ReadTimes).ToString() + "次后重新收费";
                    break;

                case 3:
                    this.LblChargeType.Text = "上述两者都满足时重新收费";
                    break;

                case 4:
                    this.LblChargeType.Text = "上述两者任一个满足时就重新收费";
                    break;

                case 5:
                    this.LblChargeType.Text = "每阅读一次就重复收费一次(建议不要使用)";
                    break;

                default:
                    this.LblChargeType.Text = "不重复收费";
                    break;
                }
                this.LblDividePercent.Text = DataConverter.CLng(info4.DividePercent).ToString() + "%";
            }
        }
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 更新用户组信息

            if (this.CheckCookie())
            {
                if (creditshigher.Enabled == true)
                {
                    if (Convert.ToInt32(creditshigher.Text) < Convert.ToInt32(ViewState["creditshigher"].ToString()) || Convert.ToInt32(creditslower.Text) > Convert.ToInt32(ViewState["creditslower"].ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败, 您所输入的金币上下限范围应在" + ViewState["creditshigher"].ToString() + "至" + ViewState["creditslower"].ToString() + "之间');</script>");
                        return;
                    }
                }

                __usergroupinfo            = AdminUserGroups.AdminGetUserGroupInfo(DNTRequest.GetInt("groupid", -1));
                __usergroupinfo.System     = 0;
                __usergroupinfo.Type       = 0;
                __usergroupinfo.Readaccess = Convert.ToInt32(readaccess.Text);
                usergrouppowersetting.GetSetting(ref __usergroupinfo);
                __usergroupinfo.Grouptitle = groupTitle.Text;

                __usergroupinfo.Creditshigher = Convert.ToInt32(creditshigher.Text);
                __usergroupinfo.Creditslower  = Convert.ToInt32(creditslower.Text);

                if (__usergroupinfo.Creditshigher >= __usergroupinfo.Creditslower)
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 金币下限必须小于金币上限');</script>");
                    return;
                }
                if (__usergroupinfo.Allowbonus == 1 && (__usergroupinfo.Minbonusprice >= __usergroupinfo.Maxbonusprice))
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>");
                    return;
                }

                __usergroupinfo.Stars            = Convert.ToInt32(stars.Text);
                __usergroupinfo.Color            = color.Text;
                __usergroupinfo.Groupavatar      = groupavatar.Text;
                __usergroupinfo.Maxprice         = Convert.ToInt32(maxprice.Text);
                __usergroupinfo.Maxpmnum         = Convert.ToInt32(maxpmnum.Text);
                __usergroupinfo.Maxsigsize       = Convert.ToInt32(maxsigsize.Text);
                __usergroupinfo.Maxattachsize    = Convert.ToInt32(maxattachsize.Text);
                __usergroupinfo.Maxsizeperday    = Convert.ToInt32(maxsizeperday.Text);
                __usergroupinfo.Attachextensions = attachextensions.GetSelectString(",");

                if (AdminUserGroups.UpdateUserGroupInfo(__usergroupinfo))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();
                    AdminVistLogs.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';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 更新特殊用户组信息

            if (this.CheckCookie())
            {
                __usergroupinfo            = AdminUserGroups.AdminGetUserGroupInfo(DNTRequest.GetInt("groupid", -1));
                __usergroupinfo.System     = 0;
                __usergroupinfo.Type       = 0;
                __usergroupinfo.Readaccess = Convert.ToInt32(readaccess.Text);

                int selectradminid = radminid.SelectedValue == "0" ? -1 : Convert.ToInt32(radminid.SelectedValue);
                __usergroupinfo.Radminid = selectradminid;

                if (selectradminid.ToString() != ViewState["radminid"].ToString())
                {
                    //DbHelper.ExecuteNonQuery("UPDATE [" + BaseConfigs.GetTablePrefix + "users] SET [adminid]=" + __usergroupinfo.Radminid + " WHERE [groupid]=" + __usergroupinfo.Groupid);
                    DatabaseProvider.GetInstance().ChangeUserAdminidByGroupid(__usergroupinfo.Radminid, __usergroupinfo.Groupid);
                }

                //__usergroupinfo.Allowvisit = BoolToInt(usergroupright.Items[0].Selected);
                //__usergroupinfo.Allowpost = BoolToInt(usergroupright.Items[1].Selected);
                //__usergroupinfo.Allowreply = BoolToInt(usergroupright.Items[2].Selected);
                //__usergroupinfo.Allowpostpoll = BoolToInt(usergroupright.Items[3].Selected);
                //__usergroupinfo.Allowdirectpost = 1;
                //__usergroupinfo.Allowgetattach = BoolToInt(usergroupright.Items[4].Selected);
                //__usergroupinfo.Allowpostattach = BoolToInt(usergroupright.Items[5].Selected);
                //__usergroupinfo.Allowvote = BoolToInt(usergroupright.Items[6].Selected);
                //__usergroupinfo.Allowmultigroups = 0;
                //__usergroupinfo.Allowsearch = Convert.ToInt32(allowsearch.SelectedValue);
                //__usergroupinfo.Allowcstatus = 0;
                //__usergroupinfo.Allowuseblog = 0;
                //__usergroupinfo.Allowinvisible = 0;
                //__usergroupinfo.Allowtransfer = 0;
                //__usergroupinfo.Allowsetreadperm = BoolToInt(usergroupright.Items[7].Selected);
                //__usergroupinfo.Allowsetattachperm = BoolToInt(usergroupright.Items[8].Selected);
                //__usergroupinfo.Allowhidecode = BoolToInt(usergroupright.Items[9].Selected);
                //__usergroupinfo.Allowhtml = 0;
                //__usergroupinfo.Allowcusbbcode = BoolToInt(usergroupright.Items[10].Selected);
                //__usergroupinfo.Allownickname = 0;
                //__usergroupinfo.Allowsigbbcode = BoolToInt(usergroupright.Items[11].Selected);
                //__usergroupinfo.Allowsigimgcode = BoolToInt(usergroupright.Items[12].Selected);
                //__usergroupinfo.Allowviewpro = BoolToInt(usergroupright.Items[13].Selected);
                //__usergroupinfo.Allowviewstats = 0;
                //__usergroupinfo.Disableperiodctrl = BoolToInt(usergroupright.Items[14].Selected);
                //__usergroupinfo.Reasonpm = 0;

                //__usergroupinfo.Allowavatar = Convert.ToInt16(allowavatar.SelectedValue);
                __usergroupinfo.Grouptitle = groupTitle.Text;

                __usergroupinfo.Stars            = Convert.ToInt32(stars.Text);
                __usergroupinfo.Color            = color.Text;
                __usergroupinfo.Groupavatar      = groupavatar.Text;
                __usergroupinfo.Maxprice         = Convert.ToInt32(maxprice.Text);
                __usergroupinfo.Maxpmnum         = Convert.ToInt32(maxpmnum.Text);
                __usergroupinfo.Maxsigsize       = Convert.ToInt32(maxsigsize.Text);
                __usergroupinfo.Maxattachsize    = Convert.ToInt32(maxattachsize.Text);
                __usergroupinfo.Maxsizeperday    = Convert.ToInt32(maxsizeperday.Text);
                __usergroupinfo.Attachextensions = attachextensions.GetSelectString(",");

                //GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                usergrouppowersetting.GetSetting(ref __usergroupinfo);
                if (AdminUserGroups.UpdateUserGroupInfo(__usergroupinfo))
                {
                    //GeneralConfigs.Serialiaze(__configinfo, Server.MapPath("../../config/general.config"));
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();
                    AdminVistLogs.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';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
        private void Initial()
        {
            this.InitCreateHtmlControl();
            if (!this.Page.IsPostBack)
            {
                this.RadNeedCache0.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='none';");
                this.RadNeedCache1.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='';");
                IList <NodeInfo> nodeNameForContainerItems = Nodes.GetNodeNameForContainerItems();
                if (nodeNameForContainerItems.Count < 1)
                {
                    ListItem item = new ListItem("无节点,请先添加节点", "0");
                    item.Enabled = false;
                }
                else
                {
                    this.LstNodes.DataSource = nodeNameForContainerItems;
                    this.LstNodes.DataBind();
                }
            }
            StringBuilder builder = new StringBuilder();

            builder.Append("<script type=\"text/javascript\">");
            builder.Append("function SelectAll(){");
            builder.Append("for(var i=0;i<document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').length;i++){");
            builder.Append("document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').options[i].selected=true;}}");
            builder.Append("function UnSelectAll(){");
            builder.Append("for(var i=0;i<document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').length;i++){");
            builder.Append("document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').options[i].selected=false;}}");
            builder.Append("</script>");
            base.ClientScript.RegisterClientScriptBlock(base.GetType(), "Select", builder.ToString());
            if (!this.Page.IsPostBack)
            {
                IList <NodeInfo> nodeNameForItemsExceptOutLinks = Nodes.GetNodeNameForItemsExceptOutLinks();
                this.LstRelationNodes.DataSource     = nodeNameForItemsExceptOutLinks;
                this.LstRelationNodes.DataTextField  = "NodeName";
                this.LstRelationNodes.DataValueField = "NodeId";
                this.LstRelationNodes.DataBind();
                IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
                this.EgvPermissions.DataSource = userGroupList;
                this.EgvPermissions.DataBind();
                this.EgvRoleView.DataSource = UserRole.GetRoleList();
                this.EgvRoleView.DataBind();
                IList <ModelInfo> modelList = ModelManager.GetModelList(ModelType.Content, ModelShowType.Enable);
                this.RepContentModelTemplate.DataSource = modelList;
                this.RepContentModelTemplate.DataBind();
                this.RepShopModelTemplate.DataSource = ModelManager.GetModelList(ModelType.Shop, ModelShowType.Enable);
                this.RepShopModelTemplate.DataBind();
                IList <WorkFlowsInfo> workFlowsList = WorkFlow.GetWorkFlowsList();
                this.DropWorkFlow.DataSource = workFlowsList;
                this.DropWorkFlow.DataBind();
                this.LstRelationSpecial.DataSource = Special.GetSpecialList();
                this.LstRelationSpecial.DataBind();
            }
            bool flag  = RolePermissions.AccessCheck(OperateCode.AdministratorManage);
            bool flag2 = RolePermissions.AccessCheck(OperateCode.UserGroupManage);

            if (!flag)
            {
                this.TdRolePermissions.Style.Add("display", "none");
            }
            if (!flag2)
            {
                this.TdGroupPermissions.Style.Add("display", "none");
            }
            if (!flag && !flag2)
            {
                this.TabTitle5.Style.Add("display", "none");
            }
            if (!SiteConfig.SiteOption.EnablePointMoneyExp)
            {
                this.TabTitle2.Style.Add("display", "none");
            }
        }