Exemplo n.º 1
0
        public Permissions GetPermissions()
        {
            try
            {
                string sSQL = "SELECT Id, Name FROM tblPermission";
                DataTable DT = GetDataTable(sSQL);
                Permissions X = new Permissions();
                foreach(DataRow r in DT.Rows)
                {

                    Permission P = new Permission();
                    P.mvarPermissionId = Convert.ToInt32(r[0]);
                    P.mvarDescription = Convert.ToString(r[1]);

                    X.Add(P);
                }
                return X;
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message,Err.InnerException);
            }
        }
Exemplo n.º 2
0
        internal Permissions GetSpecificPermissions(int SectionTypeId, OysterTypes.OysterPermissionTypes OPT)
        {
            try
            {
                int PermissionId = Convert.ToInt32(OPT);

                string sSQL = "Select * from tblSectionTypePermissionRel WHERE SectionTypeID = " + SectionTypeId.ToString() +
                    " AND PermissionId = " + PermissionId;
                DataTable DT = GetDataTable(sSQL);
                Permissions AP = new Permissions();
                if(DT.Rows.Count > 0)
                {
                    foreach(DataRow  R in DT.Rows)
                    {
                        Permission P = new Permission();

                        P.mvarSectionTypeId = Convert.ToInt32((object)R[0]);
                        P.mvarPermissionId = Convert.ToInt32((object)R[1]);
                        P.mvarCanOperateOn = Convert.ToInt32((object)R[2]);
                        P.mvarTargetSectionTypeId = Convert.ToInt32((object)R[2]);
                        P.mvarDescription = GetPermissionDescription(P.mvarPermissionId);
                        AP.Add(P);
                    }
                }
                DT.Dispose();
                return AP;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
                //return false;
            }
        }
Exemplo n.º 3
0
        internal SectionType()
        {
            //
            // TODO: Add constructor logic here
            //

            mvarCanCopyRecordings = new Permissions();
            mvarCanCreateSectionTypes = new Permissions();
            mvarCanDestroyAnyUsers = new Permissions();
            mvarCanDestroyRecordings = new Permissions();
            mvarCanEditSectionTypes = new Permissions();
            mvarCanRemoveSectionTypes = new Permissions();
            mvarCanMoveSectionTypes = new Permissions();
            mvarCanViewUnassignedRecordings = new Permissions();
            mvarCanMoveRecordings = new Permissions();
        }