예제 #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;
        }
예제 #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);
            }
        }