예제 #1
0
 internal static MusicSongList GetMusicSongList(int listId)
 {
     MusicSongList m = new MusicSongList(listId);
     if (listId > 0)
     {
         SafeProcedure.ExecuteAndMapRecords(
                 Database.GetDatabase(D4DDefine.DBInstanceName),
              "dbo.Music_GetMusicSongList",
              delegate(IRecord record)
              {
                  m.MusicId = record.GetInt32OrDefault(1,0);
                  m.SongName = record.GetStringOrEmpty(2);
                  m.SongFile = record.GetStringOrEmpty(3);
                  m.SongTime = record.GetStringOrEmpty(4);
                  m.AddUserID = record.GetInt32OrDefault(5, 0);
                  m.AddDate = record.GetDateTime(6);
                  m.Status = (PublishStatus)(record.GetInt32OrDefault(7, 0));
              },
              listId);
     }
     return m;
 }
예제 #2
0
        internal static void MapMusicSongList(IRecord record, List<MusicSongList> list)
        {
            MusicSongList m = new MusicSongList();
            m.ListId = record.GetInt32OrDefault(0, 0);
            m.MusicId = record.GetInt32OrDefault(1, 0);
            m.SongName = record.GetStringOrEmpty(2);
            m.SongFile = record.GetStringOrEmpty(3);
            m.SongTime = record.GetStringOrEmpty(4);
            m.AddUserID = record.GetInt32OrDefault(5, 0);
            m.AddDate = record.GetDateTime(6);
            m.Status = (PublishStatus)(record.GetInt32OrDefault(7, 0));

            list.Add(m);
        }
예제 #3
0
        internal static int SetMusicSongList(MusicSongList m)
        {
            if (m == null) return -1;

            SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.Music_SetMusicSongList",
             delegate(IParameterSet parameters)
             {
                 parameters.AddWithValue("@ListId", m.ListId);
                 parameters.AddWithValue("@MusicId", m.MusicId);
                 parameters.AddWithValue("@SongName", m.SongName);
                 parameters.AddWithValue("@SongFile", m.SongFile);
                 parameters.AddWithValue("@SongTime", m.SongTime);
                 parameters.AddWithValue("@AddUserId", m.AddUserID);
                 parameters.AddWithValue("@Status",(int)(m.Status));
                 parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);

             },
             delegate(IParameterSet outputParameters)
             {
                 m.ListId = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
             });

            return m.ListId;
        }
예제 #4
0
 public int SetMusicSongList(MusicSongList m)
 {
     return MusicDao.SetMusicSongList(m);
 }