Ejemplo n.º 1
0
 public List<Travel> GetAllByConferenceID(int ConferenceID)
 {
     TravelDAC _travelComponent = new TravelDAC();
     IDataReader reader = _travelComponent.GetAllTravel("ConferenceID = " + ConferenceID).CreateDataReader();
     List<Travel> _travelList = new List<Travel>();
     while (reader.Read())
     {
         if (_travelList == null)
             _travelList = new List<Travel>();
         Travel _travel = new Travel();
         if (reader["ID"] != DBNull.Value)
             _travel.ID = Convert.ToInt32(reader["ID"]);
         if (reader["Name"] != DBNull.Value)
             _travel.Name = Convert.ToString(reader["Name"]);
         if (reader["TransportationTypeID"] != DBNull.Value)
             _travel.TransportationTypeID = Convert.ToInt32(reader["TransportationTypeID"]);
         if (reader["Description"] != DBNull.Value)
             _travel.Description = Convert.ToString(reader["Description"]);
         if (reader["ConferenceID"] != DBNull.Value)
             _travel.ConferenceID = Convert.ToInt32(reader["ConferenceID"]);
         _travel.NewRecord = false;
         _travelList.Add(_travel);
     } reader.Close();
     return _travelList;
 }
Ejemplo n.º 2
0
 public Travel GetByID(int _iD)
 {
     TravelDAC _travelComponent = new TravelDAC();
      IDataReader reader = _travelComponent.GetByIDTravel(_iD);
      Travel _travel = null;
      while(reader.Read())
      {
          _travel = new Travel();
          if(reader["ID"] != DBNull.Value)
              _travel.ID = Convert.ToInt32(reader["ID"]);
          if(reader["Name"] != DBNull.Value)
              _travel.Name = Convert.ToString(reader["Name"]);
          if(reader["TransportationTypeID"] != DBNull.Value)
              _travel.TransportationTypeID = Convert.ToInt32(reader["TransportationTypeID"]);
          if(reader["Description"] != DBNull.Value)
              _travel.Description = Convert.ToString(reader["Description"]);
          if (reader["ConferenceID"] != DBNull.Value)
              _travel.ConferenceID = Convert.ToInt32(reader["ConferenceID"]);
      _travel.NewRecord = false;             }             reader.Close();
      return _travel;
 }
Ejemplo n.º 3
0
 public void Delete(int Original_ID)
 {
     TravelDAC travelComponent = new TravelDAC();
     travelComponent.DeleteTravel(Original_ID);
 }
Ejemplo n.º 4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     TravelDAC travelcomponent = new TravelDAC();
     return travelcomponent.UpdateDataset(dataset);
 }
Ejemplo n.º 5
0
 public bool Update( string Name,  int TransportationTypeID,  string Description,int ConferenceID,  int Original_ID)
 {
     TravelDAC travelComponent = new TravelDAC();
     return travelComponent.UpdateTravel( Name,  TransportationTypeID,  Description,ConferenceID,  Original_ID);
 }
Ejemplo n.º 6
0
 public bool Update(Travel travel ,int old_iD)
 {
     TravelDAC travelComponent = new TravelDAC();
     return travelComponent.UpdateTravel( travel.Name,  travel.TransportationTypeID,  travel.Description,travel.ConferenceID,  old_iD);
 }
Ejemplo n.º 7
0
        public bool Insert( string Name,  int TransportationTypeID,  string Description,int ConferenceID)
        {
            TravelDAC travelComponent = new TravelDAC();
            int ID = 0;

            return travelComponent.InsertNewTravel( ref ID,  Name,  TransportationTypeID,  Description, ConferenceID);
        }
Ejemplo n.º 8
0
 public bool Insert(Travel travel)
 {
     int autonumber = 0;
     TravelDAC travelComponent = new TravelDAC();
     bool endedSuccessfuly = travelComponent.InsertNewTravel( ref autonumber,  travel.Name,  travel.TransportationTypeID,  travel.Description,travel.ConferenceID);
     if(endedSuccessfuly)
     {
         travel.ID = autonumber;
     }
     return endedSuccessfuly;
 }