//删除 protected void Delete_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); int attachId = BllPaper.FindAttachment(id); string srcPath = BllAttachment.FindPath(attachId); if (attachId == 0 || srcPath == "") { Alert.Show("不存在相关文档"); } else { publicMethod.DeleteFile(attachId, srcPath); Common.Entities.Paper paper = BllPaper.FindAll(id); paper.AttachmentID = null; BllPaper.Update(paper); //Alert.Show("删除成功!"); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideReference() + Alert.GetShowInTopReference("删除成功!")); } } catch (Exception ex) { publicMethod.SaveError(ex, this.Request); } }
//初始化 public void InitData() { try { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); Common.Entities.Paper paper = BllPaper.FindAll(id); title.Text = paper.Subject; firstWriter.Text = paper.FirstWriter; writerIdentity.Text = paper.WriterIdentity; } catch (Exception ex) { publicMethod.SaveError(ex, this.Request); } }