/// <summary>
 /// 根据Guid加载附件
 /// </summary>
 /// <param name="MailGuid"></param>
 protected void GetAttachment(string MailGuid)
 {
     phAttList.Controls.Clear();
     at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
     at.ShowModule = ListType.LineList;
     at.RepeatColumns = 4;
     at.AttGroupGuid = MailGuid;
     phAttList.Controls.Add(at);
     at.RefreshGrid();
 }
 /// <summary>
 /// 根据Guid加载附件
 /// </summary>
 /// <param name="MailGuid"></param>
 protected void GetAttachment(string InfoGuid)
 {
     phAttList.Controls.Clear();
     at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
     at.ShowModule = ListType.LineList;
     at.ShowWay = DisplayWay.Download;
     at.RepeatColumns = 3;
     at.AttGroupGuid = InfoGuid;
     phAttList.Controls.Add(at);
     at.RefreshGrid();
 }
 protected void GetDocTemplate(string TemplateGuid)
 {
     try
     {
         phAttList.Controls.Clear();
         at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
         at.ShowModule = ListType.LineList;
         at.RepeatColumns = 4;
         at.AttGroupGuid = TemplateGuid;
         phAttList.Controls.Add(at);
         at.RefreshGrid();
         UpdatePanel1.Update();
     }
     catch (Exception err)
     {
         string s = err.Message;
     }
 }
 protected void GetAtt(string Guid)
 {
     try
     {
         phAttList.Controls.Clear();
         at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
         at.ShowModule = ListType.LineList;
         at.RepeatColumns = 4;
         at.AttGroupGuid = this.ViewState["guid"].ToString();
         phAttList.Controls.Add(at);
         at.RefreshGrid();
         GetWordFile();
         UpdatePanel1.Update();
     }
     catch (Exception err)
     {
         string s = err.Message;
     }
 }
 protected void GetTableAtt(string TemplateGuid, string Note)
 {
     try
     {
         Att.Controls.Clear();
         at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
         at.ShowModule = ListType.LineList;
         at.ShowWay = DisplayWay.Download;
         at.RepeatColumns = 1;
         at.AttGroupGuid = TemplateGuid;
         Att.Controls.Add(at);
         at.RefreshGrid();
         Tip.InnerHtml = Note;
         //UpdatePanel1.Update();
     }
     catch (Exception ex)
     {
         string s = ex.Message;
     }
 }
Exemple #6
0
 /// <summary>
 /// 显示附件
 /// </summary>
 /// <param name="AttGroupGuid">传入的相关外键</param>
 /// <param name="phAtt">PlaceHolder 控件</param>
 /// <param name="ShowType">“Line”或“Table”</param>
 /// <param name="OperationWay">“DownLoad”或“Delete”</param>
 /// <param name="RepeatColumns">每行显示附件数,对Line显示方式有效</param>
 public void GetAttachment(string AttGroupGuid, PlaceHolder phAtt, string ShowType, string OperationWay, int RepeatColumns)
 {
     Attachment at = new Attachment();
     phAtt.Controls.Clear();
     at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
     if (ShowType.Trim().ToUpper() == "LINE")
         at.ShowModule = ListType.LineList;
     else
         at.ShowModule = ListType.TableList;
     if (OperationWay.Trim().ToUpper() == "DOWNLOAD")
         at.ShowWay = DisplayWay.Download;
     else
     {
         at.ShowWay = DisplayWay.Upload;
     }
     if (RepeatColumns < 1)
     {
         RepeatColumns = 1;
     }
     at.RepeatColumns = RepeatColumns;
     at.AttGroupGuid = AttGroupGuid;
     phAtt.Controls.Add(at);
     at.RefreshGrid();
 }
        /// <summary>
        /// 根据Guid加载附件
        /// </summary>
        /// <param name="MailGuid"></param>
        protected void GetAttachment(string KeyGuid)
        {
            phAttList.Controls.Clear();
            at = (Attachment)Page.LoadControl("/ascx/Attachment.ascx");
            at.ShowModule = ListType.LineList;
            at.ShowWay = DisplayWay.Download;
            at.RepeatColumns = 1;
            at.AttGroupGuid = KeyGuid;
            phAttList.Controls.Add(at);
            at.RefreshGrid();

            if (at.AttachCount == 0)
            {
                phAttList.Controls.Clear();
                Label lb = new Label();
                lb.Text = "没有相关附件.";
                lb.Style.Add("color", "Red");
                phAttList.Controls.Add(lb);
            }
        }