public static Credit LoadAll(DataRow row) { Credit credit = Load(row, "credit_"); credit.CreditType = new IDandDescr(Convert.ToInt32(row["credittype_credit_type_id"]), Convert.ToString(row["credittype_descr"])); if (row["vouchercredit_credit_id"] != DBNull.Value) { credit.VoucherCredit = CreditDB.Load(row, "vouchercredit_"); credit.VoucherCredit.CreditType = new IDandDescr(Convert.ToInt32(row["vouchercredittype_credit_type_id"]), Convert.ToString(row["vouchercredittype_descr"])); } if (row["added_by_staff_id"] != DBNull.Value) { credit.AddedBy = StaffDB.Load(row, "added_by_"); } if (row["person_added_by_person_id"] != DBNull.Value) { credit.AddedBy.Person = PersonDB.Load(row, "person_added_by_"); credit.AddedBy.Person.Title = IDandDescrDB.Load(row, "title_added_by_title_id", "title_added_by_descr"); } if (row["deleted_by_staff_id"] != DBNull.Value) { credit.DeletedBy = StaffDB.Load(row, "deleted_by_"); } if (row["person_deleted_by_person_id"] != DBNull.Value) { credit.DeletedBy.Person.Title = IDandDescrDB.Load(row, "title_deleted_by_title_id", "title_deleted_by_descr"); credit.DeletedBy.Person = PersonDB.Load(row, "person_deleted_by_"); } if (row["modified_by_staff_id"] != DBNull.Value) { credit.ModifiedBy = StaffDB.Load(row, "modified_by_"); } if (row["person_modified_by_person_id"] != DBNull.Value) { credit.ModifiedBy.Person.Title = IDandDescrDB.Load(row, "title_modified_by_title_id", "title_modified_by_descr"); credit.ModifiedBy.Person = PersonDB.Load(row, "person_modified_by_"); } return(credit); }
public static InvoiceLine LoadAll(DataRow row) { InvoiceLine line = Load(row); if (row["offering_id"] != DBNull.Value) { line.Offering = OfferingDB.Load(row); } if (row["credit_id"] != DBNull.Value) { line.Credit = CreditDB.Load(row, "credit_"); } if (row["patient_id"] != DBNull.Value) { line.Patient = PatientDB.Load(row, "patient_"); line.Patient.Person = PersonDB.Load(row, "patient_person_"); line.Patient.Person.Title = IDandDescrDB.Load(row, "title_patient_title_id", "title_patient_descr"); } return(line); }