private void hyperlinkButtonPropScannee__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();
                }
            }
        }
Beispiel #2
0
        private void btn_editer_Click_1(object sender, RoutedEventArgs e)
        {
            if (dgListePiece.SelectedItem != null)
            {
                if (btn_editer.Content.ToString().Trim() == "Editer".Trim())
                {
                    txt_refClient.Text = ((ObjDOCUMENTSCANNE)dgListePiece.SelectedItem).NOMDOCUMENT;
                    txt_refClient.Tag  = ((ObjDOCUMENTSCANNE)dgListePiece.SelectedItem);
                    //cbo_typedoc.SelectedItem =LstTypeDocument.FirstOrDefault(t=>t.PK_ID== ((ObjDOCUMENTSCANNE)dgListePiece.SelectedItem).FK_TYPEDOCUMENT);
                    hyperlinkButtonPropScannee.Tag = ((ObjDOCUMENTSCANNE)dgListePiece.SelectedItem).CONTENU;

                    btn_editer.Content = "Mise a Jour";
                }
                else
                {
                    ObjDOCUMENTSCANNE Fraix = ((ObjDOCUMENTSCANNE)txt_refClient.Tag);
                    if (Fraix != null)
                    {
                        int index = this.LstPiece.IndexOf(Fraix);

                        Fraix.NOMDOCUMENT = txt_refClient.Text;
                        Fraix.CONTENU     = hyperlinkButtonPropScannee.Tag as byte[];
                        //Fraix.FK_TYPEDOCUMENT = ((CsTypeDOCUMENTSCANNE)cbo_typedoc.SelectedItem).PK_ID;
                        this.LstPiece[index]          = Fraix;
                        this.dgListePiece.ItemsSource = this.LstPiece;
                        btn_editer.Content            = "Editer".Trim();
                        txt_refClient.Tag             = null;
                    }
                }
            }
        }
Beispiel #3
0
        private ObjDOCUMENTSCANNE SaveFile(byte[] pStream, int pTypeDocument, ObjDOCUMENTSCANNE pDocumentScane)
        {
            try
            {
                //Récupération du contenu.
                if (pDocumentScane == null)
                {
                    pDocumentScane = new ObjDOCUMENTSCANNE {
                        CONTENU = pStream, PK_ID = Guid.NewGuid(), DATECREATION = DateTime.Now, USERCREATION = UserConnecte.matricule
                    };
                    pDocumentScane.OriginalPK_ID = pDocumentScane.PK_ID;
                    pDocumentScane.ISNEW         = true;
                    if (laDetailDemande.LaDemande != null)
                    {
                        laDetailDemande.LaDemande.FICHIERJOINT = pDocumentScane.PK_ID;
                    }
                }
                else
                {
                    pDocumentScane.CONTENU = pStream;
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Galatee.Silverlight.Resources.Devis.Languages.txtDevis);
            }

            return(pDocumentScane);
        }
Beispiel #4
0
 private void RetourneObjectScan(CsDemandeBase laDemande)
 {
     try
     {
         AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         service.ReturneObjetScanCompleted += (s, args) =>
         {
             if (args != null && args.Cancelled)
             {
                 return;
             }
             leObjectScan = args.Result;
             if (leObjectScan != null)
             {
                 this.lnkLetter.Content       = Langue.msgVoirPiecejointe;
                 this.lnkLetter.Tag           = leObjectScan.CONTENU;
                 this.btn_Supprime.Visibility = System.Windows.Visibility.Visible;
                 this.btn_Modifier.Visibility = System.Windows.Visibility.Visible;
             }
         };
         service.ReturneObjetScanAsync(laDemande);
         service.CloseAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
        private void  EnregisterInfo(CsDemande _LaDemande)
        {
            _LaDemande.Branchement.NUMDEM        = this.Txt_NumDemande.Text;
            _LaDemande.Branchement.ADRESSERESEAU = this.Txt_NumDemande.Text;
            _LaDemande.Branchement.DIAMBRT       = string.IsNullOrEmpty(this.Txt_CodeDiametre.Text) ? null : this.Txt_CodeDiametre.Text;
            _LaDemande.Branchement.LONGBRT       = string.IsNullOrEmpty(this.Txt_LongueurBrt.Text) ? 0 : int.Parse(this.Txt_LongueurBrt.Text);
            _LaDemande.Branchement.NBPOINT       = string.IsNullOrEmpty(this.Txt_NombrePoint.Text) ? 0 : int.Parse(this.Txt_NombrePoint.Text);
            _LaDemande.Branchement.RESEAU        = string.IsNullOrEmpty(this.Txt_Reseau.Text) ? null : this.Txt_Reseau.Text;
            _LaDemande.Branchement.LONGITUDE     = string.IsNullOrEmpty(this.Txt_Longitude.Text) ? null : this.Txt_Longitude.Text;
            _LaDemande.Branchement.LATITUDE      = string.IsNullOrEmpty(this.Txt_Latitude.Text) ? null : this.Txt_Latitude.Text;
            if (string.IsNullOrEmpty(this.Txt_DateRacordement.Text))
            {
                _LaDemande.Branchement.DRAC = DateTime.Parse(this.Txt_DateRacordement.Text);
            }
            _LaDemande.Branchement.NATBRT = string.IsNullOrEmpty(this.Txt_CodeMateriel.Text) ? null : this.Txt_CodeMateriel.Text;

            _LaDemande.LaDemande.NUMDEM           = this.Txt_NumDemande.Text;
            _LaDemande.LaDemande.ORDRE            = this.Txt_Ordre.Text;
            _LaDemande.LaDemande.STATUT           = SessionObject.Enumere.DemandeStatusEnAttente;
            _LaDemande.LaDemande.TYPEDEMANDE      = TypeDemande;
            _LaDemande.LaDemande.CLIENT           = BranchementClientRecherche.CLIENT;
            _LaDemande.LaDemande.USERCREATION     = UserConnecte.matricule;
            _LaDemande.LaDemande.USERMODIFICATION = UserConnecte.matricule;
            _LaDemande.LaDemande.DATECREATION     = System.DateTime.Now;
            _LaDemande.LaDemande.DATEMODIFICATION = System.DateTime.Now;
            if (lnkLetter.Tag != null)
            {
                leDoc = SaveFile((byte[])lnkLetter.Tag, 1, null);
                //_Lademande.LeDocumentScanne = leDoc;
            }
        }
Beispiel #6
0
 public static bool DeleteDocumentScanne(galadbEntities pCommand, ObjDOCUMENTSCANNE entity)
 {
     try
     {
         return(Entities.DeleteEntity <Galatee.Entity.Model.DOCUMENTSCANNE>(Entities.ConvertObject <Galatee.Entity.Model.DOCUMENTSCANNE, ObjDOCUMENTSCANNE>(entity), pCommand));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Êtes-vous sûr de vouloir supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);
     messageBox.OnMessageBoxClosed += (_, result) =>
     {
         if (messageBox.Result == MessageBoxResult.OK)
         {
             ObjDOCUMENTSCANNE Fraix = (ObjDOCUMENTSCANNE)dgListePiece.SelectedItem;
             this.LstPiece.Remove(Fraix);
             this.dgListePiece.ItemsSource = this.LstPiece;
         }
         else
         {
             return;
         }
     };
     messageBox.Show();
 }
        //ZEG 28/09/2017
        private void SupprimerPieceJointe(ObjDOCUMENTSCANNE piece)
        {
            Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
            service.SupprimerPieceJointeCompleted += (s, args) =>
            {
                if ((args != null && args.Cancelled) || (args.Error != null))
                {
                    return;
                }

                if (args.Result == true)
                {
                    Message.Show("Suppression réussie...", "Pièce jointe");
                }
            };
            service.SupprimerPieceJointeAsync(piece);
            service.CloseAsync();
        }
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Êtes-vous sûr de vouloir supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);

            messageBox.OnMessageBoxClosed += (_, result) =>
            {
                if (messageBox.Result == MessageBoxResult.OK)
                {
                    ObjDOCUMENTSCANNE Fraix = (ObjDOCUMENTSCANNE)dgListePiece.SelectedItem;
                    Fraix.ISTOREMOVE = true;
                    this.dgListePiece.ItemsSource = null;
                    this.dgListePiece.ItemsSource = this.LstPiece.Where(u => u.ISTOREMOVE != true).ToList();

                    //ZEG 28/09/2017
                    this.SupprimerPieceJointe(Fraix);
                }
                else
                {
                    return;
                }
            };
            messageBox.Show();
        }