Example #1
0
 //下载
 protected void DownLoad_Click(object sender, EventArgs e)
 {
     try
     {
         int AnnouncementID = Convert.ToInt32(Request.QueryString["id"].ToString());
         Common.Entities.Announcement Announce = BLLAnnounce.Find(AnnouncementID);
         int attachId = BLLAnnounce.FindAttachmentID(AnnouncementID);
         if (attachId != 0)
         {
             string srcPath = BLLAttachment.FindPath(attachId);
             if (srcPath != "")
             {
                 publicMethod.DownloadFile(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("附件下载失败!");
     }
 }
Example #2
0
 protected void btn_DownLoadContract_Click(object sender, EventArgs e)
 {
     try
     {
         int unitLecturesID = Convert.ToInt32(Request.QueryString["id"].ToString());
         unitLectures = BLLUL.FindByUnitLecturesID(unitLecturesID);
         if (unitLectures.AttachmentID != null && unitLectures.AttachmentID != 0)
         {
             int    attachID = Convert.ToInt32(BLLUL.FindAttachmentid(unitLecturesID));
             string path     = BLLAttachment.FindPath(attachID);
             if (path != "")
             {
                 publicMethod.DownloadFile(path);
             }
             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("附件下载失败!");
     }
 }
Example #3
0
 //下载
 protected void DownLoad_Click(object sender, EventArgs e)
 {
     try
     {
         int    id       = Convert.ToInt32(Request.QueryString["id"].ToString());
         int    attachId = file.FindAttachmentID(id);
         string srcPath  = at.FindPath(attachId);
         pm.DownloadFile(srcPath);
     }
     catch (Exception ex)
     {
         PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference() + Alert.GetShowInTopReference("下载出错,请联系管理员!"));
         pm.SaveError(ex, this.Request);
     }
 }
Example #4
0
        //下载
        protected void DownFile_Click(object sender, EventArgs e)
        {
            FineUI.LinkButton lb = (FineUI.LinkButton)sender;
            try
            {
                int id = Convert.ToInt32(Request.QueryString["id"].ToString());

                //int attachId = ach.FindAttachment(id);
                Common.Entities.Achievement model = ach.Findmodel(id);
                int attachId = 0;
                switch (lb.ID)
                {
                case "DownFile":
                    attachId = model.AttachmentID == null ? 0 : model.AttachmentID.Value;
                    break;

                case "DownOpinionPage":
                    attachId = model.OpinionPage == null ? 0 : model.OpinionPage.Value;
                    break;

                case "DownMemberPage":
                    attachId = model.MemberPage == null ? 0 : model.MemberPage.Value;
                    break;

                case "DownSealPage":
                    attachId = model.SealPage == null ? 0 : model.SealPage.Value;
                    break;
                }

                string srcPath = at.FindPath(attachId);
                if (attachId == 0 || srcPath == "")
                {
                    Alert.Show("该成果不存在相关文档");
                }
                else
                {
                    pm.DownloadFile(srcPath);
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Example #5
0
 //下载
 protected void DownFile_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.DownloadFile(srcPath);
         }
     }
     catch (Exception ex)
     {
         publicMethod.SaveError(ex, this.Request);
     }
 }
Example #6
0
 //下载
 protected void DownFile_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.DownloadFile(srcPath);
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }