Ejemplo n.º 1
0
 //下载
 protected void DownLoad_Click(object sender, EventArgs e)
 {
     try
     {
         int AcademicID = Convert.ToInt32(Request.QueryString["id"].ToString());
         int photoId    = BLLAcademic.FindPhotoID(AcademicID);
         if (photoId != 0)
         {
             string srcPath = BLLAttachment.FindPath(photoId);
             if (srcPath != "")
             {
                 publicMethod.DownloadPhoto(srcPath);
             }
             else
             {
                 Alert.ShowInTop("无附件可下载!");
             }
         }
         else
         {
             Alert.ShowInTop("无附件可下载!");
         }
     }
     catch (Exception ex)
     {
         BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
         pm.SaveError(ex, this.Request);
         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("附件下载失败,请与管理员联系!"));
         //Alert.ShowInTop("附件下载失败!");
         //return;
     }
 }
Ejemplo n.º 2
0
 //下载
 protected void DownLoad_Click(object sender, EventArgs e)
 {
     try
     {
         if (Request.QueryString["id"].ToString() != "")
         {
             int MonographID = Convert.ToInt32(Request.QueryString["id"].ToString());
             if (MonographID != 0)
             {
                 string srcPaths = BLLAttachments.FindPath(MonographID);
                 if (srcPaths != "")
                 {
                     publicMethods.DownloadPhoto(srcPaths);
                 }
                 else
                 {
                     Alert.ShowInTop("无附件可下载!");
                 }
             }
             else
             {
                 Alert.ShowInTop("无附件可下载!");
             }
         }
         else
         {
             Alert.ShowInTop("数据错误!");
         }
     }
     catch (Exception ex)
     {
         BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
         pm.SaveError(ex, this.Request);
         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("附件下载失败,请与管理员联系!"));
     }
 }