Esempio n. 1
0
 public bool Insert(AirLine airline)
 {
     int autonumber = 0;
     AirLineDAC airlineComponent = new AirLineDAC();
     bool endedSuccessfuly = airlineComponent.InsertNewAirLine( ref autonumber,  airline.Name);
     if(endedSuccessfuly)
     {
         airline.ID = autonumber;
     }
     return endedSuccessfuly;
 }
Esempio n. 2
0
 public AirLine GetByID(int _iD)
 {
     AirLineDAC _airLineComponent = new AirLineDAC();
      IDataReader reader = _airLineComponent.GetByIDAirLine(_iD);
      AirLine _airLine = null;
      while(reader.Read())
      {
          _airLine = new AirLine();
          if(reader["ID"] != DBNull.Value)
              _airLine.ID = Convert.ToInt32(reader["ID"]);
          if(reader["Name"] != DBNull.Value)
              _airLine.Name = Convert.ToString(reader["Name"]);
      _airLine.NewRecord = false;             }             reader.Close();
      return _airLine;
 }
Esempio n. 3
0
 public List<AirLine> GetAll()
 {
     AirLineDAC _airLineComponent = new AirLineDAC();
      IDataReader reader =  _airLineComponent.GetAllAirLine().CreateDataReader();
      List<AirLine> _airLineList = new List<AirLine>();
      while(reader.Read())
      {
      if(_airLineList == null)
          _airLineList = new List<AirLine>();
          AirLine _airLine = new AirLine();
          if(reader["ID"] != DBNull.Value)
              _airLine.ID = Convert.ToInt32(reader["ID"]);
          if(reader["Name"] != DBNull.Value)
              _airLine.Name = Convert.ToString(reader["Name"]);
      _airLine.NewRecord = false;
      _airLineList.Add(_airLine);
      }             reader.Close();
      return _airLineList;
 }
Esempio n. 4
0
 public bool Update(AirLine airline ,int old_iD)
 {
     AirLineDAC airlineComponent = new AirLineDAC();
     return airlineComponent.UpdateAirLine( airline.Name,  old_iD);
 }
Esempio n. 5
0
        public bool Insert( string Name)
        {
            AirLineDAC airlineComponent = new AirLineDAC();
            int ID = 0;

            return airlineComponent.InsertNewAirLine( ref ID,  Name);
        }
Esempio n. 6
0
 public void Delete(int Original_ID)
 {
     AirLineDAC airlineComponent = new AirLineDAC();
     airlineComponent.DeleteAirLine(Original_ID);
 }
Esempio n. 7
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     AirLineDAC airlinecomponent = new AirLineDAC();
     return airlinecomponent.UpdateDataset(dataset);
 }
Esempio n. 8
0
 public bool Update( string Name,  int Original_ID)
 {
     AirLineDAC airlineComponent = new AirLineDAC();
     return airlineComponent.UpdateAirLine( Name,  Original_ID);
 }