Пример #1
0
        public bool Insert(DateTime AdmissionStartDate, DateTime DischargeDate, int AdmissionStayTypeId, int DischargeTypeId, string PatientCode, int ConsultantId, int SpecialityId, int WardBedId)
        {
            PatientAdmissionDAC patientadmissionComponent = new PatientAdmissionDAC();
            int PatientAdmissionId = 0;

            return(patientadmissionComponent.InsertNewPatientAdmission(ref PatientAdmissionId, AdmissionStartDate, DischargeDate, AdmissionStayTypeId, DischargeTypeId, PatientCode, ConsultantId, SpecialityId, WardBedId));
        }
Пример #2
0
        public List <PatientAdmission> GetAll()
        {
            PatientAdmissionDAC     _patientAdmissionComponent = new PatientAdmissionDAC();
            IDataReader             reader = _patientAdmissionComponent.GetAllPatientAdmission().CreateDataReader();
            List <PatientAdmission> _patientAdmissionList = new List <PatientAdmission>();

            while (reader.Read())
            {
                if (_patientAdmissionList == null)
                {
                    _patientAdmissionList = new List <PatientAdmission>();
                }
                PatientAdmission _patientAdmission = new PatientAdmission();
                if (reader["PatientAdmissionId"] != DBNull.Value)
                {
                    _patientAdmission.PatientAdmissionId = Convert.ToInt32(reader["PatientAdmissionId"]);
                }
                if (reader["AdmissionStartDate"] != DBNull.Value)
                {
                    _patientAdmission.AdmissionStartDate = Convert.ToDateTime(reader["AdmissionStartDate"]);
                }
                if (reader["DischargeDate"] != DBNull.Value)
                {
                    _patientAdmission.DischargeDate = Convert.ToDateTime(reader["DischargeDate"]);
                }
                if (reader["AdmissionStayTypeId"] != DBNull.Value)
                {
                    _patientAdmission.AdmissionStayTypeId = Convert.ToInt32(reader["AdmissionStayTypeId"]);
                }
                if (reader["DischargeTypeId"] != DBNull.Value)
                {
                    _patientAdmission.DischargeTypeId = Convert.ToInt32(reader["DischargeTypeId"]);
                }
                if (reader["PatientCode"] != DBNull.Value)
                {
                    _patientAdmission.PatientCode = Convert.ToString(reader["PatientCode"]);
                }
                if (reader["ConsultantId"] != DBNull.Value)
                {
                    _patientAdmission.ConsultantId = Convert.ToInt32(reader["ConsultantId"]);
                }
                if (reader["SpecialityId"] != DBNull.Value)
                {
                    _patientAdmission.SpecialityId = Convert.ToInt32(reader["SpecialityId"]);
                }
                if (reader["WardBedId"] != DBNull.Value)
                {
                    _patientAdmission.WardBedId = Convert.ToInt32(reader["WardBedId"]);
                }
                _patientAdmission.NewRecord = false;
                _patientAdmissionList.Add(_patientAdmission);
            }
            reader.Close();
            return(_patientAdmissionList);
        }
Пример #3
0
        public bool Insert(PatientAdmission patientadmission)
        {
            int autonumber = 0;
            PatientAdmissionDAC patientadmissionComponent = new PatientAdmissionDAC();
            bool endedSuccessfuly = patientadmissionComponent.InsertNewPatientAdmission(ref autonumber, patientadmission.AdmissionStartDate, patientadmission.DischargeDate, patientadmission.AdmissionStayTypeId, patientadmission.DischargeTypeId, patientadmission.PatientCode, patientadmission.ConsultantId, patientadmission.SpecialityId, patientadmission.WardBedId);

            if (endedSuccessfuly)
            {
                patientadmission.PatientAdmissionId = autonumber;
            }
            return(endedSuccessfuly);
        }
Пример #4
0
        public PatientAdmission GetByID(int _patientAdmissionId)
        {
            PatientAdmissionDAC _patientAdmissionComponent = new PatientAdmissionDAC();
            IDataReader         reader            = _patientAdmissionComponent.GetByIDPatientAdmission(_patientAdmissionId);
            PatientAdmission    _patientAdmission = null;

            while (reader.Read())
            {
                _patientAdmission = new PatientAdmission();
                if (reader["PatientAdmissionId"] != DBNull.Value)
                {
                    _patientAdmission.PatientAdmissionId = Convert.ToInt32(reader["PatientAdmissionId"]);
                }
                if (reader["AdmissionStartDate"] != DBNull.Value)
                {
                    _patientAdmission.AdmissionStartDate = Convert.ToDateTime(reader["AdmissionStartDate"]);
                }
                if (reader["DischargeDate"] != DBNull.Value)
                {
                    _patientAdmission.DischargeDate = Convert.ToDateTime(reader["DischargeDate"]);
                }
                if (reader["AdmissionStayTypeId"] != DBNull.Value)
                {
                    _patientAdmission.AdmissionStayTypeId = Convert.ToInt32(reader["AdmissionStayTypeId"]);
                }
                if (reader["DischargeTypeId"] != DBNull.Value)
                {
                    _patientAdmission.DischargeTypeId = Convert.ToInt32(reader["DischargeTypeId"]);
                }
                if (reader["PatientCode"] != DBNull.Value)
                {
                    _patientAdmission.PatientCode = Convert.ToString(reader["PatientCode"]);
                }
                if (reader["ConsultantId"] != DBNull.Value)
                {
                    _patientAdmission.ConsultantId = Convert.ToInt32(reader["ConsultantId"]);
                }
                if (reader["SpecialityId"] != DBNull.Value)
                {
                    _patientAdmission.SpecialityId = Convert.ToInt32(reader["SpecialityId"]);
                }
                if (reader["WardBedId"] != DBNull.Value)
                {
                    _patientAdmission.WardBedId = Convert.ToInt32(reader["WardBedId"]);
                }
                _patientAdmission.NewRecord = false;
            }
            reader.Close();
            return(_patientAdmission);
        }
Пример #5
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            PatientAdmissionDAC patientadmissioncomponent = new PatientAdmissionDAC();

            return(patientadmissioncomponent.UpdateDataset(dataset));
        }
Пример #6
0
        public void Delete(int Original_PatientAdmissionId)
        {
            PatientAdmissionDAC patientadmissionComponent = new PatientAdmissionDAC();

            patientadmissionComponent.DeletePatientAdmission(Original_PatientAdmissionId);
        }
Пример #7
0
        public bool Update(DateTime AdmissionStartDate, DateTime DischargeDate, int AdmissionStayTypeId, int DischargeTypeId, string PatientCode, int ConsultantId, int SpecialityId, int WardBedId, int Original_PatientAdmissionId)
        {
            PatientAdmissionDAC patientadmissionComponent = new PatientAdmissionDAC();

            return(patientadmissionComponent.UpdatePatientAdmission(AdmissionStartDate, DischargeDate, AdmissionStayTypeId, DischargeTypeId, PatientCode, ConsultantId, SpecialityId, WardBedId, Original_PatientAdmissionId));
        }
Пример #8
0
        public bool Update(PatientAdmission patientadmission, int old_patientAdmissionId)
        {
            PatientAdmissionDAC patientadmissionComponent = new PatientAdmissionDAC();

            return(patientadmissionComponent.UpdatePatientAdmission(patientadmission.AdmissionStartDate, patientadmission.DischargeDate, patientadmission.AdmissionStayTypeId, patientadmission.DischargeTypeId, patientadmission.PatientCode, patientadmission.ConsultantId, patientadmission.SpecialityId, patientadmission.WardBedId, old_patientAdmissionId));
        }