public List<Sponsorslanguage> GetAll(int SponsorParentID) { SponsorslanguageDAC _sponsorslanguageComponent = new SponsorslanguageDAC(); IDataReader reader = _sponsorslanguageComponent.GetAllSponsorslanguage("SponsorParentID=" + SponsorParentID).CreateDataReader(); List<Sponsorslanguage> _sponsorslanguageList = new List<Sponsorslanguage>(); while (reader.Read()) { if (_sponsorslanguageList == null) _sponsorslanguageList = new List<Sponsorslanguage>(); Sponsorslanguage _sponsorslanguage = new Sponsorslanguage(); if (reader["SponsorId"] != DBNull.Value) _sponsorslanguage.SponsorId = Convert.ToInt32(reader["SponsorId"]); if (reader["SponsorName"] != DBNull.Value) _sponsorslanguage.SponsorName = Convert.ToString(reader["SponsorName"]); if (reader["ConferenceId"] != DBNull.Value) _sponsorslanguage.ConferenceId = Convert.ToInt32(reader["ConferenceId"]); if (reader["SponsorType"] != DBNull.Value) _sponsorslanguage.SponsorType = Convert.ToString(reader["SponsorType"]); if (reader["SponsorImage"] != DBNull.Value) _sponsorslanguage.SponsorImage = Convert.ToString(reader["SponsorImage"]); if (reader["LanguageID"] != DBNull.Value) _sponsorslanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]); if (reader["SponsorParentID"] != DBNull.Value) _sponsorslanguage.SponsorParentID = Convert.ToInt32(reader["SponsorParentID"]); _sponsorslanguage.NewRecord = false; _sponsorslanguageList.Add(_sponsorslanguage); } reader.Close(); return _sponsorslanguageList; }
public Sponsorslanguage GetByID(int _sponsorId) { SponsorslanguageDAC _sponsorslanguageComponent = new SponsorslanguageDAC(); IDataReader reader = _sponsorslanguageComponent.GetByIDSponsorslanguage(_sponsorId); Sponsorslanguage _sponsorslanguage = null; while(reader.Read()) { _sponsorslanguage = new Sponsorslanguage(); if(reader["SponsorId"] != DBNull.Value) _sponsorslanguage.SponsorId = Convert.ToInt32(reader["SponsorId"]); if(reader["SponsorName"] != DBNull.Value) _sponsorslanguage.SponsorName = Convert.ToString(reader["SponsorName"]); if(reader["ConferenceId"] != DBNull.Value) _sponsorslanguage.ConferenceId = Convert.ToInt32(reader["ConferenceId"]); if(reader["SponsorType"] != DBNull.Value) _sponsorslanguage.SponsorType = Convert.ToString(reader["SponsorType"]); if(reader["SponsorImage"] != DBNull.Value) _sponsorslanguage.SponsorImage = Convert.ToString(reader["SponsorImage"]); if(reader["LanguageID"] != DBNull.Value) _sponsorslanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]); if(reader["SponsorParentID"] != DBNull.Value) _sponsorslanguage.SponsorParentID = Convert.ToInt32(reader["SponsorParentID"]); _sponsorslanguage.NewRecord = false; } reader.Close(); return _sponsorslanguage; }
public bool Update(Sponsorslanguage sponsorslanguage ,int old_sponsorId) { SponsorslanguageDAC sponsorslanguageComponent = new SponsorslanguageDAC(); return sponsorslanguageComponent.UpdateSponsorslanguage( sponsorslanguage.SponsorName, sponsorslanguage.ConferenceId, sponsorslanguage.SponsorType, sponsorslanguage.SponsorImage, sponsorslanguage.LanguageID, sponsorslanguage.SponsorParentID, old_sponsorId); }
public bool Insert(Sponsorslanguage sponsorslanguage) { int autonumber = 0; SponsorslanguageDAC sponsorslanguageComponent = new SponsorslanguageDAC(); bool endedSuccessfuly = sponsorslanguageComponent.InsertNewSponsorslanguage( ref autonumber, sponsorslanguage.SponsorName, sponsorslanguage.ConferenceId, sponsorslanguage.SponsorType, sponsorslanguage.SponsorImage, sponsorslanguage.LanguageID, sponsorslanguage.SponsorParentID); if(endedSuccessfuly) { sponsorslanguage.SponsorId = autonumber; } return endedSuccessfuly; }