Beispiel #1
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PRESCRIPTIONS);

            query.Add(Database.Tables.Prescriptions.PrescriberId);
            query.Add(Database.Tables.Prescriptions.PatientId);
            query.Add(Database.Tables.Prescriptions.Name);
            query.Add(Database.Tables.Prescriptions.Remark);
            query.Add(Database.Tables.Prescriptions.StartDate);
            query.Add(Database.Tables.Prescriptions.EndDate);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Prescriber = StaffsManager.GetMedicalStaff(reader.GetInt32(0));
                Patient    = PatientsManager.GetPatient(reader.GetInt32(1));
                Name       = reader.GetString(2);
                Remark     = reader.GetString(3);
                StartDate  = reader.GetDateTime(4);
                EndDate    = reader.GetDateTime(5);
                PatientsManager.Add(this);
            }

            reader.Close();
            // TODO: Implement fetching prescription's medications.
        }
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.WORKING_DAYS);

            query.Add(Database.Tables.WorkingDays.StaffId);
            query.Add(Database.Tables.WorkingDays.Sunday);
            query.Add(Database.Tables.WorkingDays.Monday);
            query.Add(Database.Tables.WorkingDays.Tuesday);
            query.Add(Database.Tables.WorkingDays.Wednesday);
            query.Add(Database.Tables.WorkingDays.Thursday);
            query.Add(Database.Tables.WorkingDays.Friday);
            query.Add(Database.Tables.WorkingDays.Saturday);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Owner     = StaffsManager.GetMedicalStaff(reader.GetInt32(0));
                Sunday    = reader.GetByte(1) > 0 ? true : false;
                Monday    = reader.GetByte(2) > 0 ? true : false;
                Tuesday   = reader.GetByte(3) > 0 ? true : false;
                Wednesday = reader.GetByte(4) > 0 ? true : false;
                Thursday  = reader.GetByte(5) > 0 ? true : false;
                Friday    = reader.GetByte(6) > 0 ? true : false;
                Saturday  = reader.GetByte(7) > 0 ? true : false;
                StaffsManager.Add(this);
            }

            reader.Close();
        }
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.LEAVE_DATES);

            query.Add(Database.Tables.LeaveDates.Date);
            query.Add(Database.Tables.LeaveDates.StaffId);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Date  = reader.GetDateTime(0);
                Owner = StaffsManager.GetMedicalStaff(reader.GetInt32(1));
                StaffsManager.Add(this);
            }

            reader.Close();
        }
Beispiel #4
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.APPOINTMENTS);

            query.Add(Database.Tables.Appointments.MedicalStaffId);
            query.Add(Database.Tables.Appointments.PatientId);
            query.Add(Database.Tables.Appointments.Cancelled);
            query.Add(Database.Tables.Appointments.DateAppointed);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                MedicalStaff  = StaffsManager.GetMedicalStaff(reader.GetInt32(0));
                Patient       = PatientsManager.GetPatient(reader.GetInt32(1));
                Cancelled     = reader.GetByte(2) > 0 ? true : false;
                DateAppointed = reader.GetDateTime(3);
                PatientsManager.Add(this);
            }

            reader.Close();
        }