예제 #1
0
        /// <summary>
        /// Inserts a row in the doan_MediaFiles table.
        /// </summary>
        /// <param name="trackID">The ID of the Track for which the File is being added.</param>
        /// <param name="filePath">The name of the physical Media File.</param>
        /// <param name="userGuid">The Guid of the user who is adding the File.</param>
        /// <returns>The ID of the Media File in the doan_MediaFiles table.</returns>
        public static int Insert(
            int trackId,
            string filePath,
            Guid userGuid)
        {
            FbParameter[] arParams = new FbParameter[4];

            arParams[0]           = new FbParameter(":TrackID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = trackId;

            arParams[1]           = new FbParameter(":FilePath", FbDbType.VarChar, 255);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = filePath;

            arParams[2]           = new FbParameter(":AddedDate", FbDbType.TimeStamp);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = DateTime.UtcNow;

            arParams[3]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = userGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            ConnectionString.GetWriteConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_MEDIAFILE_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
예제 #2
0
        /// <summary>
        /// Inserts a row in the mp_MediaTrack table.
        /// </summary>
        /// <param name="playerID">The ID of the player to which the Media Track is being added.</param>
        /// <param name="trackType">The type of the track.</param>
        /// <param name="trackOrder">The order position of the Media Track.</param>
        /// <param name="name">The name of the Media Track.</param>
        /// <param name="artist">The artist of the Media Track.</param>
        /// <param name="userGuid">The Guid of the user who added the Media Track.</param>
        /// <returns>The ID of the Media Track in the doan_MediaTracks table.</returns>
        public static int Insert(
            int playerId,
            string trackType,
            int trackOrder,
            string name,
            string artist,
            Guid userGuid)
        {
            FbParameter[] arParams = new FbParameter[7];

            arParams[0]           = new FbParameter(":PlayerID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = playerId;

            arParams[1]           = new FbParameter(":TrackType", FbDbType.VarChar, 10);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = trackType;

            arParams[2]           = new FbParameter(":TrackOrder", FbDbType.Integer);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = trackOrder;

            arParams[3]           = new FbParameter(":Name", FbDbType.VarChar, 100);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = name;

            arParams[4]           = new FbParameter(":Artist", FbDbType.VarChar, 100);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = artist;

            arParams[5]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = DateTime.UtcNow;

            arParams[6]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[6].Direction = ParameterDirection.Input;
            arParams[6].Value     = userGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            ConnectionString.GetWriteConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_MEDIATRACK_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }
예제 #3
0
        /// <summary>
        /// Inserts a row in the doan_MediaPlayers table.
        /// </summary>
        /// <param name="moduleID">The ID of the Module</param>
        /// <param name="playerType">The Player Type.</param>
        /// <param name="createdDate">The Date the Media Player was created.</param>
        /// <param name="userGuid">The Guid of the user who created the Media Player.</param>
        /// <param name="moduleGuid">The Guid of the Module.</param>
        /// <returns>The ID of the Media Player.</returns>
        public static int Insert(
            int moduleId,
            string playerType,
            String skin,
            Guid userGuid,
            Guid moduleGuid)
        {
            FbParameter[] arParams = new FbParameter[6];

            arParams[0]           = new FbParameter(":ModuleID", FbDbType.Integer);
            arParams[0].Direction = ParameterDirection.Input;
            arParams[0].Value     = moduleId;

            arParams[1]           = new FbParameter(":PlayerType", FbDbType.VarChar, 10);
            arParams[1].Direction = ParameterDirection.Input;
            arParams[1].Value     = playerType;

            arParams[2]           = new FbParameter(":Skin", FbDbType.VarChar, 50);
            arParams[2].Direction = ParameterDirection.Input;
            arParams[2].Value     = skin;

            arParams[3]           = new FbParameter(":CreatedDate", FbDbType.TimeStamp);
            arParams[3].Direction = ParameterDirection.Input;
            arParams[3].Value     = DateTime.UtcNow;

            arParams[4]           = new FbParameter(":UserGuid", FbDbType.Char, 36);
            arParams[4].Direction = ParameterDirection.Input;
            arParams[4].Value     = userGuid.ToString();

            arParams[5]           = new FbParameter(":ModuleGuid", FbDbType.Char, 36);
            arParams[5].Direction = ParameterDirection.Input;
            arParams[5].Value     = moduleGuid.ToString();

            int newID = Convert.ToInt32(FBSqlHelper.ExecuteScalar(
                                            ConnectionString.GetWriteConnectionString(),
                                            CommandType.StoredProcedure,
                                            "EXECUTE PROCEDURE MP_MEDIAPLAYER_INSERT ("
                                            + FBSqlHelper.GetParamString(arParams.Length) + ")",
                                            arParams));

            return(newID);
        }