public override void UpdateInfo(AIOCommonInfo info) { base.UpdateInfo(info); AIOMusic music = (AIOMusic)info; string sql = "update Music set Name = ?, ArtistID = ?, AlbumID = ? where ID =?"; OleDbCommand cmd = aioDb.CreateSqlWithParam(sql, new object[] { music.name, music.artist, music.album, music.ID }); aioDb.ExecuteCommand(cmd); }
public override AIOCommonInfo Select(string ID) { AIOMusic music = new AIOMusic( base.Select( ID ) ); string sql = "SELECT * FROM Music WHERE ID='" + ID + "'"; DataTable DTMusic = aioDb.ExecuteSelect( sql ); object[] obj = DTMusic.Rows[0].ItemArray; music.name = obj[1].ToString(); music.album = obj[2].ToString(); music.artist = obj[3].ToString(); return music; }
public override AIOCommonInfo Select(string ID) { AIOMusic music = new AIOMusic(base.Select(ID)); string sql = "SELECT * FROM Music WHERE ID='" + ID + "'"; DataTable DTMusic = aioDb.ExecuteSelect(sql); object[] obj = DTMusic.Rows[0].ItemArray; music.name = obj[1].ToString(); music.album = obj[2].ToString(); music.artist = obj[3].ToString(); return(music); }
public frmMusicInfo( AIODatabase aioDb, AIOMusicController controller, string ID ) { // // Required for Windows Form Designer support // InitializeComponent(); this.aioDb = aioDb; this.musicControler = ( AIOMusicController )controller; this.music = ( AIOMusic )this.musicControler.Select( ID ); // // TODO: Add any constructor code after InitializeComponent call // }