/// <summary>
        /// Deletes a PermissionType record
        /// </summary>
        public static int Delete(PermissionTypeDO DO)
        {
            SqlParameter _PermissionTypeID = new SqlParameter("PermissionTypeID", SqlDbType.VarChar);
            
            _PermissionTypeID.Value = DO.PermissionTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PermissionTypeID
            };

            return DataCommon.ExecuteScalar("[dbo].[PermissionType_Delete]", _params, "dbo");
        }
        /// <summary>
        /// Updates a PermissionType record and returns the number of records affected
        /// </summary>
        public static int Update(PermissionTypeDO DO)
        {
            SqlParameter _PermissionTypeID = new SqlParameter("PermissionTypeID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);
            
            _PermissionTypeID.Value = DO.PermissionTypeID;
            _Description.Value = DO.Description;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PermissionTypeID,
                _Description
            };

            return DataCommon.ExecuteScalar("[dbo].[PermissionType_Update]", _params, "dbo");
        }
        /// <summary>
        /// Creates a new PermissionType record
        /// </summary>
        public static void Create(PermissionTypeDO DO)
        {
            SqlParameter _PermissionTypeID = new SqlParameter("PermissionTypeID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _PermissionTypeID.Value = DO.PermissionTypeID;
            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _PermissionTypeID,
                _Description
            };

            DataCommon.ExecuteNonQuery("[dbo].[PermissionType_Insert]", _params, "dbo");
        }
        /// <summary>
        /// Gets all PermissionType records
        /// </summary>
        public static PermissionTypeDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PermissionType_GetAll]", new SqlParameter[] { }, "dbo");

            List<PermissionTypeDO> objs = new List<PermissionTypeDO>();

            while(sr.Read()){

                PermissionTypeDO obj = new PermissionTypeDO();

                obj.PermissionTypeID = sr.GetString(sr.GetOrdinal("PermissionTypeID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
        /// <summary>
        /// Selects PermissionType records by PK
        /// </summary>
        public static PermissionTypeDO[] GetByPK(String PermissionTypeID)
        {

            SqlParameter _PermissionTypeID = new SqlParameter("PermissionTypeID", SqlDbType.VarChar);
			
            _PermissionTypeID.Value = PermissionTypeID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _PermissionTypeID
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[PermissionType_GetByPK]", _params, "dbo");

            List<PermissionTypeDO> objs = new List<PermissionTypeDO>();
			
            while(sr.Read())
            {
                PermissionTypeDO obj = new PermissionTypeDO();
				
                obj.PermissionTypeID = sr.GetString(sr.GetOrdinal("PermissionTypeID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }