Beispiel #1
0
 private void SaveSmiles_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         int  num  = -1;
         bool flag = false;
         foreach (object current in this.smilesgrid.GetKeyIDArray())
         {
             string s             = current.ToString();
             string controlValue  = this.smilesgrid.GetControlValue(num, "code");
             string controlValue2 = this.smilesgrid.GetControlValue(num, "displayorder");
             string controlValue3 = this.smilesgrid.GetControlValue(num, "type");
             string controlValue4 = this.smilesgrid.GetControlValue(num, "url");
             num++;
             if (String.IsNullOrEmpty(controlValue) || !Utils.IsNumeric(controlValue2) || Smilies.IsExistSameSmilieCode(controlValue, int.Parse(s)))
             {
                 flag = true;
             }
             else
             {
                 AdminForums.UpdateSmilies(int.Parse(s), int.Parse(controlValue2), controlValue3.ToInt(0), controlValue, controlValue4, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
             }
         }
         if (flag)
         {
             base.RegisterStartupScript("", "<script>alert('某些记录输入不完整或数据库中已存在相同的表情组名称');window.location.href='forum_smiliemanage.aspx';</script>");
             return;
         }
         base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>");
     }
 }
Beispiel #2
0
 private void SaveSmiles_Click(object sender, EventArgs e)
 {
     #region 保存对表情信息的编辑
     if (this.CheckCookie())
     {
         int  rowid = -1;
         bool error = false;
         foreach (object o in smilesgrid.GetKeyIDArray())
         {
             string id           = o.ToString();
             string code         = smilesgrid.GetControlValue(rowid, "code");
             string displayorder = smilesgrid.GetControlValue(rowid, "displayorder");
             string type         = smilesgrid.GetControlValue(rowid, "type");
             string url          = smilesgrid.GetControlValue(rowid, "url");
             rowid++;
             if (code == "" || !Utils.IsNumeric(displayorder) || Smilies.IsExistSameSmilieCode(code, int.Parse(id)))
             {
                 error = true;
                 continue;
             }
             AdminForums.UpdateSmilies(int.Parse(id), int.Parse(displayorder), Utils.StrToInt(type, 0), code, url, userid, username, usergroupid, grouptitle, ip);
         }
         if (error)
         {
             base.RegisterStartupScript("", "<script>alert('某些记录输入不完整或数据库中已存在相同的表情组名称');window.location.href='forum_smiliemanage.aspx';</script>");
         }
         else
         {
             base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>");
         }
     }
     #endregion
 }
 private void EditSmile_Click(object sender, EventArgs e)
 {
     #region 编辑表情修改
     int  row     = 0;
     bool isError = false;
     foreach (object o in smilesgrid.GetKeyIDArray())
     {
         if (!Utils.IsNumeric(smilesgrid.GetControlValue(row, "displayorder")))
         {
             isError = true;
             continue;
         }
         else
         {
             AdminForums.UpdateSmilies(int.Parse(o.ToString()), int.Parse(smilesgrid.GetControlValue(row, "displayorder")),
                                       DNTRequest.GetInt("typeid", 0), smilesgrid.GetControlValue(row, "code"), smilesgrid.GetControlValue(row, "url"), userid, username, usergroupid, grouptitle, ip);
         }
         row++;
     }
     if (isError)
     {
         base.RegisterStartupScript("", "<script>alert('批量更新出现输入错误,某些记录未能更新');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>");
     }
     else
     {
         base.RegisterStartupScript("", "<script>window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>");
     }
     #endregion
 }
Beispiel #4
0
        private void EditSmile_Click(object sender, EventArgs e)
        {
            int  num  = 0;
            bool flag = false;

            foreach (object current in this.smilesgrid.GetKeyIDArray())
            {
                if (!Utils.IsNumeric(this.smilesgrid.GetControlValue(num, "displayorder")))
                {
                    flag = true;
                }
                else
                {
                    AdminForums.UpdateSmilies(int.Parse(current.ToString()), int.Parse(this.smilesgrid.GetControlValue(num, "displayorder")), DNTRequest.GetInt("typeid", 0), this.smilesgrid.GetControlValue(num, "code"), this.smilesgrid.GetControlValue(num, "url"), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                    num++;
                }
            }
            if (flag)
            {
                base.RegisterStartupScript("", "<script>alert('批量更新出现输入错误,某些记录未能更新');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>");
                return;
            }
            base.RegisterStartupScript("", "<script>window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>");
        }