Exemplo n.º 1
0
        public static string ExporterSpecialiste(Specialiste S)
        {
            string variables = "";


            return(variables);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Ajoute un nouveau spécialiste
        /// </summary>
        /// <param name="p"></param>
        public static void nouveauSpecialiste(Specialiste specialiste)
        {
            string nom        = specialiste.SpecialisteNom;
            string prenom     = specialiste.SpecialistePrenom;
            string specialite = specialiste.SpecialisteSpecialite;

            using (IDbConnection connection = new SQLiteConnection(DBAccess.connectionString()))
            {
                connection.Execute("INSERT INTO SPECIALISTE (SpecialisteNom, SpecialistePrenom, SpecialisteSpecialite) VALUES (@nom, @prenom, @specialite)",
                                   new { nom, prenom, specialite });
            }
        }
Exemplo n.º 3
0
        //================= INFORMATIONS GENERALES =================
        public void InitialisationComposants()
        {
            Id.Content = patient.PatientId.ToString();

            if (modification == true)
            {
                TextBox1.Text = patient.PatientNom;
                TextBox2.Text = patient.PatientPrenom;

                FlowDocument myFlowDoc   = new FlowDocument();
                Run          myRun       = new Run(patient.Commentaire);
                Paragraph    myParagraph = new Paragraph();
                myParagraph.Inlines.Add(myRun);
                myFlowDoc.Blocks.Add(myParagraph);
                Commentaire.Document = myFlowDoc;

                DatePickerNaissance.SelectedDate = patient.PatientNaissance;
                DatePickerJour.SelectedDate      = patient.PatientDateBilan;
                TextBlockAffichageAge.Content    = (DateTime.Now.Year - patient.PatientNaissance.Year).ToString() + " ans " + (DateTime.Now.Month - patient.PatientNaissance.Month).ToString() + " mois ";

                var contacts = ContactRepository.getContactsPatient(patient.PatientId);
                foreach (Contact contact in contacts)
                {
                    creerGridContact(contact.ContactDesignation, contact.ContactTelephone, contact.ContactMail);
                }

                var adresses = AdresseRepository.getAdressesPatient(patient.PatientId);
                foreach (Adresse adresse in adresses)
                {
                    creerGridAdresse(adresse.AdresseDesignation, adresse.AdresseRue, adresse.AdresseCP, adresse.AdresseVille);
                }

                if (DatePickerJour.SelectedDate != null && DatePickerNaissance.SelectedDate != null && (DateTime)DatePickerNaissance.SelectedDate != DateTime.MinValue)
                {
                    TextBlockAffichageAge.Content = calculerAge((DateTime)DatePickerNaissance.SelectedDate, (DateTime)DatePickerJour.SelectedDate);
                }

                Tests tests = TestsRepository.getTestsPatient(patient.PatientId);
                if (tests != null)
                {
                    OrigineDemande.Text         = tests.OrigineDemande;
                    Acuite.Text                 = tests.Acuite;
                    Orthoptie.Text              = tests.Orthoptie;
                    ReflexeVisuel.Text          = tests.Reflexe;
                    TestLateralite.Text         = tests.Lateralite;
                    ConnaissanceLateralite.Text = tests.ConnaissanceLateralite;
                    Pattes.Text                 = tests.Pattes;
                }

                var suivis = SuiviRepository.getSuivisPatient(patient.PatientId);
                if (suivis != null)
                {
                    foreach (Suivi suivi in suivis)
                    {
                        Specialiste specialiste = SpecialisteRepository.getSpecialiste(suivi.SpecialisteId);
                        creerGridSuivis(specialiste, suivi.Debut, suivi.Fin);
                    }
                }
            }
            else
            {
                DatePickerJour.SelectedDate = DateTime.Now;
            }
        }
Exemplo n.º 4
0
        private void creerGridSuivis(Specialiste _specialiste, DateTime _debut, DateTime _fin)
        {
            //On transforme la dernière ligne en plus petite
            int nbLignes = GridSuivis.RowDefinitions.Count;

            GridSuivis.RowDefinitions[nbLignes - 1].Height = new GridLength(0.4, GridUnitType.Star);

            //On définit une nouvelle ligne de la bonne hauteur
            RowDefinition nouvelleLigne = new RowDefinition();

            if (1 - nbLignes * 0.4 > 0)
            {
                nouvelleLigne.Height = new GridLength(1 - nbLignes * 0.4, GridUnitType.Star);
                //On l'ajoute à la grille
                GridSuivis.RowDefinitions.Add(nouvelleLigne);
            }

            Border border = new Border();

            border.BorderThickness = new Thickness(0);
            border.CornerRadius    = new CornerRadius(15);
            border.Background      = new SolidColorBrush(Color.FromRgb(212, 210, 234));
            border.Margin          = new Thickness(10, 5, 10, 5);

            GridSuivis.Children.Add(border);
            Grid.SetRow(border, nbLignes - 1);

            Grid nouvelleGrid = new Grid();

            border.Child = nouvelleGrid;

            //Définition des colonnes
            ColumnDefinition colonne1 = new ColumnDefinition();
            ColumnDefinition colonne2 = new ColumnDefinition();

            colonne1.Width = new GridLength(0.4, GridUnitType.Star);
            colonne2.Width = new GridLength(0.6, GridUnitType.Star);
            nouvelleGrid.ColumnDefinitions.Add(colonne1);
            nouvelleGrid.ColumnDefinitions.Add(colonne2);

            Grid affichageSpecialiste = new Grid();

            nouvelleGrid.Children.Add(affichageSpecialiste);
            Grid.SetColumn(affichageSpecialiste, 0);

            RowDefinition ligne1 = new RowDefinition();
            RowDefinition ligne2 = new RowDefinition();

            ligne1.Height = new GridLength(1, GridUnitType.Star);
            ligne2.Height = new GridLength(1, GridUnitType.Star);
            affichageSpecialiste.RowDefinitions.Add(ligne1);
            affichageSpecialiste.RowDefinitions.Add(ligne2);

            TextBlock specialite = new TextBlock();

            specialite.Text              = _specialiste.SpecialisteSpecialite;
            specialite.FontSize          = 14;
            specialite.FontFamily        = new FontFamily("Roboto");
            specialite.Foreground        = new SolidColorBrush(Color.FromRgb(66, 71, 120));
            specialite.VerticalAlignment = VerticalAlignment.Bottom;
            Thickness margin = specialite.Margin;

            margin.Left       = 20;
            margin.Top        = 5;
            specialite.Margin = margin;
            affichageSpecialiste.Children.Add(specialite);
            Grid.SetRow(specialite, 0);

            TextBlock specialiste = new TextBlock();

            specialiste.Text              = _specialiste.SpecialistePrenom + " " + _specialiste.SpecialisteNom;
            specialiste.FontSize          = 12;
            specialiste.FontFamily        = new FontFamily("Roboto Light");
            specialiste.Foreground        = new SolidColorBrush(Color.FromRgb(142, 137, 162));
            specialiste.VerticalAlignment = VerticalAlignment.Top;
            margin             = specialiste.Margin;
            margin.Left        = 20;
            specialiste.Margin = margin;
            affichageSpecialiste.Children.Add(specialiste);
            Grid.SetRow(specialiste, 1);


            Grid affichageSuivi = new Grid();

            nouvelleGrid.Children.Add(affichageSuivi);
            Grid.SetColumn(affichageSuivi, 1);

            ColumnDefinition colonneA = new ColumnDefinition();
            ColumnDefinition colonneB = new ColumnDefinition();
            ColumnDefinition colonneC = new ColumnDefinition();

            colonneA.Width = new GridLength(1, GridUnitType.Star);
            colonneB.Width = new GridLength(1, GridUnitType.Star);
            colonneC.Width = new GridLength(1, GridUnitType.Star);
            affichageSuivi.ColumnDefinitions.Add(colonneA);
            affichageSuivi.ColumnDefinitions.Add(colonneB);
            affichageSuivi.ColumnDefinitions.Add(colonneC);

            string[] mois = new string[] { "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" };

            TextBlock debut = new TextBlock();

            debut.Text                = mois[_debut.Month - 1] + " " + _debut.Year;
            debut.FontSize            = 12;
            debut.FontFamily          = new FontFamily("Roboto Light");
            debut.Foreground          = new SolidColorBrush(Color.FromRgb(66, 71, 120));
            debut.HorizontalAlignment = HorizontalAlignment.Right;
            debut.VerticalAlignment   = VerticalAlignment.Center;
            affichageSuivi.Children.Add(debut);
            Grid.SetColumn(debut, 0);

            Separator separator = new Separator();

            margin           = separator.Margin;
            margin.Left      = 15;
            margin.Right     = 15;
            separator.Margin = margin;
            affichageSuivi.Children.Add(separator);
            Grid.SetColumn(separator, 1);

            TextBlock fin = new TextBlock();

            fin.Text                = mois[_fin.Month - 1] + " " + _fin.Year;
            fin.FontSize            = 12;
            fin.FontFamily          = new FontFamily("Roboto Light");
            fin.Foreground          = new SolidColorBrush(Color.FromRgb(66, 71, 120));
            fin.HorizontalAlignment = HorizontalAlignment.Left;
            fin.VerticalAlignment   = VerticalAlignment.Center;
            affichageSuivi.Children.Add(fin);
            Grid.SetColumn(fin, 2);
        }