Beispiel #1
0
 //删除
 protected void Delete_Click(object sender, EventArgs e)
 {
     try
     {
         int    id       = Convert.ToInt32(Request.QueryString["id"].ToString());
         int    attachId = mo.FindFAttachmentID(id);
         string srcPath  = at.FindPath(attachId);
         if (attachId == 0 || srcPath == "")
         {
             Alert.Show("该专著不存在封面资料");
         }
         else
         {
             pm.DeleteFile(attachId, srcPath);
             Common.Entities.Monograph mon = mo.FindAll(id);
             mon.BAttachmentID = null;
             mo.Update(mon);
             //Alert.Show("删除成功!");
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideReference() + Alert.GetShowInTopReference("删除成功!"));
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Beispiel #2
0
 //初始化
 public void InitData()
 {
     try
     {
         int id = Convert.ToInt32(Request.QueryString["id"].ToString());
         Common.Entities.Monograph mon = mo.FindAll(id);
         name.Text      = ach.FindAchieveName(Convert.ToInt32(mon.AchievementID));
         monograph.Text = mon.MonographName;
         //agency.Text = mon.MDepartment;
         Publisher.Text = mon.Publisher;
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }