コード例 #1
0
ファイル: VenuesLogic.cs プロジェクト: ramyothman/RBM
 public Venues GetByID(int _iD)
 {
     VenuesDAC _venuesComponent = new VenuesDAC();
     IDataReader reader = _venuesComponent.GetByIDVenues(_iD);
     Venues _venues = null;
     while (reader.Read())
     {
         _venues = new Venues();
         if (reader["ID"] != DBNull.Value)
             _venues.ID = Convert.ToInt32(reader["ID"]);
         if (reader["Name"] != DBNull.Value)
             _venues.Name = Convert.ToString(reader["Name"]);
         if (reader["Description"] != DBNull.Value)
             _venues.Description = Convert.ToString(reader["Description"]);
         if (reader["Location"] != DBNull.Value)
             _venues.Location = Convert.ToString(reader["Location"]);
         if (reader["Star"] != DBNull.Value)
             _venues.Star = Convert.ToInt32(reader["Star"]);
         if (reader["URL"] != DBNull.Value)
             _venues.URL = Convert.ToString(reader["URL"]);
         if (reader["Phone"] != DBNull.Value)
             _venues.Phone = Convert.ToString(reader["Phone"]);
         if (reader["Fax"] != DBNull.Value)
             _venues.Fax = Convert.ToString(reader["Fax"]);
         if (reader["Email"] != DBNull.Value)
             _venues.Email = Convert.ToString(reader["Email"]);
         _venues.NewRecord = false;
     } reader.Close();
     return _venues;
 }
コード例 #2
0
ファイル: VenuesLogic.cs プロジェクト: ramyothman/RBM
 public List<Venues> GetAll()
 {
     VenuesDAC _venuesComponent = new VenuesDAC();
     IDataReader reader = _venuesComponent.GetAllVenues().CreateDataReader();
     List<Venues> _venuesList = new List<Venues>();
     while (reader.Read())
     {
         if (_venuesList == null)
             _venuesList = new List<Venues>();
         Venues _venues = new Venues();
         if (reader["ID"] != DBNull.Value)
             _venues.ID = Convert.ToInt32(reader["ID"]);
         if (reader["Name"] != DBNull.Value)
             _venues.Name = Convert.ToString(reader["Name"]);
         if (reader["Description"] != DBNull.Value)
             _venues.Description = Convert.ToString(reader["Description"]);
         if (reader["Location"] != DBNull.Value)
             _venues.Location = Convert.ToString(reader["Location"]);
         if (reader["Star"] != DBNull.Value)
             _venues.Star = Convert.ToInt32(reader["Star"]);
         if (reader["URL"] != DBNull.Value)
             _venues.URL = Convert.ToString(reader["URL"]);
         if (reader["Phone"] != DBNull.Value)
             _venues.Phone = Convert.ToString(reader["Phone"]);
         if (reader["Fax"] != DBNull.Value)
             _venues.Fax = Convert.ToString(reader["Fax"]);
         if (reader["Email"] != DBNull.Value)
             _venues.Email = Convert.ToString(reader["Email"]);
         _venues.NewRecord = false;
         _venuesList.Add(_venues);
     } reader.Close();
     return _venuesList;
 }
コード例 #3
0
ファイル: VenuesLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(Venues venues, int old_iD)
 {
     VenuesDAC venuesComponent = new VenuesDAC();
     return venuesComponent.UpdateVenues(venues.Name, venues.Description, venues.Location, venues.Star, venues.URL, venues.Phone, venues.Fax, venues.Email, old_iD);
 }
コード例 #4
0
ファイル: VenuesLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(Venues venues)
 {
     int autonumber = 0;
     VenuesDAC venuesComponent = new VenuesDAC();
     bool endedSuccessfuly = venuesComponent.InsertNewVenues(ref autonumber, venues.Name, venues.Description, venues.Location, venues.Star, venues.URL, venues.Phone, venues.Fax, venues.Email);
     if (endedSuccessfuly)
     {
         venues.ID = autonumber;
     }
     return endedSuccessfuly;
 }