コード例 #1
0
        protected IDbCommand UpdateBackupDatabaseVersionCommand(ITransaction transaction, string version)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = $"UPDATE PRODUCT_VERSION{BACKUP_TABLE_SUFFIX} SET VERSION=@VERSION WHERE PRODUCT=@PRODUCT_NAME";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "VERSION", version, typeof(string));
            database.AddParameter(result, "PRODUCT_NAME", "MediaPortal", typeof(string));
            return(result);
        }
コード例 #2
0
        public static IDbCommand UpdateDatabaseVersionCommand(ITransaction transaction, string version)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = "UPDATE PRODUCT_VERSION SET VERSION=@VERSION WHERE PRODUCT=@PRODUCT_NAME";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "VERSION", version, typeof(string));
            database.AddParameter(result, "PRODUCT_NAME", "MediaPortal", typeof(string));
            return(result);
        }
コード例 #3
0
        public static IDbCommand CopyUserProfileCommand(ITransaction transaction, Guid profileId, Guid newProfileId, string newName)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = "INSERT INTO USER_PROFILES (PROFILE_ID, NAME, PROFILE_TYPE, PASSWORD, IMAGE, LAST_LOGIN) " +
                                 "SELECT @NEW_PROFILE_ID, @NAME, PROFILE_TYPE, PASSWORD, IMAGE, LAST_LOGIN FROM USER_PROFILES WHERE PROFILE_ID=@PROFILE_ID";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "PROFILE_ID", profileId, typeof(Guid));
            database.AddParameter(result, "NEW_PROFILE_ID", newProfileId, typeof(Guid));
            database.AddParameter(result, "NAME", newName, typeof(string));
            return(result);
        }
コード例 #4
0
        public static IDbCommand UpdateUserProfileCommand(ITransaction transaction, Guid profileId, string name, UserProfileType profileType = UserProfileType.ClientProfile, string password = null)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = "UPDATE USER_PROFILES SET NAME=@NAME, PROFILE_TYPE=@PROFILE_TYPE, PASSWORD=@PASSWORD WHERE PROFILE_ID=@PROFILE_ID";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "PROFILE_ID", profileId, typeof(Guid));
            database.AddParameter(result, "NAME", name, typeof(string));
            database.AddParameter(result, "PROFILE_TYPE", (int)profileType, typeof(int));
            database.AddParameter(result, "PASSWORD", password, typeof(string));
            return(result);
        }
コード例 #5
0
        public static IDbCommand InsertSubSchemaCommand(ITransaction transaction, string subSchemaName,
                                                        int versionMajor, int versionMinor)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = "INSERT INTO MEDIAPORTAL_BASIS (SUBSCHEMA_NAME, VERSION_MAJOR, VERSION_MINOR) VALUES (@SUBSCHEMA_NAME, @VERSION_MAJOR, @VERSION_MINOR)";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "SUBSCHEMA_NAME", subSchemaName, typeof(string));
            database.AddParameter(result, "VERSION_MAJOR", versionMajor, typeof(int));
            database.AddParameter(result, "VERSION_MINOR", versionMinor, typeof(int));
            return(result);
        }
コード例 #6
0
        public static IDbCommand UpdateSubSchemaCommand(ITransaction transaction, string subSchemaName,
                                                        int versionMajor, int versionMinor)
        {
            IDbCommand result = transaction.CreateCommand();

            result.CommandText = "UPDATE MEDIAPORTAL_BASIS SET VERSION_MAJOR=@VERSION_MAJOR, VERSION_MINOR=@VERSION_MINOR WHERE SUBSCHEMA_NAME=@SUBSCHEMA_NAME";
            ISQLDatabase database = transaction.Database;

            database.AddParameter(result, "VERSION_MAJOR", versionMajor, typeof(int));
            database.AddParameter(result, "VERSION_MINOR", versionMinor, typeof(int));
            database.AddParameter(result, "SUBSCHEMA_NAME", subSchemaName, typeof(string));
            return(result);
        }