public bool Insert(SiteSectionStatus sitesectionstatus) { int autonumber = 0; SiteSectionStatusDAC sitesectionstatusComponent = new SiteSectionStatusDAC(); bool endedSuccessfuly = sitesectionstatusComponent.InsertNewSiteSectionStatus( ref autonumber, sitesectionstatus.Name, sitesectionstatus.RowGuid, sitesectionstatus.ModifiedDate); if(endedSuccessfuly) { sitesectionstatus.SiteSectionStatusId = autonumber; } return endedSuccessfuly; }
public SiteSectionStatus GetByID(int _siteSectionStatusId) { SiteSectionStatusDAC _siteSectionStatusComponent = new SiteSectionStatusDAC(); IDataReader reader = _siteSectionStatusComponent.GetByIDSiteSectionStatus(_siteSectionStatusId); SiteSectionStatus _siteSectionStatus = null; while(reader.Read()) { _siteSectionStatus = new SiteSectionStatus(); if(reader["SiteSectionStatusId"] != DBNull.Value) _siteSectionStatus.SiteSectionStatusId = Convert.ToInt32(reader["SiteSectionStatusId"]); if(reader["Name"] != DBNull.Value) _siteSectionStatus.Name = Convert.ToString(reader["Name"]); if(reader["RowGuid"] != DBNull.Value) _siteSectionStatus.RowGuid = new Guid(reader["RowGuid"].ToString()); if(reader["ModifiedDate"] != DBNull.Value) _siteSectionStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); _siteSectionStatus.NewRecord = false; } reader.Close(); return _siteSectionStatus; }
public List<SiteSectionStatus> GetAll() { SiteSectionStatusDAC _siteSectionStatusComponent = new SiteSectionStatusDAC(); IDataReader reader = _siteSectionStatusComponent.GetAllSiteSectionStatus().CreateDataReader(); List<SiteSectionStatus> _siteSectionStatusList = new List<SiteSectionStatus>(); while(reader.Read()) { if(_siteSectionStatusList == null) _siteSectionStatusList = new List<SiteSectionStatus>(); SiteSectionStatus _siteSectionStatus = new SiteSectionStatus(); if(reader["SiteSectionStatusId"] != DBNull.Value) _siteSectionStatus.SiteSectionStatusId = Convert.ToInt32(reader["SiteSectionStatusId"]); if(reader["Name"] != DBNull.Value) _siteSectionStatus.Name = Convert.ToString(reader["Name"]); if(reader["RowGuid"] != DBNull.Value) _siteSectionStatus.RowGuid = new Guid(reader["RowGuid"].ToString()); if(reader["ModifiedDate"] != DBNull.Value) _siteSectionStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); _siteSectionStatus.NewRecord = false; _siteSectionStatusList.Add(_siteSectionStatus); } reader.Close(); return _siteSectionStatusList; }
public bool Update(SiteSectionStatus sitesectionstatus ,int old_siteSectionStatusId) { SiteSectionStatusDAC sitesectionstatusComponent = new SiteSectionStatusDAC(); return sitesectionstatusComponent.UpdateSiteSectionStatus( sitesectionstatus.Name, sitesectionstatus.RowGuid, sitesectionstatus.ModifiedDate, old_siteSectionStatusId); }