public void SetEmail(int p_oid, string p_email)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setEmail) ENABLED START*/

            // Write here your custom code...

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (p_oid > 0)
            {
                PatientEN patient = patientCEN.ReadOID(p_oid);

                if (patient != null)
                {
                    if (!string.IsNullOrEmpty(p_email))
                    {
                        patient.Email = p_email;
                        patientCAD.Modify(patient);
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
        public bool Login(string p_nif, string p_password)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_login) ENABLED START*/

            // Write here your custom code...
            bool resultado = false;

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (!string.IsNullOrEmpty(p_nif))
            {
                IList <PatientEN> patient = patientCEN.GetPatientByNif(p_nif);
                if (patient != null && patient.Count == 1)
                {
                    if (!string.IsNullOrEmpty(p_password))
                    {
                        if (patient [0].Password.Equals(Utils.Util.GetEncondeMD5(p_password)))
                        {
                            resultado = true;
                        }
                    }
                }
            }


            return(resultado);
            /*PROTECTED REGION END*/
        }
        public void SetMaritalStatus(int p_oid, ChroniGenNHibernate.Enumerated.Chroni.MaritalStatusEnum p_maritalStatus)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setMaritalStatus) ENABLED START*/

            // Write here your custom code...


            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (p_oid > 0)
            {
                PatientEN patient = patientCEN.ReadOID(p_oid);

                if (patient != null)
                {
                    if (p_maritalStatus > 0)
                    {
                        patient.MaritalStatus = p_maritalStatus;
                        patientCAD.Modify(patient);
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
Beispiel #4
0
        public void SetPassword(int p_oid, string p_passwordCurrent, string p_passwordNew)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setPassword) ENABLED START*/

            // Write here your custom code...

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (p_oid > 0)
            {
                PatientEN patient = patientCEN.ReadOID(p_oid);

                if (patient != null)
                {
                    if (!string.IsNullOrEmpty(p_passwordCurrent) && !string.IsNullOrEmpty(p_passwordNew))
                    {
                        if (Utils.Util.GetEncondeMD5(p_passwordCurrent).Equals(patient.Password))
                        {
                            patient.Password = Utils.Util.GetEncondeMD5(p_passwordNew);
                            patientCAD.Modify(patient);
                        }
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
Beispiel #5
0
        public void SetBirthDate(int p_oid, Nullable <DateTime> p_birthDate)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setBirthDate) ENABLED START*/

            // Write here your custom code...

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (p_oid > 0)
            {
                PatientEN patient = patientCEN.ReadOID(p_oid);

                if (patient != null)
                {
                    if (p_birthDate != null)
                    {
                        patient.BirthDate = p_birthDate;
                        patientCAD.Modify(patient);
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
Beispiel #6
0
        public void SetRelationship(int p_oid, int p_oid_patient, int p_oid_relatedPerson)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Relationship_setRelationship) ENABLED START*/

            // Write here your custom code...

            RelationshipCAD relationshipCAD = new RelationshipCAD();
            RelationshipCEN relationshipCEN = new RelationshipCEN(relationshipCAD);

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCen = new PatientCEN(patientCAD);

            RelatedPersonCAD relatedPersonCAD = new RelatedPersonCAD();
            RelatedPersonCEN relatedPersonCEN = new RelatedPersonCEN(relatedPersonCAD);

            if (p_oid > 0)
            {
                RelationshipEN relationship = relationshipCEN.ReadOID(p_oid);

                if (relationship != null)
                {
                    if (p_oid_patient > 0)
                    {
                        PatientEN patient = patientCen.ReadOID(p_oid_patient);

                        if (patient != null)
                        {
                            if (p_oid_relatedPerson > 0)
                            {
                                RelatedPersonEN relatedPerson = relatedPersonCEN.ReadOID(p_oid_relatedPerson);

                                if (relatedPerson != null)
                                {
                                    relationship.PatientOID       = p_oid_patient;
                                    relationship.RelatedPersonOID = p_oid_relatedPerson;
                                    relationshipCAD.Modify(relationship);
                                }
                            }
                        }
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
public void SetActive (int p_oid, bool p_active)
{
        /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setActive) ENABLED START*/

        // Write here your custom code...
        PatientCAD patientCAD = new PatientCAD ();
        PatientCEN patientCEN = new PatientCEN (patientCAD);

        if (p_oid > 0) {
                PatientEN patient = patientCEN.ReadOID (p_oid);

                if (patient != null) {
                        patient.Active = p_active;
                        patientCAD.Modify (patient);
                }
        }

        /*PROTECTED REGION END*/
}
Beispiel #8
0
        public bool Logout(int p_oid)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_logout) ENABLED START*/

            // Write here your custom code...

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCEN = new PatientCEN(patientCAD);

            if (p_oid > 0)
            {
                PatientEN patient = patientCEN.ReadOID(p_oid);

                if (patient != null)
                {
                    return(true);
                }
            }

            return(false);
            /*PROTECTED REGION END*/
        }