Пример #1
0
 public Patient(HospitalCard hc, string name, string address, int ssn, int age)
 {
     _pName    = name;
     _pAddress = address;
     _pSsn     = ssn;
     _pAge     = age;
     _hc       = hc;
 }
        public void CreatePatient(HospitalCard hc, string name, string address, int ssn, int age, string validTo)
        {
            _hcc.CreateHospitalCard(ssn, validTo);
            hc = _hcc.GetMember(ssn);
            Patient _p1 = new Patient(hc, name, address, ssn, age);

            _pc.Add(_p1);
        }
Пример #3
0
 public Patient(Relative rel, HospitalCard hc, string pName, string pAddress, int pSsn, int pAge)
 {
     _rel      = rel;
     _hc       = hc;
     _pName    = pName;
     _pAddress = pAddress;
     _pSsn     = pSsn;
     _pAge     = pAge;
 }
        public void CreatePatientWithRelative(string name, HospitalCard hc, Relative rel, string address, int ssn, int age, string validTo, string rName, string rPhone, string rRelation)
        {
            _hcc.CreateHospitalCard(ssn, validTo);
            hc = _hcc.GetMember(ssn);
            _rc.CreateRelative(rName, rPhone, rRelation);
            rel = _rc.GetMember(rPhone);

            Patient _p1 = new Patient(rel, hc, name, address, ssn, age);

            _pc.Add(_p1);
        }
        public HospitalCard GetMember(int ssn)
        {
            HospitalCard p = null;

            if (_hcc != null)
            {
                foreach (HospitalCard p1 in _hcc)
                {
                    if (p1.CardId == ssn)
                    {
                        p = p1;
                    }
                }
            }
            return(p);
        }
Пример #6
0
        public Patient CreatePatient(int ssn, string pName, string pAdress, int pAge, string rName, string rTlf, string relationship, int cID, int validTo)
        {
            HospitalCard pHospitalCard = _hospitalCardCatalog.CreateCard(cID, validTo);  //New hospital card gets created by calling CreateCard,
                                                                                         //which also runs all the other code in that method.

            Relative pRelative = null;                                                   //New relative variable pointing at nothing gets created.

            if (pAge < 18)                                                               //IF patient is under 18 (business logic),
            {
                pRelative = _relativeCatalog.CreateRelativ(rName, rTlf, relationship);   //the var is relevant and gets assigned information through
            }                                                                            //the CreateRelativ method in the _relativeCatalog
            _patient = new Patient(ssn, pName, pAdress, pAge, pRelative, pHospitalCard); //New patient gets created using parameters and new instances
            _pc.Add(_patient);                                                           //Patient gets added to catalog

            return(_patient);
        }
Пример #7
0
 public HospitalCard CreateCard(int cID, int validTo)
 {
     _hospitalCard = new HospitalCard(cID, validTo);
     _hc.Add(_hospitalCard);
     return(_hospitalCard);
 }
        public void CreateHospitalCard(int cardId, string validTo)
        {
            HospitalCard _hospitalCard = new HospitalCard(cardId, validTo);

            _hcc.Add(_hospitalCard);
        }