コード例 #1
0
        public ConferenceCategory GetByID(int _conferenceCategoryId)
        {
            ConferenceCategoryDAC _conferenceCategoryComponent = new ConferenceCategoryDAC();
            IDataReader           reader = _conferenceCategoryComponent.GetByIDConferenceCategory(_conferenceCategoryId);
            ConferenceCategory    _conferenceCategory = null;

            while (reader.Read())
            {
                _conferenceCategory = new ConferenceCategory();
                if (reader["ConferenceCategoryId"] != DBNull.Value)
                {
                    _conferenceCategory.ConferenceCategoryId = Convert.ToInt32(reader["ConferenceCategoryId"]);
                }
                if (reader["CategoryName"] != DBNull.Value)
                {
                    _conferenceCategory.CategoryName = Convert.ToString(reader["CategoryName"]);
                }
                if (reader["ConferenceId"] != DBNull.Value)
                {
                    _conferenceCategory.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
                }
                _conferenceCategory.NewRecord = false;
            }
            reader.Close();
            return(_conferenceCategory);
        }
コード例 #2
0
        public List <ConferenceCategory> GetAllByConferenceId(int ConferenceId)
        {
            ConferenceCategoryDAC     _conferenceCategoryComponent = new ConferenceCategoryDAC();
            IDataReader               reader = _conferenceCategoryComponent.GetAllConferenceCategory("ConferenceId = " + ConferenceId).CreateDataReader();
            List <ConferenceCategory> _conferenceCategoryList = new List <ConferenceCategory>();

            while (reader.Read())
            {
                if (_conferenceCategoryList == null)
                {
                    _conferenceCategoryList = new List <ConferenceCategory>();
                }
                ConferenceCategory _conferenceCategory = new ConferenceCategory();
                if (reader["ConferenceCategoryId"] != DBNull.Value)
                {
                    _conferenceCategory.ConferenceCategoryId = Convert.ToInt32(reader["ConferenceCategoryId"]);
                }
                if (reader["CategoryName"] != DBNull.Value)
                {
                    _conferenceCategory.CategoryName = Convert.ToString(reader["CategoryName"]);
                }
                if (reader["ConferenceId"] != DBNull.Value)
                {
                    _conferenceCategory.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
                }
                _conferenceCategory.NewRecord = false;
                _conferenceCategoryList.Add(_conferenceCategory);
            }
            reader.Close();
            return(_conferenceCategoryList);
        }
コード例 #3
0
        public bool Insert(ConferenceCategory conferencecategory)
        {
            int autonumber = 0;
            ConferenceCategoryDAC conferencecategoryComponent = new ConferenceCategoryDAC();
            bool endedSuccessfuly = conferencecategoryComponent.InsertNewConferenceCategory(ref autonumber, conferencecategory.CategoryName, conferencecategory.ConferenceId);

            if (endedSuccessfuly)
            {
                conferencecategory.ConferenceCategoryId = autonumber;
            }
            return(endedSuccessfuly);
        }
コード例 #4
0
        public bool Update(ConferenceCategory conferencecategory, int old_conferenceCategoryId)
        {
            ConferenceCategoryDAC conferencecategoryComponent = new ConferenceCategoryDAC();

            return(conferencecategoryComponent.UpdateConferenceCategory(conferencecategory.CategoryName, conferencecategory.ConferenceId, old_conferenceCategoryId));
        }