Esempio n. 1
0
 internal void GetNoteAttachment(int AttachmentId, string sDestFolder,bool ShowProgress)
 {
     FTPTransfer FT = new FTPTransfer();
     try
     {
         FT.ConnectToOysterServer(ServerAddress);
         //FT.ConnectToOysterServer("ome-prototype");
     }
     catch(Exception Err)
     {
         throw new Exception(Err.Message);
     }
     OCL.Attachment A = this.GetAttachment(AttachmentId);
     string[] sDestination = new string[1];
     sDestination[0] = sDestFolder + @"\" + A.mvarOriginalName;
     string[] sOriginal = new string[1];
     sOriginal[0] = A.mvarStoredName;
     FT.DownloadFile(sDestination,sOriginal,ShowProgress);
 }
Esempio n. 2
0
        internal void GetNoteAttachment(int[] AttachmentIds, string sDestination,bool ShowProgress)
        {
            FTPTransfer FT = new FTPTransfer();
            try
            {
                FT.ConnectToOysterServer(ServerAddress);
                //FT.ConnectToOysterServer("ome-prototype");
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }
            string[] sDest = new string[AttachmentIds.Length];
            string[] sStoredNames = new string[AttachmentIds.Length];

            int i = 0;
            foreach(int AttachmentId in AttachmentIds)
            {
                OCL.Attachment A = this.GetAttachment(AttachmentId);
                sDest[i] = sDestination + @"\" + A.mvarOriginalName;
                sStoredNames[i] = A.StoredName;
                i++;
            }

            FT.DownloadFile(sDest,sStoredNames,ShowProgress);
        }
Esempio n. 3
0
        internal void DownloadRecordingSession(User AccessingUser,RecordingSessions ARS, string sDestination,bool IncludeAttachments, bool ShowProgress)
        {
            FTPTransfer FT = new FTPTransfer();
            try
            {
                FT.ConnectToOysterServer(ServerAddress);
                //FT.ConnectToOysterServer("ome-prototype");
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }
            int NumberOfDownloadingFiles = 0;
            foreach(RecordingSession RS in ARS)
            {
                foreach(Recording R in RS.CurrentRecordings(AccessingUser))
                {
                    string peek = R.Description;
                    NumberOfDownloadingFiles++;
                }

                if(IncludeAttachments)
                {
                    foreach(Note N in RS.AllVisibleNotes(AccessingUser))
                    {
                        foreach(Attachment A in N.FileAttachments)
                        {
                            string peek = A.mvarStoredName;
                            NumberOfDownloadingFiles++;
                        }
                    }
                }
            }
            string[] sDest = new string[NumberOfDownloadingFiles];
            string[] sStoredNames = new string[NumberOfDownloadingFiles];

            int i = 0;
            foreach(RecordingSession RS in ARS)
            {
                foreach(Recording R in RS.CurrentRecordings(AccessingUser))
                {

                    string safeName = RenameFile(RS.Description + "_" + R.DisplayName,".wmv",sDestination);
                    sDest[i] = sDestination + @"\" + safeName;
            //					sDest[i] = sDestination + @"\" + R.DisplayName + ".wmv";
                    sStoredNames[i] = R.Description;
                    i++;
                }
                if(IncludeAttachments)
                {
                    foreach(Note N in RS.AllVisibleNotes(AccessingUser))
                    {
                        foreach(Attachment A in N.FileAttachments)
                        {
                            sDest[i] = sDestination + @"\" + A.StoredName;
                            sStoredNames[i] = A.StoredName;
                            i++;
                        }
                    }
                }
            }
            FT.DownloadFile(sDest,sStoredNames,ShowProgress);
        }