static public TestReferral BuildReferralFromDataBaseData(string idReferral) { using (NpgsqlConnection connection = Global.GetSqlConnection()) { string findR = "SELECT * FROM public.referral WHERE id_referral = '" + idReferral + "'"; // string findR = "select id_patient_person from public.referral"; NpgsqlCommand Rcommand = new NpgsqlCommand(findR, connection); using (NpgsqlDataReader RReader = Rcommand.ExecuteReader()) { while (RReader.Read()) { TestReferral r = new TestReferral(); r.evInfo = TestEventsInfo.BuildAdditionalFromDataBaseData(idReferral); if (RReader["id_patient_person"] != DBNull.Value) { r.patient = TestPatient.BuildPatientFromDataBaseData(RReader["id_patient_person"].ToString(), RReader["id_patient_source_mo_mis"].ToString()); } r.refInfo = TestReferralInfo.BuildPersonFromDataBaseData(idReferral); r.refSourse = TestReferralSource.BuildSourceFromDataBaseData(idReferral); r.refSurvey = TestReferralSurvey.BuildAdditionalFromDataBaseData(idReferral); r.refTarget = TestReferralTarget.BuildTargetFromDataBaseData(idReferral); return(r); } } } return(null); }
public static TestEventsInfo BuildAdditionalFromDataBaseData(string idReferral) { TestEventsInfo p = new TestEventsInfo(); p.cancellation = TestCancellation.BuildCancellationFromDataBaseData(idReferral); p.source = TestEventSource.BuildSourceFromDataBaseData(idReferral); p.target = TestEventTarget.BuildTargetFromDataBaseData(idReferral); return p; }
static public TestEventsInfo BuildAdditionalFromDataBaseData(string idReferral) { TestEventsInfo p = new TestEventsInfo(); p.cancellation = TestCancellation.BuildCancellationFromDataBaseData(idReferral); p.source = TestEventSource.BuildSourceFromDataBaseData(idReferral); p.target = TestEventTarget.BuildTargetFromDataBaseData(idReferral); return(p); }
private void FindMismatch(TestEventsInfo r) { if (Global.GetLength(this.cancellation) != Global.GetLength(r.cancellation)) Global.errors3.Add("Несовпадение длины cancellation TestEventsInfo"); if (Global.GetLength(this.source) != Global.GetLength(r.source)) Global.errors3.Add("Несовпадение длины source TestEventsInfo"); if (Global.GetLength(this.target) != Global.GetLength(r.target)) Global.errors3.Add("Несовпадение длины target TestEventsInfo"); }
public TestReferral(Referral r, string idLpu = "") { evInfo = new TestEventsInfo(r.EventsInfo); patient = new TestPatient(r.Patient); refInfo = new TestReferralInfo(r.ReferralInfo); refSurvey = new TestReferralSurvey(r.ReferralSurvey); refSourse = new TestReferralSource(r.Source); refTarget = new TestReferralTarget(r.Target); }
private void FindMismatch(TestEventsInfo r) { if (Global.GetLength(this.cancellation) != Global.GetLength(r.cancellation)) { Global.errors3.Add("Несовпадение длины cancellation TestEventsInfo"); } if (Global.GetLength(this.source) != Global.GetLength(r.source)) { Global.errors3.Add("Несовпадение длины source TestEventsInfo"); } if (Global.GetLength(this.target) != Global.GetLength(r.target)) { Global.errors3.Add("Несовпадение длины target TestEventsInfo"); } }
public override bool Equals(Object obj) { TestEventsInfo p = obj as TestEventsInfo; if ((Global.IsEqual(this.cancellation, p?.cancellation)) && (Global.IsEqual(this.source, p?.source)) && (Global.IsEqual(this.target, p?.target))) { return(true); } else { this.FindMismatch(p); Global.errors3.Add("несовпадение TestEventsInfo"); return(false); } }