Exemplo n.º 1
0
        /// <summary>
        /// Returns all Scenes currently in this Group
        /// </summary>
        /// <param name="GroupId"></param>
        /// <returns></returns>
        internal Scenes ALLVisibleScenes(OCL.User TargetUser, OCL.User AccessingUser, OCL.Group QueryGroup)
        {
            try
            {
                Scenes X = new Scenes();
                if(CheckGroupObjectPermission(AccessingUser,QueryGroup,2,TargetUser.ID,OCL.OysterPermissions.IsVisible))
                {

                    string sSQL = "SELECT DISTINCT ObjectId FROM tblGroupTokens WHERE UserId = " + TargetUser.ID +
                        " AND ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.Scene) +
                        " AND GroupId = " + QueryGroup.mvarID +
                    " AND IsVisible <> 0" +
                    " AND IsDefault = 0";

                    DataSet DS = RF.GetDataSet(sSQL);
                    DataTable DT = DS.Tables[0];
                    OCL.Scene DefaultScene = (OCL.Scene)GetUnassignedObject(OCL.OysterUnassignedObjects.Scene);
                    foreach(DataRow R in DT.Rows)
                    {
                        Scene Ro = GetScene(Convert.ToInt32((object)R[0]));
                        if(Ro != null)
                        {
                            if(Ro.ID != DefaultScene.ID)
                            {
                                X.Add(Ro);
                            }
                        }
                    }
                    DT.Dispose();
                }
                return X;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns all Scenes currently in this Group
        /// </summary>
        /// <param name="GroupId"></param>
        /// <returns></returns>
        internal System.Data.DataSet ALLVisibleScenesDS(OCL.User AccessingUser, OCL.Group QueryGroup)
        {
            try
            {
                Scenes X = new Scenes();

                string sSQL = "SELECT DISTINCT ObjectId FROM tblGroupTokens WHERE UserId = " + AccessingUser.ID +
                    " AND ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.Scene) +
                    " AND IsVisible <> 0";

                return RF.GetDataSet(sSQL);

            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns all Scenes currently in the System
        /// </summary>
        /// <returns></returns>
        internal Scenes ALLVisibleScenes(OCL.User AccessingUser)
        {
            try
            {
                string sSQL = "Select Id FROM tblScene WHERE IsDefault = 0";
                bool CheckScene = false;

                if(!AccessingUser.mvarIsSuperUser == true)
                {
                    sSQL = "SELECT DISTINCT ObjectId FROM tblGroupTokens WHERE UserId = " + AccessingUser.ID +
                        " AND ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.Scene) +
                        " AND IsVisible <> 0";
                    CheckScene = true;
                }

                Scenes X = new Scenes();
                DataSet DS = RF.GetDataSet(sSQL);
                DataTable DT = DS.Tables[0];
                OCL.Scene DefaultScene = (OCL.Scene)GetUnassignedObject(OCL.OysterUnassignedObjects.Scene);

                foreach(DataRow R in DT.Rows)
                {
                    Scene Ro = GetScene(Convert.ToInt32((object)R[0]));
                    if(Ro != null)
                    {
                        if(CheckScene)
                        {
                            if(Ro.ID != DefaultScene.ID)
                            {
                                X.Add(Ro);
                            }
                        }
                        else
                            X.Add(Ro);
                    }
                }
                DT.Dispose();
                return X;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }