Пример #1
0
        public List <AdmissionStayChange> GetAll()
        {
            AdmissionStayChangeDAC     _admissionStayChangeComponent = new AdmissionStayChangeDAC();
            IDataReader                reader = _admissionStayChangeComponent.GetAllAdmissionStayChange().CreateDataReader();
            List <AdmissionStayChange> _admissionStayChangeList = new List <AdmissionStayChange>();

            while (reader.Read())
            {
                if (_admissionStayChangeList == null)
                {
                    _admissionStayChangeList = new List <AdmissionStayChange>();
                }
                AdmissionStayChange _admissionStayChange = new AdmissionStayChange();
                if (reader["AdmissionStayChangeId"] != DBNull.Value)
                {
                    _admissionStayChange.AdmissionStayChangeId = Convert.ToInt32(reader["AdmissionStayChangeId"]);
                }
                if (reader["PatientAdmissionId"] != DBNull.Value)
                {
                    _admissionStayChange.PatientAdmissionId = Convert.ToInt32(reader["PatientAdmissionId"]);
                }
                if (reader["AdmissionStayTypeId"] != DBNull.Value)
                {
                    _admissionStayChange.AdmissionStayTypeId = Convert.ToInt32(reader["AdmissionStayTypeId"]);
                }
                if (reader["ModifiedDate"] != DBNull.Value)
                {
                    _admissionStayChange.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                }
                _admissionStayChange.NewRecord = false;
                _admissionStayChangeList.Add(_admissionStayChange);
            }
            reader.Close();
            return(_admissionStayChangeList);
        }
Пример #2
0
        public AdmissionStayChange GetByID(int _admissionStayChangeId)
        {
            AdmissionStayChangeDAC _admissionStayChangeComponent = new AdmissionStayChangeDAC();
            IDataReader            reader = _admissionStayChangeComponent.GetByIDAdmissionStayChange(_admissionStayChangeId);
            AdmissionStayChange    _admissionStayChange = null;

            while (reader.Read())
            {
                _admissionStayChange = new AdmissionStayChange();
                if (reader["AdmissionStayChangeId"] != DBNull.Value)
                {
                    _admissionStayChange.AdmissionStayChangeId = Convert.ToInt32(reader["AdmissionStayChangeId"]);
                }
                if (reader["PatientAdmissionId"] != DBNull.Value)
                {
                    _admissionStayChange.PatientAdmissionId = Convert.ToInt32(reader["PatientAdmissionId"]);
                }
                if (reader["AdmissionStayTypeId"] != DBNull.Value)
                {
                    _admissionStayChange.AdmissionStayTypeId = Convert.ToInt32(reader["AdmissionStayTypeId"]);
                }
                if (reader["ModifiedDate"] != DBNull.Value)
                {
                    _admissionStayChange.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                }
                _admissionStayChange.NewRecord = false;
            }
            reader.Close();
            return(_admissionStayChange);
        }
Пример #3
0
        public bool Insert(AdmissionStayChange admissionstaychange)
        {
            int autonumber = 0;
            AdmissionStayChangeDAC admissionstaychangeComponent = new AdmissionStayChangeDAC();
            bool endedSuccessfuly = admissionstaychangeComponent.InsertNewAdmissionStayChange(ref autonumber, admissionstaychange.PatientAdmissionId, admissionstaychange.AdmissionStayTypeId, admissionstaychange.ModifiedDate);

            if (endedSuccessfuly)
            {
                admissionstaychange.AdmissionStayChangeId = autonumber;
            }
            return(endedSuccessfuly);
        }
Пример #4
0
        public bool Update(AdmissionStayChange admissionstaychange, int old_admissionStayChangeId)
        {
            AdmissionStayChangeDAC admissionstaychangeComponent = new AdmissionStayChangeDAC();

            return(admissionstaychangeComponent.UpdateAdmissionStayChange(admissionstaychange.PatientAdmissionId, admissionstaychange.AdmissionStayTypeId, admissionstaychange.ModifiedDate, old_admissionStayChangeId));
        }