コード例 #1
0
 private void openDirectory_Click(object sender, RoutedEventArgs e)
 {
     if (DatagGrid.SelectedIndex != -1)
     {
         DataofLettre dfg = (DataofLettre)(DatagGrid.SelectedItem);
         for (int i = 0; i < table.Rows.Count; i++)
         {
             DataRow row = table.Rows[i];
             if (row[0].ToString() == dfg.numero.ToString())
             {
                 string path = row[6].ToString();
                 path = path.Remove(path.LastIndexOf(@"\"));
                 try
                 {
                     System.Diagnostics.Process process = new System.Diagnostics.Process();
                     process.StartInfo.FileName = path;
                     process.Start();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message.ToString());
                 }
             }
         }
     }
 }
コード例 #2
0
 private void ouvr_Click(object sender, RoutedEventArgs e)
 {
     if (DatagGrid.SelectedIndex != -1)
     {
         DataofLettre dfg = (DataofLettre)(DatagGrid.SelectedItem);
         for (int i = 0; i < table.Rows.Count; i++)
         {
             DataRow row = table.Rows[i];
             if (row[0].ToString() == dfg.numero.ToString())
             {
                 string path = row[6].ToString();
                 try
                 {
                     pdfViewer.Navigate(new Uri(path));
                     Visualisation.Visibility = Visibility.Visible;
                     Affichage2.Visibility    = Visibility.Hidden;
                     //System.Diagnostics.Process process = new System.Diagnostics.Process();
                     //process.StartInfo.FileName = path;
                     //process.Start();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message.ToString());
                 }
             }
         }
     }
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
        private void loadOrien()
        {
            table = new DataTable();
            DataGridTextColumn g0 = new DataGridTextColumn(); g0.Binding = new Binding("numero"); g0.Header = ""; g0.MaxWidth = 0;
            DataGridTextColumn g1 = new DataGridTextColumn(); g1.Binding = new Binding("nom"); g1.Header = "Nom medcin"; g1.Width = 133;
            DataGridTextColumn g3 = new DataGridTextColumn(); g3.Binding = new Binding("spec"); g3.Header = "Spécialité"; g3.Width = 133;

            DatagGrid.Columns.Add(g0); DatagGrid.Columns.Add(g1);
            DatagGrid.Columns.Add(g3);
            DatagGrid.Columns[0].DisplayIndex = 3;
            ConnexionBDD Datab = new ConnexionBDD();

            Datab.connecter();
            String        Command = "Select * from Lettre where Id_DM=" + IDDOSS;
            SqlCommand    Macmd   = new SqlCommand(Command, Datab.cnx);
            SqlDataReader dr      = Macmd.ExecuteReader();

            while (dr.Read())
            {
                DataofLettre ordodata = new DataofLettre();
                ordodata.numero = int.Parse(dr[0].ToString());
                ordodata.nom    = dr[2].ToString();
                ordodata.spec   = dr[3].ToString();
                ordodata.adr    = dr[4].ToString();
                ordodata.cmnt   = dr[5].ToString();
                DatagGrid.Items.Add(ordodata);
            }
            dr.Close();
            SqlDataAdapter Daptr = new SqlDataAdapter(Macmd);

            Daptr.Fill(table);
        }
コード例 #5
0
 private void Supprimer_Click_1(object sender, RoutedEventArgs e)
 {
     if (DatagGrid.SelectedIndex >= 0)
     {
         DataofLettre dataa = (DataofLettre)(DatagGrid.SelectedItem);
         ConnexionBDD Datab = new ConnexionBDD();
         Datab.connecter();
         String     Command = "DELETE FROM Lettre where Id_Lettre=" + dataa.numero;
         SqlCommand Macmd   = new SqlCommand(Command, Datab.cnx);
         Macmd.ExecuteNonQuery();
         Datab.deconnecter();
         DatagGrid.Items.Remove(dataa);
     }
 }