//private void UpDateInfo(string active,string other) //{ // AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, active, other); //} public void SubmitButton_Click(object sender, EventArgs e) { #region 保存新建主题鉴定 bool ok = true; for (int i = 1; i <= fileList.Count; i++) { if (DNTRequest.GetFormString("id" + i) != "") { try { if (!Identifys.AddIdentify(DNTRequest.GetString("name" + i), DNTRequest.GetString("file" + i))) { ok = false; } } catch { base.RegisterStartupScript("", "<script>alert('出现错误,可能名称超出长度!');window.location.href='forum_identifymanage.aspx';</script>"); } } } AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件增加", ""); if (!ok) { base.RegisterStartupScript("", "<script>alert('某些记录未能插入,因为与数据库中原有的名称相同');window.location.href='forum_identifymanage.aspx';</script>"); } else { base.RegisterStartupScript("", "<script>window.location.href='forum_identifymanage.aspx';</script>"); } #endregion }
private void BindFilesList() { #region 绑定主题鉴定文件列表 try { fileinfoList.Text = ""; fileList = GetIdentifyFileList(); DataTable dt = Identifys.GetAllIdentify(); foreach (DataRow Identify in dt.Rows) { ViewState["code"] += Identify["name"] + ","; fileList.Remove(Identify["filename"].ToString()); } fileList.Remove("Thumbs.db"); int i = 1; foreach (string file in fileList) { fileinfoList.Text += "<tr class='mouseoutstyle' onmouseover='this.className=\"mouseoverstyle\"' onmouseout='this.className=\"mouseoutstyle\"' >\n"; fileinfoList.Text += "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;width:50px;' align='center'><input type='checkbox' id='id" + i + "' name='id" + i + "' value='" + i + "'/></td>\n"; fileinfoList.Text += "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;width:50px;' align='left'><input type='text' id='name" + i + "' name='name" + i + "' value='鉴定帖" + i + "' class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style='width:200px' /></td>\n"; fileinfoList.Text += "<td nowrap='nowrap' style='border-color:#EAE9E1;border-width:1px;border-style:solid;width:50px;'><input type='hidden' name='file" + i + "' value='" + file + "' /><div id='ilayer" + i + "' onmouseover='showMenu(this.id,false)'>" + PicStr(file, 20) + "</div>"; fileinfoList.Text += "<div id='ilayer" + i + "_menu' style='display:none'>" + PicStr(file) + "</div></td>\n"; fileinfoList.Text += "</tr>\n"; i++; } SubmitButton.Visible = fileList.Count != 0; } catch (IOException err) { base.RegisterStartupScript("", "<script>alert('" + err.Message + "');window.location.href='forum_identifymanage.aspx';</script>"); } #endregion }
private void AddIdentifyInfo_Click(object sender, EventArgs e) { #region 添加鉴定记录 if (this.CheckCookie()) { string fileName = uploadfile.UpdateFile(); if (fileName.Trim() == "") { base.RegisterStartupScript("PAGE", "alert('没有选择鉴定图片');window.location.href='forum_identifymanage.aspx';"); } if (Identifys.AddIdentify(name.Text, fileName)) { DNTCache.GetCacheService().RemoveObject("/Forum/TopicIdentifys"); DNTCache.GetCacheService().RemoveObject("/Forum/TopicIndentifysJsArray"); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件添加", name.Text); base.RegisterStartupScript("PAGE", "window.location.href='forum_identifymanage.aspx';"); } else { base.RegisterStartupScript("PAGE", "alert('插入失败,可能名称与原有的相同');window.location.href='forum_identifymanage.aspx';"); } } #endregion }
public void BindData() { #region 绑定鉴定主题分类 identifygrid.AllowCustomPaging = false; identifygrid.TableHeaderName = "论坛鉴定列表"; identifygrid.DataKeyField = "identifyid"; identifygrid.BindData(Identifys.GetAllIdentify()); #endregion }
private void AddIdentifyInfo_Click(object sender, EventArgs e) { #region 添加鉴定记录 if (this.CheckCookie()) { if (uploadfile.FileName.Trim() == "" || uploadfilesmall.FileName.Trim() == "") { base.RegisterStartupScript("PAGE", "alert('没有选择鉴定图片');window.location.href='forum_addidentify.aspx';"); return; } string fileName = uploadfile.UpdateFile(); string fileNameSmall = uploadfilesmall.UpdateFile(); if (fileName.Trim() == "") { base.RegisterStartupScript("PAGE", "alert('没有选择鉴定大图片');window.location.href='forum_addidentify.aspx';"); return; } if (fileNameSmall.Trim() == "") { base.RegisterStartupScript("PAGE", "alert('没有选择鉴定小图片');window.location.href='forum_addidentify.aspx';"); return; } if (Identifys.AddIdentify(name.Text, fileName)) { string[] fileNameArray = fileName.Split('.'); string newFileNameSmall = string.Format("{0}_small.{1}", fileNameArray[0], fileNameArray[1]); Directory.Move(Server.MapPath("../../images/identify/") + fileNameSmall, Server.MapPath("../../images/identify/") + newFileNameSmall); DNTCache.GetCacheService().RemoveObject("/Forum/TopicIdentifys"); DNTCache.GetCacheService().RemoveObject("/Forum/TopicIndentifysJsArray"); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件添加", name.Text); base.RegisterStartupScript("PAGE", "window.location.href='forum_identifymanage.aspx';"); } else { base.RegisterStartupScript("PAGE", "alert('插入失败,可能名称与原有的相同');window.location.href='forum_identifymanage.aspx';"); } } #endregion }
private void DelRec_Click(object sender, EventArgs e) { #region 除指定的表情记录 if (this.CheckCookie()) { if (DNTRequest.GetString("id") != "") { string idlist = DNTRequest.GetString("id"); Identifys.DeleteIdentify(idlist); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件删除", idlist); Response.Redirect("forum_identifymanage.aspx"); } else { base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='forum_identifymanage.aspx';</script>"); } } #endregion }
private void EditIdentify_Click(object sender, EventArgs e) { #region 保存鉴定主题分类 int row = 0; bool ok = true; foreach (object o in identifygrid.GetKeyIDArray()) { if (!Identifys.UpdateIdentifyById(int.Parse(o.ToString()), identifygrid.GetControlValue(row, "name"))) { ok = false; } row++; } AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件修改", ""); if (!ok) { base.RegisterStartupScript("", "<script>alert('某些记录未能更新,因为与原有的记录名称相同');window.location.href='forum_identifymanage.aspx';</script>"); } else { base.RegisterStartupScript("", "<script>window.location.href='forum_identifymanage.aspx';</script>"); } #endregion }