Exemplo n.º 1
0
        public void SubmitButton_Click(object sender, EventArgs e)
        {
            bool flag = true;

            for (int i = 1; i <= this.fileList.Count; i++)
            {
                if (DNTRequest.GetFormString("id" + i) != "")
                {
                    try
                    {
                        if (!TopicIdentify.Add(DNTRequest.GetString("name" + i), DNTRequest.GetString("file" + i)))
                        {
                            flag = false;
                        }
                    }
                    catch
                    {
                        base.RegisterStartupScript("", "<script>alert('出现错误,可能名称超出长度!');window.location.href='forum_identifymanage.aspx';</script>");
                    }
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件增加", "");
            if (!flag)
            {
                base.RegisterStartupScript("", "<script>alert('某些记录未能插入,因为与数据库中原有的名称相同');window.location.href='forum_identifymanage.aspx';</script>");
                return;
            }
            base.RegisterStartupScript("", "<script>window.location.href='forum_identifymanage.aspx';</script>");
        }
Exemplo n.º 2
0
 private void AddIdentifyInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (String.IsNullOrEmpty(this.uploadfile.FileName.Trim()) || String.IsNullOrEmpty(this.uploadfilesmall.FileName.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         string text  = this.uploadfile.UpdateFile();
         string text2 = this.uploadfilesmall.UpdateFile();
         if (String.IsNullOrEmpty(text.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定大图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (String.IsNullOrEmpty(text2.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定小图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (TopicIdentify.Add(this.name.Text, text))
         {
             string[] array = text.Split('.');
             string   str   = string.Format("{0}_small.{1}", array[0], array[1]);
             Directory.Move(base.Server.MapPath("../../images/identify/") + text2, base.Server.MapPath("../../images/identify/") + str);
             XCache.Remove("/Forum/TopicIdentifys");
             XCache.Remove("/Forum/TopicIndentifysJsArray");
             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件添加", this.name.Text);
             base.RegisterStartupScript("PAGE", "window.location.href='forum_identifymanage.aspx';");
             return;
         }
         base.RegisterStartupScript("PAGE", "alert('插入失败,可能名称与原有的相同');window.location.href='forum_identifymanage.aspx';");
     }
 }