private void Button_Click2(object sender, RoutedEventArgs e)
 {
     if (verif())
     {
         String nom    = this.nom_med.Text;
         String adr    = this.adr.Text;
         String spec   = this.Spec.Text;
         String com    = this.com.Text;
         Lettre lettre = new Lettre(nom, spec, adr, com, IDDOSS);
         lettre.Insert_Nvl_Lettre();
         DataofLettre ordodata = new DataofLettre();
         ordodata.numero = lettre.Get_id();
         ordodata.nom    = nom;
         ordodata.spec   = spec;
         ordodata.adr    = adr;
         ordodata.cmnt   = com;
         DatagGrid.Items.Add(ordodata);
         string     path = ""; DateTime dat = new DateTime();
         Misenforme mm = new Misenforme();
         mm.get_Patient(IDPAT, ref path, ref dat);
         SaveFileDialog save = new SaveFileDialog();
         save.Filter = "Fichiers PDF|*.pdf";
         string documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
         path = documents + save.InitialDirectory + @"\CureIt\" + path + "_" + IDPAT + @"\Lettres d'orientation";
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         save.InitialDirectory = path;
         save.FileName         = "Lettre" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
         if (save.ShowDialog() == true)
         {
             string           nomdoc = save.FileName;
             MiseEnFormLettre forme  = new MiseEnFormLettre(IDDOSS, IDMED);
             Document         doc    = forme.CreateDoc(save.FileName);
             doc.Open();
             doc = forme.Remplir_doc(doc, nom, adr, spec, com, IDMED, IDDOSS);
             doc.Close();
             ConnexionBDD Datab = new ConnexionBDD();
             Datab.connecter();
             string     filename = save.FileName.Replace("'", "''");
             String     Command  = @"update Lettre set Fichier='" + filename + "' where Id_Lettre=" + lettre.Get_id();
             SqlCommand Macmd    = new SqlCommand(Command, Datab.cnx);
             Macmd.ExecuteNonQuery();
             //App.iff.support_fonction.NavigationService.Navigate(new Page_Lettre_Orientation(IDDOSS, ADMIN, IDMED, true,IDPAT));
             //this.AffichageStack.Visibility = Visibility.Hidden;
             //this.Affichage2.Visibility = Visibility.Visible;
         }
         Stackbienajouté.Visibility    = System.Windows.Visibility.Hidden;
         RecStackbienajouté.Visibility = System.Windows.Visibility.Hidden;
         this.vider();
         grdlettre.IsEnabled = true;
     }
     else
     {
         Stacknonremplett.Visibility    = System.Windows.Visibility.Visible;
         RecStacknonremplett.Visibility = System.Windows.Visibility.Visible;
         grdlettre.IsEnabled            = false;
     }
 }
示例#2
0
 private void Terminer_Click(object sender, RoutedEventArgs e)
 {
     if (nbre_medic > 0)
     {
         //
         string     path = ""; DateTime dat = new DateTime();
         Misenforme mm = new Misenforme();
         mm.get_Patient(this.idPat, ref path, ref dat);
         SaveFileDialog save = new SaveFileDialog();
         save.Filter = "Fichiers Word|*.docx";
         string documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
         path = documents + save.InitialDirectory + @"\CureIt\" + path + "_" + this.idPat + @"\Ordonnances";
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         save.InitialDirectory = path;
         save.FileName         = "Ordonnance" + ordonn.Get_Ordo();
         if (save.ShowDialog() == true)
         {
             string     sav = save.FileName;
             Misenforme mis = new Misenforme();
             mis.CreateWordDocument(sav, this.idMed, this.idPat, this.idOrdo);
             ConnexionBDD Datab = new ConnexionBDD();
             Datab.connecter();
             string     filename = save.FileName.Replace("'", "''");
             String     Command  = "update Ordonnance set Fichier_Ordo='" + filename + "' where Id_Ordonnance=" + ordonn.Get_Ordo();
             SqlCommand Macmd    = new SqlCommand(Command, Datab.cnx);
             Macmd.ExecuteNonQuery();
         }
         //
         vider();
         DataofOrdo ordodata = new DataofOrdo();
         ordodata.numero = ordonn.Get_Ordo();
         ordodata.date   = DateTime.Now;
         DatagGrid.Items.Add(ordodata);
         var dataa = new DataTable();
         Affich_Medic_Ajouté.ItemsSource = dataa.DefaultView;
         nbre_medic = 0;
         App.iff.support_fonction.NavigationService.Navigate(new Page_Ordonnance(idPat, idMed, IDFC, IDDOSS, ADMIN, true));
         this.AffichageStack.Visibility = Visibility.Hidden;
         this.Affichage2.Visibility     = Visibility.Visible;
         //for (int i = Affich_Medic_Ajouté.Items.Count - 1; i >= 0; i--) Affich_Medic_Ajouté.Items.RemoveAt(i);
         //ffich_Medic_Ajouté.Items.Clear();
     }
 }
示例#3
0
        private void Imprimer_Click(object sender, RoutedEventArgs e)
        {
            string typeExa = this.TypeExamen.Text;
            string cs      = this.cause.Text;

            if (typeExa != "" && cs != "")
            {
                // *****************************  USING iTextSharp  ************************************
                string     path = ""; DateTime dat = new DateTime();
                Misenforme mm = new Misenforme();
                mm.get_Patient(IDPAT, ref path, ref dat);
                SaveFileDialog save = new SaveFileDialog();
                save.Filter = "Fichiers PDF|*.pdf";
                string documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                path = documents + save.InitialDirectory + @"\CureIt\" + path + "_" + IDPAT + @"\Examens complémentaires";
                MessageBox.Show(path);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                save.InitialDirectory = path;
                save.FileName         = "Fiche" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
                if (save.ShowDialog() == true)
                {
                    MiseEnFormLettre form   = new MiseEnFormLettre(IDDOSS, IDMED);
                    String           nomdoc = save.FileName;

                    Document doc = form.CreateDoc(nomdoc);
                    doc.Open();
                    doc = form.Remplir_Exam_comp(doc, IDMED, IDDOSS, typeExa, cs);
                    doc.Close();
                    System.Diagnostics.Process.Start(nomdoc);
                }
                TypeExamen.Text = null;
                cause.Text      = null;
            }
            else
            {
                //Case vide
            }
        }
示例#4
0
 private void Imprimer_Click(object sender, RoutedEventArgs e)
 {
     if (nbre_medic > 0)
     {
         SaveFileDialog save = new SaveFileDialog();
         save.Filter   = "Fichiers Word|*.docx";
         save.FileName = "Ordonnance" + ordonn.Get_Ordo();
         if (save.ShowDialog() == true)
         {
             string     sav = save.FileName;
             Misenforme mis = new Misenforme();
             mis.CreateWordDocument(sav, this.idMed, this.idPat, this.idOrdo);
             ConnexionBDD Datab = new ConnexionBDD();
             Datab.connecter();
             String     Command = "update Ordonnance set Fichier_Ordo='" + save.FileName + "' where Id_Ordonnance=" + ordonn.Get_Ordo();
             SqlCommand Macmd   = new SqlCommand(Command, Datab.cnx);
             Macmd.ExecuteNonQuery();
         }
     }
     else
     {
         MessageBox.Show("Vide");
     }
 }
示例#5
0
 private void Button_Click2(object sender, RoutedEventArgs e)
 {
     if (verif())
     {
         int i = int.Parse(this.nb.Text);
         if (this.Nbre_jour.Text == "Semaine")
         {
             i = i * 7;
         }
         if (this.Nbre_jour.Text == "Mois")
         {
             i = i * 30;
         }
         if (this.Nbre_jour.Text == "Ans")
         {
             i = i * 365;
         }
         Certaficat_Médical certi = new Certaficat_Médical(i, this.comment.Text);
         certi.Set_Id_fc(IDFC);
         certi.insert_nvl_certaficat_medic();
         DataofCert ordodata = new DataofCert();
         ordodata.numero      = certi.Get_Id_Cert();
         ordodata.nb          = i;
         ordodata.commentaire = this.comment.Text;
         DatagGrid.Items.Add(ordodata);
         //FILEDIALOG
         string     path = ""; DateTime dat = new DateTime();
         Misenforme mm = new Misenforme();
         mm.get_Patient(this.IDPAT, ref path, ref dat);
         SaveFileDialog save = new SaveFileDialog();
         save.Filter = "Fichiers PDF|*.pdf";
         string documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
         path = documents + save.InitialDirectory + @"\CureIt\" + path + "_" + this.IDPAT + @"\Certificiats";
         MessageBox.Show(path);
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         save.InitialDirectory = path;
         save.FileName         = "Certificat" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
         if (save.ShowDialog() == true)
         {
             string           nomdoc = save.FileName;
             MiseEnFormLettre forme  = new MiseEnFormLettre(IDDOSS, IDMED);
             MiseEnFormCert   form   = new MiseEnFormCert(IDDOSS, IDMED);
             Document         doc    = forme.CreateDoc(nomdoc);
             doc.Open();
             doc = form.Remplir_doc(doc, this.comment.Text, int.Parse(this.nb.Text), this.Nbre_jour.Text, IDMED, IDDOSS);
             doc.Close();
             ConnexionBDD Datab = new ConnexionBDD();
             Datab.connecter();
             string     filename = save.FileName.Replace("'", "''");
             String     Command  = @"update Certeficat_medical set Fichier='" + filename + "' where Id_Cert_Med=" + certi.Get_Id_Cert();
             SqlCommand Macmd    = new SqlCommand(Command, Datab.cnx);
             Macmd.ExecuteNonQuery();
             App.iff.support_fonction.NavigationService.Navigate(new Page_Certificat(IDFC, IDDOSS, IDMED, ADMIN, true, IDPAT));
             this.AffichageStack.Visibility = Visibility.Hidden;
             this.Affichage2.Visibility     = Visibility.Visible;
         }
         StackcertbienAjouer.Visibility    = System.Windows.Visibility.Visible;
         RecStackcertbienAjouer.Visibility = System.Windows.Visibility.Visible;
         grdcert.IsEnabled = false;
     }
     else
     {
         Stacknonrempcert.Visibility    = System.Windows.Visibility.Visible;
         RecStacknonrempcert.Visibility = System.Windows.Visibility.Visible;
         grdcert.IsEnabled = false;
     }
 }