示例#1
0
 public bool Insert(ConferenceHalls conferencehalls)
 {
     int autonumber = 0;
     ConferenceHallsDAC conferencehallsComponent = new ConferenceHallsDAC();
     bool endedSuccessfuly = conferencehallsComponent.InsertNewConferenceHalls( ref autonumber,  conferencehalls.Name,  conferencehalls.ConferenceId,  conferencehalls.MapPath);
     if(endedSuccessfuly)
     {
         conferencehalls.ConferenceHallsId = autonumber;
     }
     return endedSuccessfuly;
 }
示例#2
0
 public ConferenceHalls GetByID(int _conferenceHallsId)
 {
     ConferenceHallsDAC _conferenceHallsComponent = new ConferenceHallsDAC();
      IDataReader reader = _conferenceHallsComponent.GetByIDConferenceHalls(_conferenceHallsId);
      ConferenceHalls _conferenceHalls = null;
      while(reader.Read())
      {
          _conferenceHalls = new ConferenceHalls();
          if(reader["ConferenceHallsId"] != DBNull.Value)
              _conferenceHalls.ConferenceHallsId = Convert.ToInt32(reader["ConferenceHallsId"]);
          if(reader["Name"] != DBNull.Value)
              _conferenceHalls.Name = Convert.ToString(reader["Name"]);
          if(reader["ConferenceId"] != DBNull.Value)
              _conferenceHalls.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
          if(reader["MapPath"] != DBNull.Value)
              _conferenceHalls.MapPath = Convert.ToString(reader["MapPath"]);
      _conferenceHalls.NewRecord = false;             }             reader.Close();
      return _conferenceHalls;
 }
示例#3
0
 public List<ConferenceHalls> GetAll()
 {
     ConferenceHallsDAC _conferenceHallsComponent = new ConferenceHallsDAC();
      IDataReader reader =  _conferenceHallsComponent.GetAllConferenceHalls().CreateDataReader();
      List<ConferenceHalls> _conferenceHallsList = new List<ConferenceHalls>();
      while(reader.Read())
      {
      if(_conferenceHallsList == null)
          _conferenceHallsList = new List<ConferenceHalls>();
          ConferenceHalls _conferenceHalls = new ConferenceHalls();
          if(reader["ConferenceHallsId"] != DBNull.Value)
              _conferenceHalls.ConferenceHallsId = Convert.ToInt32(reader["ConferenceHallsId"]);
          if(reader["Name"] != DBNull.Value)
              _conferenceHalls.Name = Convert.ToString(reader["Name"]);
          if(reader["ConferenceId"] != DBNull.Value)
              _conferenceHalls.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
          if(reader["MapPath"] != DBNull.Value)
              _conferenceHalls.MapPath = Convert.ToString(reader["MapPath"]);
      _conferenceHalls.NewRecord = false;
      _conferenceHallsList.Add(_conferenceHalls);
      }             reader.Close();
      return _conferenceHallsList;
 }
示例#4
0
 public bool Update(ConferenceHalls conferencehalls ,int old_conferenceHallsId)
 {
     ConferenceHallsDAC conferencehallsComponent = new ConferenceHallsDAC();
     return conferencehallsComponent.UpdateConferenceHalls( conferencehalls.Name,  conferencehalls.ConferenceId,  conferencehalls.MapPath,  old_conferenceHallsId);
 }