Esempio n. 1
0
        internal RecordingSessions GetAllVisibleRecordingSessions(OCL.User AccessingUser, OCL.User TargetUser)
        {
            string sSQL = "";

            if(AccessingUser.mvarIsSuperUser)
            {
                sSQL = "SELECT DISTINCT tblGroupTokens.ObjectId,tblSession.Description FROM tblGroupTokens left outer join tblSession " +
                    "ON tblSession.Id = tblGroupTokens.ObjectId WHERE tblGroupTokens.UserId = " + AccessingUser.ID +
                    " AND tblGroupTokens.ObjectTypeId = 7" +
                    " AND tblGroupTokens.UserId = " + AccessingUser.ID +
                    " AND tblSession.OwnerId = " + TargetUser.ID +
                    " AND tblSession.IsOysterSession <> 0 " +
                    " ORDER BY tblSession.Description";
            }
            else
            {

                sSQL = "SELECT DISTINCT tblGroupTokens.ObjectId,tblSession.Description FROM tblGroupTokens left outer join tblSession " +
                    "ON tblSession.Id = tblGroupTokens.ObjectId WHERE tblGroupTokens.UserId = " + TargetUser.ID +
                    " AND tblGroupTokens.ObjectTypeId = 7" +
                    " AND tblGroupTokens.IsVisible <> 0" +
                    " AND tblSession.OwnerId = " + TargetUser.ID +
                    " AND tblSession.IsOysterSession <> 0 " +
                    " ORDER BY tblSession.Description";

            }
            System.Data.DataSet DS = RF.GetDataSet(sSQL);
            OCL.RecordingSessions ARS = new RecordingSessions();

            if(DS.Tables[0].Rows.Count > 0)
            {
                foreach(DataRow r in DS.Tables[0].Rows)
                {
                    ARS.Add(GetSession(Convert.ToInt32(r[0])));
                }
            }
            return ARS;
        }
Esempio n. 2
0
        internal OCL.RecordingSessions GetAllOwnedRecordingSessions(OCL.User AccessingUser)
        {
            try
            {
                string sSQL = "SELECT ID FROM tblSession WHERE OwnerId = " +
                    AccessingUser.ID +
                    " AND IsOysterSession <> 0 " +
                    " AND IsDefault = 0" +
                    " ORDER BY Description";

                DataSet DS = RF.GetDataSet(sSQL);

                OCL.RecordingSessions ARS = new RecordingSessions();

                foreach(DataRow r in DS.Tables[0].Rows)
                {
                    OCL.RecordingSession R = GetSession(Convert.ToInt32(r[0]));
                    if(R != null)
                        ARS.Add(R);
                }
                return ARS;
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }
        }
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);
        }
Esempio n. 4
0
 public RecordingSessions AllVisibleContent(OCL.User AccessingUser)
 {
     Functions F = new Functions();
     RecordingSessions RS = new RecordingSessions();
     if(AccessingUser.ID != mvarID)
     {
         RS = F.GetAllVisibleContent(AccessingUser,this);
     }
     else
     {
         RS = F.GetAllVisibleContent(AccessingUser);
     }
     return RS;
 }
Esempio n. 5
0
 /// <summary>
 /// Get all Owned Oyster Recording Sessions that are visible by the Accessing User
 /// </summary>
 /// <param name="AccessingUser"></param>
 /// <returns></returns>
 public RecordingSessions AllOwnedRecordingSessions(OCL.User AccessingUser)
 {
     Functions F = new Functions();
     RecordingSessions RS = new RecordingSessions();
     if((AccessingUser.mvarIsSuperUser)||(AccessingUser.mvarID == this.mvarID))
     {
         RS = F.GetAllOwnedRecordingSessions(this);
     }
     else
     {
         RS = F.GetAllVisibleRecordingSessions(AccessingUser,this);
     }
     return RS;
 }
Esempio n. 6
0
        /// <summary>
        /// Get all visible Oyster Recording Sessions that are visible by the accessing user
        /// and meets the supplied search criteria
        /// </summary>
        /// <param name="AccessingUser"></param>
        /// <param name="RecordingSessionSearchType"></param>
        /// <param name="SearchCriteria"></param>
        /// <returns></returns>
        public RecordingSessions AllVisibleRecordingSessions(OCL.User AccessingUser,
			OysterRecordingSessionSearchType RecordingSessionSearchType,string SearchCriteria)
        {
            Functions F = new Functions();
            RecordingSessions ARS = new RecordingSessions();

            ARS = F.GetAllVisibleRecordingSessions(AccessingUser,RecordingSessionSearchType,SearchCriteria);

            return ARS;
        }