public static LetterTreatmentTemplate LoadAll(DataRow row)
    {
        LetterTreatmentTemplate letters = Load(row, "lettertreatmenttemplate_");

        letters.Field = IDandDescrDB.Load(row, "field_field_id", "field_descr");

        letters.FirstLetter            = LetterDB.Load(row, "firstletter_");
        letters.FirstLetter.LetterType = IDandDescrDB.Load(row, "firstlettertype_letter_type_id", "firstlettertype_descr");
        letters.FirstLetter.Site       = SiteDB.Load(row, "firstsite_");
        if (row["firstletterorg_organisation_id"] != DBNull.Value)
        {
            letters.FirstLetter.Organisation = OrganisationDB.Load(row, "firstletterorg_");
        }

        letters.TreatmentNotesLetter            = LetterDB.Load(row, "treatmentnotesletter_");
        letters.TreatmentNotesLetter.LetterType = IDandDescrDB.Load(row, "treatmentnoteslettertype_letter_type_id", "treatmentnoteslettertype_descr");
        letters.TreatmentNotesLetter.Site       = SiteDB.Load(row, "treatmentnotessite_");
        if (row["treatmentnotesletterorg_organisation_id"] != DBNull.Value)
        {
            letters.TreatmentNotesLetter.Organisation = OrganisationDB.Load(row, "treatmentnotesletterorg_");
        }

        letters.LastLetter            = LetterDB.Load(row, "lastletter_");
        letters.LastLetter.LetterType = IDandDescrDB.Load(row, "lastlettertype_letter_type_id", "lastlettertype_descr");
        letters.LastLetter.Site       = SiteDB.Load(row, "lastsite_");
        if (row["lastletterorg_organisation_id"] != DBNull.Value)
        {
            letters.LastLetter.Organisation = OrganisationDB.Load(row, "lastletterorg_");
        }

        letters.LastLetterPT            = LetterDB.Load(row, "lastletterpt_");
        letters.LastLetterPT.LetterType = IDandDescrDB.Load(row, "lastlettertypept_letter_type_id", "lastlettertypept_descr");
        letters.LastLetterPT.Site       = SiteDB.Load(row, "lastsitept_");
        if (row["lastletterorgpt_organisation_id"] != DBNull.Value)
        {
            letters.LastLetterPT.Organisation = OrganisationDB.Load(row, "lastletterorgpt_");
        }

        letters.LastLetterWhenReplacingEPC            = LetterDB.Load(row, "lastletterwhenreplacingepc_");
        letters.LastLetterWhenReplacingEPC.LetterType = IDandDescrDB.Load(row, "lastletterwhenreplacingepctype_letter_type_id", "lastletterwhenreplacingepctype_descr");
        letters.LastLetterWhenReplacingEPC.Site       = SiteDB.Load(row, "lastwhenreplacingepcsite_");
        if (row["lastletterorg_organisation_id"] != DBNull.Value)
        {
            letters.LastLetterWhenReplacingEPC.Organisation = OrganisationDB.Load(row, "lastletterwhenreplacingepcorg_");
        }

        letters.Site = SiteDB.Load(row, "site_");

        return(letters);
    }
示例#2
0
    public static LetterPrintHistory LoadAll(DataRow row)
    {
        LetterPrintHistory lph = Load(row, "lph_");

        lph.Letter = LetterDB.Load(row, "letter_");

        lph.SendMethod = new IDandDescr(Convert.ToInt32(row["lph_send_method_letter_print_history_send_method_id"]), Convert.ToString(row["lph_send_method_descr"]));

        lph.Letter.LetterType = IDandDescrDB.Load(row, "lettertype_letter_type_id", "lettertype_descr");
        if (row["letterorg_organisation_id"] != DBNull.Value)
        {
            lph.Letter.Organisation = OrganisationDB.Load(row, "letterorg_");
        }

        if (row["organisation_organisation_id"] != DBNull.Value)
        {
            lph.Organisation = OrganisationDB.Load(row, "organisation_");
        }

        if (row["patient_patient_id"] != DBNull.Value)
        {
            lph.Patient = PatientDB.Load(row, "patient_");
        }
        if (row["patient_patient_id"] != DBNull.Value)
        {
            lph.Patient.Person       = PersonDB.Load(row, "person_patient_");
            lph.Patient.Person.Title = IDandDescrDB.Load(row, "title_patient_title_id", "title_patient_descr");
        }

        if (row["staff_staff_id"] != DBNull.Value)
        {
            lph.Staff = StaffDB.Load(row, "staff_");
        }
        if (row["staff_staff_id"] != DBNull.Value)
        {
            lph.Staff.Person       = PersonDB.Load(row, "person_staff_");
            lph.Staff.Person.Title = IDandDescrDB.Load(row, "title_staff_title_id", "title_staff_descr");
        }

        if (row["regref_register_referrer_id"] != DBNull.Value)
        {
            lph.RegisterReferrer = RegisterReferrerDB.Load(row, "regref_");
        }
        if (row["regreforg_organisation_id"] != DBNull.Value)
        {
            lph.RegisterReferrer.Organisation = OrganisationDB.Load(row, "regreforg_");
        }
        if (row["referrer_referrer_id"] != DBNull.Value)
        {
            lph.RegisterReferrer.Referrer = ReferrerDB.Load(row, "referrer_");
        }
        if (row["referrer_referrer_id"] != DBNull.Value)
        {
            lph.RegisterReferrer.Referrer.Person       = PersonDB.Load(row, "person_referrer_");
            lph.RegisterReferrer.Referrer.Person.Title = IDandDescrDB.Load(row, "title_referrer_title_id", "title_referrer_descr");
        }

        if (row["lph_health_card_action_id"] != DBNull.Value)
        {
            lph.HealthCardAction = HealthCardActionDB.Load(row, "hca_");
            lph.HealthCardAction.healthCardActionType = IDandDescrDB.Load(row, "hcat_health_card_action_type_id", "hcat_descr");
            lph.HealthCardAction.HealthCard           = HealthCardDB.Load(row, "hc_");
        }

        if (row["lph_booking_id"] != DBNull.Value)
        {
            lph.Booking = BookingDB.Load(row, "booking_");
        }

        return(lph);
    }