public byte[] LoadAllFile(int fileId) { atriumDALManager aDAL = (atriumDALManager)this.DAL; DataSet ds = new DataSet(); // ds.SchemaSerializationMode = SchemaSerializationMode.ExcludeSchema; ds.RemotingFormat = SerializationFormat.Binary; ds.Merge(this.LoadByFileId(fileId)); ds.Merge(aDAL.GetRecipient().LoadByFileId(fileId)); ds.Merge(aDAL.GetAttachment().LoadByFileId(fileId)); ds.Merge(LoadAttsNotOnFile(fileId)); //foreach (docDB.DocumentRow dr in ds.Document) //{ // ds.Merge(aDAL.GetAttachment().LoadByMsgId(dr.DocId)); //} //foreach (docDB.AttachmentRow att in ds.Attachment) //{ // if(ds.Document.FindByDocId(att.AttachmentId)==null) // ds.Merge(this.Load(att.AttachmentId)); //} FixTZDSIssue(ds); return(atriumDALManager.CompressData(ds)); }
public byte[] LoadAll(int docId) { atriumDALManager aDAL = (atriumDALManager)this.DAL; DataSet ds = new DataSet(); // ds.SchemaSerializationMode = SchemaSerializationMode.ExcludeSchema; ds.RemotingFormat = SerializationFormat.Binary; ds.Merge(this.Load(docId)); ds.Merge(aDAL.GetRecipient().LoadByDocId(docId)); docDB.AttachmentDataTable atts = aDAL.GetAttachment().LoadByMsgId(docId); ds.Merge(atts); foreach (docDB.AttachmentRow att in atts) { ds.Merge(this.Load(att.AttachmentId)); ds.Merge(aDAL.GetRecipient().LoadByDocId(att.AttachmentId)); } FixTZDSIssue(ds); return(atriumDALManager.CompressData(ds)); }