예제 #1
0
        public List <ScheduleSessionType> GetAll()
        {
            ScheduleSessionTypeDAC     _scheduleSessionTypeComponent = new ScheduleSessionTypeDAC();
            IDataReader                reader = _scheduleSessionTypeComponent.GetAllScheduleSessionType().CreateDataReader();
            List <ScheduleSessionType> _scheduleSessionTypeList = new List <ScheduleSessionType>();

            while (reader.Read())
            {
                if (_scheduleSessionTypeList == null)
                {
                    _scheduleSessionTypeList = new List <ScheduleSessionType>();
                }
                ScheduleSessionType _scheduleSessionType = new ScheduleSessionType();
                if (reader["ScheduleSessionTypeId"] != DBNull.Value)
                {
                    _scheduleSessionType.ScheduleSessionTypeId = Convert.ToInt32(reader["ScheduleSessionTypeId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _scheduleSessionType.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["ConferenceId"] != DBNull.Value)
                {
                    _scheduleSessionType.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
                }
                _scheduleSessionType.NewRecord = false;
                _scheduleSessionTypeList.Add(_scheduleSessionType);
            }
            reader.Close();
            return(_scheduleSessionTypeList);
        }
예제 #2
0
        public ScheduleSessionType GetByID(int _scheduleSessionTypeId)
        {
            ScheduleSessionTypeDAC _scheduleSessionTypeComponent = new ScheduleSessionTypeDAC();
            IDataReader            reader = _scheduleSessionTypeComponent.GetByIDScheduleSessionType(_scheduleSessionTypeId);
            ScheduleSessionType    _scheduleSessionType = null;

            while (reader.Read())
            {
                _scheduleSessionType = new ScheduleSessionType();
                if (reader["ScheduleSessionTypeId"] != DBNull.Value)
                {
                    _scheduleSessionType.ScheduleSessionTypeId = Convert.ToInt32(reader["ScheduleSessionTypeId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _scheduleSessionType.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["ConferenceId"] != DBNull.Value)
                {
                    _scheduleSessionType.ConferenceId = Convert.ToInt32(reader["ConferenceId"]);
                }
                _scheduleSessionType.NewRecord = false;
            }
            reader.Close();
            return(_scheduleSessionType);
        }
예제 #3
0
        public bool Insert(ScheduleSessionType schedulesessiontype)
        {
            int autonumber = 0;
            ScheduleSessionTypeDAC schedulesessiontypeComponent = new ScheduleSessionTypeDAC();
            bool endedSuccessfuly = schedulesessiontypeComponent.InsertNewScheduleSessionType(ref autonumber, schedulesessiontype.Name, schedulesessiontype.ConferenceId);

            if (endedSuccessfuly)
            {
                schedulesessiontype.ScheduleSessionTypeId = autonumber;
            }
            return(endedSuccessfuly);
        }
예제 #4
0
        public bool Update(ScheduleSessionType schedulesessiontype, int old_scheduleSessionTypeId)
        {
            ScheduleSessionTypeDAC schedulesessiontypeComponent = new ScheduleSessionTypeDAC();

            return(schedulesessiontypeComponent.UpdateScheduleSessionType(schedulesessiontype.Name, schedulesessiontype.ConferenceId, old_scheduleSessionTypeId));
        }