예제 #1
0
        protected void DelRec_Click(object sender, EventArgs e)
        {
            #region  除所选的表情分类
            if (this.CheckCookie())
            {
                string[] delIds = DNTRequest.GetString("id").Split(',');

                //不允许全部删除,至少得保留一组表情
                if (smilesgrid.Items.Count == delIds.Length)
                {
                    base.RegisterStartupScript("", "<script>alert('请至少保留一组默认表情,或者添加一组新表情后,再删除本组表情!');window.location.href='forum_smiliemanage.aspx';</script>");
                    return;
                }
                foreach (string id in delIds)
                {
                    AdminForums.DeleteSmilies(id, userid, username, usergroupid, grouptitle, ip);
                    smilesgrid.EditItemIndex = -1;
                    SmilesGridBind();
                    Smilies.DeleteSmilyByType(int.Parse(id));
                }
                base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>");
            }
            #endregion
        }