public bool Insert(ScheduleSessionType schedulesessiontype)
 {
     int autonumber = 0;
     ScheduleSessionTypeDAC schedulesessiontypeComponent = new ScheduleSessionTypeDAC();
     bool endedSuccessfuly = schedulesessiontypeComponent.InsertNewScheduleSessionType( ref autonumber,  schedulesessiontype.Name,  schedulesessiontype.ConferenceId);
     if(endedSuccessfuly)
     {
         schedulesessiontype.ScheduleSessionTypeId = autonumber;
     }
     return endedSuccessfuly;
 }
 public ScheduleSessionType GetByID(int _scheduleSessionTypeId)
 {
     ScheduleSessionTypeDAC _scheduleSessionTypeComponent = new ScheduleSessionTypeDAC();
      IDataReader reader = _scheduleSessionTypeComponent.GetByIDScheduleSessionType(_scheduleSessionTypeId);
      ScheduleSessionType _scheduleSessionType = null;
      while(reader.Read())
      {
          _scheduleSessionType = new ScheduleSessionType();
          if(reader["ScheduleSessionTypeId"] != DBNull.Value)
              _scheduleSessionType.ScheduleSessionTypeId = Convert.ToInt32(reader["ScheduleSessionTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _scheduleSessionType.Name = Convert.ToString(reader["Name"]);
          if(reader["ConferenceId"] != DBNull.Value)
              _scheduleSessionType.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
      _scheduleSessionType.NewRecord = false;             }             reader.Close();
      return _scheduleSessionType;
 }
 public List<ScheduleSessionType> GetAll()
 {
     ScheduleSessionTypeDAC _scheduleSessionTypeComponent = new ScheduleSessionTypeDAC();
      IDataReader reader =  _scheduleSessionTypeComponent.GetAllScheduleSessionType().CreateDataReader();
      List<ScheduleSessionType> _scheduleSessionTypeList = new List<ScheduleSessionType>();
      while(reader.Read())
      {
      if(_scheduleSessionTypeList == null)
          _scheduleSessionTypeList = new List<ScheduleSessionType>();
          ScheduleSessionType _scheduleSessionType = new ScheduleSessionType();
          if(reader["ScheduleSessionTypeId"] != DBNull.Value)
              _scheduleSessionType.ScheduleSessionTypeId = Convert.ToInt32(reader["ScheduleSessionTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _scheduleSessionType.Name = Convert.ToString(reader["Name"]);
          if(reader["ConferenceId"] != DBNull.Value)
              _scheduleSessionType.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
      _scheduleSessionType.NewRecord = false;
      _scheduleSessionTypeList.Add(_scheduleSessionType);
      }             reader.Close();
      return _scheduleSessionTypeList;
 }
 public bool Update(ScheduleSessionType schedulesessiontype ,int old_scheduleSessionTypeId)
 {
     ScheduleSessionTypeDAC schedulesessiontypeComponent = new ScheduleSessionTypeDAC();
     return schedulesessiontypeComponent.UpdateScheduleSessionType( schedulesessiontype.Name,  schedulesessiontype.ConferenceId,  old_scheduleSessionTypeId);
 }