public static OfferingOrder[] GetAll(DateTime startOrderedDate, DateTime endOrderedDate, int offering_id = -1, int organisation_id = 0, int patient_id = -1, int staff_id = -1, bool is_filled_or_cancelled = false, bool is_not_filled_or_cancelled = false) { DataTable tbl = GetDataTable(startOrderedDate, endOrderedDate, offering_id, organisation_id, patient_id, staff_id, is_filled_or_cancelled, is_not_filled_or_cancelled); OfferingOrder[] o = new OfferingOrder[tbl.Rows.Count]; for (int i = 0; i < tbl.Rows.Count; i++) { o[i] = LoadAll(tbl.Rows[i]); } return(o); }
public InvoiceLine(int invoice_line_id, int invoice_id, int patient_id, int offering_id, decimal quantity, decimal price, decimal tax, string area_treated, string service_reference, int offering_order_id) { this.invoice_line_id = invoice_line_id; this.invoice_id = invoice_id; this.patient = new Patient(patient_id); this.offering = offering_id == -1 ? null : new Offering(offering_id); this.quantity = quantity; this.price = price; this.tax = tax; this.area_treated = area_treated; this.service_reference = service_reference; this.offering_order = offering_order_id == -1 ? null : new OfferingOrder(offering_order_id); }
public static OfferingOrder LoadAll(DataRow row) { OfferingOrder o = Load(row, "offeringorder_"); if (row["organisation_organisation_id"] != DBNull.Value) { o.Organisation = OrganisationDB.Load(row, "organisation_"); o.Organisation.OrganisationType = OrganisationTypeDB.Load(row, "org_type_"); o.Organisation.OrganisationType.OrganisationTypeGroup = IDandDescrDB.Load(row, "typegroup_organisation_type_group_id", "typegroup_descr"); } if (row["staff_staff_id"] != DBNull.Value) { o.Staff = StaffDB.Load(row, "staff_"); } if (row["staff_staff_id"] != DBNull.Value) { o.Staff.Person = PersonDB.Load(row, "person_staff_"); o.Staff.Person.Title = IDandDescrDB.Load(row, "title_staff_title_id", "title_staff_descr"); } if (row["patient_patient_id"] != DBNull.Value) { o.Patient = PatientDB.Load(row, "patient_"); } if (row["patient_patient_id"] != DBNull.Value) { o.Patient.Person = PersonDB.Load(row, "person_patient_"); o.Patient.Person.Title = IDandDescrDB.Load(row, "title_patient_title_id", "title_patient_descr"); } if (row["offering_offering_id"] != DBNull.Value) { o.Offering = OfferingDB.Load(row, "offering_"); } if (row["offeringfield_field_id"] != DBNull.Value) { o.Offering.Field = IDandDescrDB.Load(row, "offeringfield_field_id", "offeringfield_descr"); } return(o); }
public static OfferingOrder[] GetAll(DateTime startOrderedDate, DateTime endOrderedDate, int offering_id = -1, int organisation_id = 0, int patient_id = -1, int staff_id = -1, bool is_filled_or_cancelled = false, bool is_not_filled_or_cancelled = false) { DataTable tbl = GetDataTable(startOrderedDate, endOrderedDate, offering_id, organisation_id, patient_id, staff_id, is_filled_or_cancelled, is_not_filled_or_cancelled); OfferingOrder[] o = new OfferingOrder[tbl.Rows.Count]; for (int i = 0; i < tbl.Rows.Count; i++) o[i] = LoadAll(tbl.Rows[i]); return o; }