private void FindMismatch(TestPatient b) { if (Global.GetLength(this.person) != Global.GetLength(b.person)) { Global.errors2.Add("несовпадение длины person TestPatient"); } if (Global.GetLength(this.docs) != Global.GetLength(b.docs)) { Global.errors2.Add("несовпадение длины documents TestPatient"); } if (Global.GetLength(this.conts) != Global.GetLength(b.conts)) { Global.errors2.Add("несовпадение длины contacts TestPatient"); } if (Global.GetLength(this.adds) != Global.GetLength(b.adds)) { Global.errors2.Add("несовпадение длины addreses TestPatient"); } if (Global.GetLength(this.jobs) != Global.GetLength(b.jobs)) { Global.errors2.Add("несовпадение длины job TestPatient"); } if (Global.GetLength(this.privileges) != Global.GetLength(b.privileges)) { Global.errors2.Add("несовпадение длины privilege TestPatient"); } }
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 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); }
static public TestPatient BuildPatientFromDataBaseData(string idPerson, string MIS) { TestPatient patient = new TestPatient(); patient.addreses = TestAddress.BuildAdressesFromDataBaseData(idPerson); patient.contacts = TestContact.BuildContactsFromDataBaseData(idPerson); patient.documents = TestDocument.BuildDocumentsFromDataBaseData(idPerson); patient.jobs = TestJob.BuildJobFromDataBaseData(idPerson); patient.privileges = TestPrivilege.BuildPrivilegeFromDataBaseData(idPerson); patient.person = TestPerson.BuildPersonFromDataBaseData(idPerson, MIS); return(patient); }
public override bool Equals(Object obj) { TestPatient p = obj as TestPatient; if ((Global.IsEqual(this.adds, p?.adds)) && (Global.IsEqual(this.conts, p?.conts)) && (Global.IsEqual(this.docs, p?.docs)) && (Global.IsEqual(this.jobs, p?.jobs)) && (Global.IsEqual(this.privileges, p?.privileges)) && (Global.IsEqual(this.person, p?.person))) { return(true); } else { this.FindMismatch(p); Global.errors3.Add("несовпадение TestPatient"); return(false); } }
private void FindMismatch(TestPatient b) { if (Global.GetLength(this.person) != Global.GetLength(b.person)) Global.errors2.Add("несовпадение длины person TestPatient"); if (Global.GetLength(this.docs) != Global.GetLength(b.docs)) Global.errors2.Add("несовпадение длины documents TestPatient"); if (Global.GetLength(this.conts) != Global.GetLength(b.conts)) Global.errors2.Add("несовпадение длины contacts TestPatient"); if (Global.GetLength(this.adds) != Global.GetLength(b.adds)) Global.errors2.Add("несовпадение длины addreses TestPatient"); if (Global.GetLength(this.jobs) != Global.GetLength(b.jobs)) Global.errors2.Add("несовпадение длины job TestPatient"); if (Global.GetLength(this.privileges) != Global.GetLength(b.privileges)) Global.errors2.Add("несовпадение длины privilege TestPatient"); }
public static TestPatient BuildPatientFromDataBaseData(string idPerson, string MIS) { TestPatient patient = new TestPatient(); patient.addreses = TestAddress.BuildAdressesFromDataBaseData(idPerson); patient.contacts = TestContact.BuildContactsFromDataBaseData(idPerson); patient.documents = TestDocument.BuildDocumentsFromDataBaseData(idPerson); patient.jobs = TestJob.BuildJobFromDataBaseData(idPerson); patient.privileges = TestPrivilege.BuildPrivilegeFromDataBaseData(idPerson); patient.person = TestPerson.BuildPersonFromDataBaseData(idPerson, MIS); return patient; }