예제 #1
0
 public List<ConferencePrograms> GetAllByConferenceId(int ConferenceId)
 {
     ConferenceProgramsDAC _conferenceProgramsComponent = new ConferenceProgramsDAC();
     IDataReader reader = _conferenceProgramsComponent.GetAllConferencePrograms("ConferenceId = " + ConferenceId).CreateDataReader();
     List<ConferencePrograms> _conferenceProgramsList = new List<ConferencePrograms>();
     while (reader.Read())
     {
         if (_conferenceProgramsList == null)
             _conferenceProgramsList = new List<ConferencePrograms>();
         ConferencePrograms _conferencePrograms = new ConferencePrograms();
         if (reader["ConferenceProgramId"] != DBNull.Value)
             _conferencePrograms.ConferenceProgramId = Convert.ToInt32(reader["ConferenceProgramId"]);
         if (reader["ProgramName"] != DBNull.Value)
             _conferencePrograms.ProgramName = Convert.ToString(reader["ProgramName"]);
         if (reader["ConferenceId"] != DBNull.Value)
             _conferencePrograms.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
         _conferencePrograms.NewRecord = false;
         _conferenceProgramsList.Add(_conferencePrograms);
     } reader.Close();
     return _conferenceProgramsList;
 }
예제 #2
0
 public bool Insert(ConferencePrograms conferenceprograms)
 {
     int autonumber = 0;
     ConferenceProgramsDAC conferenceprogramsComponent = new ConferenceProgramsDAC();
     bool endedSuccessfuly = conferenceprogramsComponent.InsertNewConferencePrograms( ref autonumber,  conferenceprograms.ProgramName,  conferenceprograms.ConferenceId);
     if(endedSuccessfuly)
     {
         conferenceprograms.ConferenceProgramId = autonumber;
     }
     return endedSuccessfuly;
 }
예제 #3
0
 public ConferencePrograms GetByID(int _conferenceProgramId)
 {
     ConferenceProgramsDAC _conferenceProgramsComponent = new ConferenceProgramsDAC();
      IDataReader reader = _conferenceProgramsComponent.GetByIDConferencePrograms(_conferenceProgramId);
      ConferencePrograms _conferencePrograms = null;
      while(reader.Read())
      {
          _conferencePrograms = new ConferencePrograms();
          if(reader["ConferenceProgramId"] != DBNull.Value)
              _conferencePrograms.ConferenceProgramId = Convert.ToInt32(reader["ConferenceProgramId"]);
          if(reader["ProgramName"] != DBNull.Value)
              _conferencePrograms.ProgramName = Convert.ToString(reader["ProgramName"]);
          if(reader["ConferenceId"] != DBNull.Value)
              _conferencePrograms.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
      _conferencePrograms.NewRecord = false;             }             reader.Close();
      return _conferencePrograms;
 }
예제 #4
0
 public bool Update(ConferencePrograms conferenceprograms ,int old_conferenceProgramId)
 {
     ConferenceProgramsDAC conferenceprogramsComponent = new ConferenceProgramsDAC();
     return conferenceprogramsComponent.UpdateConferencePrograms( conferenceprograms.ProgramName,  conferenceprograms.ConferenceId,  old_conferenceProgramId);
 }