Exemple #1
0
 public ObservableCollection<Program> getAllRelatedProgram()
 {
     if (!isValid())
         return null;
     ObservableCollection<Program> programList = new ObservableCollection<Program>();
     string sqlCommand = String.Format("select prID from Program where pID = {0}", pID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectProgramIDByPmID(sqlCommand);
     while (reader.Read())
     {
         int prID = Int32.Parse(reader[0].ToString());
         Program program = new Program();
         program.id = prID;
         program.select();
         programList.Add(program);
     }
     sql.closeConnection();
     return programList;
 }