Ejemplo n.º 1
0
        public PagePatient(Patient _patient)
        {
            InitializeComponent();

            if (_patient != null)
            {
                patient      = _patient;
                modification = true;
            }
            else
            {
                patient      = new Patient(null, null, false, DateTime.Now, null, null, null);
                modification = false;
                int   id    = PatientRepository.nouveauPatient(patient, -1);
                Tests tests = new Tests();
                TestsRepository.nouveauxTests(patient.PatientId, tests);
                patient.PatientId = id;
            }
            PopUpContact.IdPatientActuel = patient.PatientId;
            InitialisationComposants();

            Patient.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
            Patient.Arrange(new Rect(0, 0, Patient.DesiredSize.Width, Patient.DesiredSize.Height));
            Fraterie.Width      = GridTabControl.ColumnDefinitions[0].ActualWidth;
            Parents.Width       = Arbre.ActualWidth;
            GrandsParents.Width = Arbre.ActualWidth;

            currentProche = new Proche("", "", 0, true, "", false, true, false);
        }
Ejemplo n.º 2
0
        public static string ExporterProche(Proche P, int i)
        {
            string variables = "";

            variables += "\newcommand{\\graphoProcheNom" + i + "}{" + P.ProcheNom + "}\n";
            variables += "\newcommand{\\graphoProchePrenom" + i + "}{" + P.ProchePrenom + "}\n";
            variables += "\newcommand{\\graphoProcheAge" + i + "}{" + P.ProcheAge + "}\n";

            if (P.ProcheSexe)
            {
                variables += "\newcommand{\\graphoProcheSexe" + i + "}{" + "garçon" + "}\n";
            }
            else
            {
                variables += "\newcommand{\\graphoProcheSexe" + i + "}{" + "fille" + "}\n";
            }


            variables += "\newcommand{\\graphoProchePlace" + i + "}{" + P.ProchePlace + "}\n";
            variables += "\newcommand{\\graphoProcheDisponibilite" + i + "}{" + P.ProcheDisponibilite + "}\n";
            variables += "\newcommand{\\graphoProcheLateralite" + i + "}{" + P.ProcheLateralite + "}\n";
            variables += "\newcommand{\\graphoProcheTrouble" + i + "}{" + P.ProcheTrouble + "}\n";

            return(variables);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Ajoute un nouveau proche à un patient
        /// </summary>
        /// <param name="P"></param>
        /// <param name="Pr"></param>
        public static void nouveauProche(int idPatient, Proche proche)
        {
            string nom           = proche.ProcheNom;
            string prenom        = proche.ProchePrenom;
            int    age           = proche.ProcheAge;
            bool   sexe          = proche.ProcheSexe;
            string place         = proche.ProchePlace;
            bool   disponibilite = proche.ProcheDisponibilite;
            bool   lateralite    = proche.ProcheLateralite;
            bool   trouble       = proche.ProcheTrouble;

            using (IDbConnection connection = new SQLiteConnection(DBAccess.connectionString()))
            {
                connection.Execute("INSERT INTO PROCHE (ProcheNom, ProchePrenom, ProcheAge, ProcheSexe, ProchePlace, ProcheDisponibilite, ProcheLateralite, ProcheTrouble, PatientId) " +
                                   "VALUES (@nom, @prenom, @age, @sexe, @place, @disponibilite, @lateralite, @trouble, @idPatient)",
                                   new { nom, prenom, age, sexe, place, disponibilite, lateralite, trouble, idPatient });
            }
        }