private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (cbo_typedoc.SelectedItem != null)
     {
         // Create an instance of the open file dialog box.
         var openDialog = new OpenFileDialog();
         // Set filter options and filter index.
         openDialog.Filter =
             "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png";
         openDialog.FilterIndex = 1;
         openDialog.Multiselect = false;
         // Call the ShowDialog method to show the dialog box.
         bool?userClickedOk = openDialog.ShowDialog();
         // Process input if the user clicked OK.
         if (userClickedOk == true)
         {
             if (openDialog.Files != null && openDialog.Files.Count() > 0 && openDialog.File != null)
             {
                 FileStream stream       = openDialog.File.OpenRead();
                 var        memoryStream = new MemoryStream();
                 stream.CopyTo(memoryStream);
                 image              = memoryStream.GetBuffer();
                 formScanne         = new UcImageScanne(memoryStream, SessionObject.ExecMode.Creation);
                 formScanne.Closed += new EventHandler(GetInformationFromChildWindowImagePreuve);
                 formScanne.Show();
             }
         }
     }
 }
        private void hyperlinkButtonPropScannee__Click(object sender, RoutedEventArgs e)
        {
            MemoryStream memoryStream  = new MemoryStream(((HyperlinkButton)sender).Tag as byte[]);
            var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);

            ucImageScanne.Show();
        }
Esempio n. 3
0
        private void OuvrirPieceJointe_Click(object sender, RoutedEventArgs e)
        {
            if (dgListePiece.SelectedItem != null)
            {
                ObjDOCUMENTSCANNE selectObj = (ObjDOCUMENTSCANNE)this.dgListePiece.SelectedItem;
                if (selectObj.CONTENU != null)
                {
                    MemoryStream memoryStream  = new MemoryStream(selectObj.CONTENU);
                    var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
                    ucImageScanne.Show();
                }
                else
                {
                    Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                    service.DocumentScanneContenuCompleted += (s, args) =>
                    {
                        if ((args != null && args.Cancelled) || (args.Error != null))
                        {
                            return;
                        }

                        MemoryStream memoryStream  = new MemoryStream(args.Result.CONTENU);
                        var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
                        ucImageScanne.Show();
                    };
                    service.DocumentScanneContenuAsync(selectObj);
                    service.CloseAsync();
                }
            }
        }
Esempio n. 4
0
 private void hyperlinkButtonPropScannee_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (hyperlinkButtonPropScannee.Tag != null)
         {
             var mBoxControl = new MessageBoxControl.MessageBoxChildWindow("Devis", "Voulez vous supprimer le manuscrit scanné ? ", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
             mBoxControl.OnMessageBoxClosed += (_, result) =>
             {
                 if (mBoxControl.Result == MessageBoxResult.OK)
                 {
                     this.hyperlinkButtonPropScannee.Tag = null;
                 }
                 else
                 {
                     MemoryStream memoryStream  = new MemoryStream(hyperlinkButtonPropScannee.Tag as byte[]);
                     var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
                     //var ucImageScanne = new UcImageScanne(hyperlinkButtonPropScannee.Tag as byte[], SessionObject.ExecMode.Modification);
                     ucImageScanne.Show();
                 }
                 //ActiverEnregistrerOuTransmettre();
             };
             mBoxControl.Show();
         }
         else
         {
             // Create an instance of the open file dialog box.
             var openDialog = new OpenFileDialog();
             // Set filter options and filter index.
             openDialog.Filter =
                 "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png";
             openDialog.FilterIndex = 1;
             openDialog.Multiselect = false;
             // Call the ShowDialog method to show the dialog box.
             bool?userClickedOk = openDialog.ShowDialog();
             // Process input if the user clicked OK.
             if (userClickedOk == true)
             {
                 if (openDialog.Files != null && openDialog.Files.Count() > 0 && openDialog.File != null)
                 {
                     FileStream stream       = openDialog.File.OpenRead();
                     var        memoryStream = new MemoryStream();
                     stream.CopyTo(memoryStream);
                     hyperlinkButtonPropScannee.Tag = memoryStream.GetBuffer();
                     formScanne         = new UcImageScanne(memoryStream, SessionObject.ExecMode.Creation);
                     formScanne.Closed += new EventHandler(GetInformationFromChildWindowImagePreuve);
                     formScanne.Show();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Galatee.Silverlight.Resources.Devis.Languages.txtDevis);
     }
 }
 private void hyperlinkButtonPropScannee___Click(object sender, RoutedEventArgs e)
 {
     if (((HyperlinkButton)sender).Tag != null)
     {
         MemoryStream memoryStream  = new MemoryStream(((HyperlinkButton)sender).Tag as byte[]);
         var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
         ucImageScanne.Show();
     }
     else
     {
         Message.ShowInformation("Aucune image associer à cette ligne", "Information");
     }
 }
Esempio n. 6
0
 private void hyperlinkParticipation___Click(object sender, RoutedEventArgs e)
 {
     if (dgListeFraixParicipation.SelectedItem != null)
     {
         ServiceAccueil.CsFraixParticipation selectObj = (ServiceAccueil.CsFraixParticipation) this.dgListeFraixParicipation.SelectedItem;
         if (selectObj.PREUVE != null)
         {
             MemoryStream memoryStream  = new MemoryStream(selectObj.PREUVE);
             var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
             ucImageScanne.Show();
         }
     }
 }