private SoundTempArray LoadSoundTemplate(string sSound_template_code) { SoundTempArray soundTempArray = new SoundTempArray(); SoundTempArray result; try { DataProvider dataProvider = new DataProvider(); string sqlString = "SELECT [sound_template_id],[sound_template_code],[sound_type_id],[sound_id], [nreads] FROM [dbo].[SOUND_TEMPLATES]WHERE sound_template_code = '" + sSound_template_code + "' Order By [orderby]"; SqlDataReader sqlDataReader = dataProvider.excuteQuery(sqlString); while (sqlDataReader.Read()) { int isound_template_id = int.Parse(sqlDataReader[0].ToString()); string ssound_template_code = sqlDataReader[1].ToString(); int isound_type_id = int.Parse(sqlDataReader[2].ToString()); int isound_id = sqlDataReader.IsDBNull(3) ? 0 : int.Parse(sqlDataReader[3].ToString()); int inread = sqlDataReader.IsDBNull(4) ? 0 : int.Parse(sqlDataReader[4].ToString()); SoundTempInfo si = new SoundTempInfo(isound_template_id, ssound_template_code, isound_type_id, isound_id, inread); soundTempArray.Add(si); } sqlDataReader.Close(); } catch (SqlException ex) { MyMsgBox.MsgError(ex.Message); result = new SoundTempArray(); return(result); } result = soundTempArray; return(result); }
public void SetSoundTemplate(string sSoundTemplate) { this.SoundTmpArray = this.LoadSoundTemplate(sSoundTemplate); }