Exemple #1
0
 private void RetourneCompteFromCoper(CsTypeLot leTypeDuLot, CsCentre leCentreSelect)
 {
     try
     {
         #region Facture
         if (leTypeDuLot.DC == SessionObject.Enumere.Credit)
         {
             AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
             service1.RetourneListeFactureClientCompleted += (es, argss) =>
             {
                 if (argss != null && argss.Cancelled)
                 {
                     return;
                 }
                 LesFacturesClient = argss.Result;
                 if (LesFacturesClient != null && LesFacturesClient.Count != 0)
                 {
                     UcAjustementRecherche Ctrl = new UcAjustementRecherche(LesFacturesClient);
                     Ctrl.Closed += new EventHandler(galatee_OkClicked);
                     Ctrl.Show();
                 }
             };
             service1.RetourneListeFactureClientAsync(leCentreSelect.PK_ID, leCentreSelect.CODE, this.Txt_Client.Text, this.Txt_Ordre.Text);
             service1.CloseAsync();
         }
         #endregion
         #region reglement
         else
         {
             AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
             service1.RetourneListeReglementCompleted += (es, argss) =>
             {
                 if (argss != null && argss.Cancelled)
                 {
                     return;
                 }
                 LesFacturesClient = argss.Result;
                 if (LesFacturesClient != null && LesFacturesClient.Count != 0)
                 {
                     UcAjustementRecherche Ctrl = new UcAjustementRecherche(LesFacturesClient);
                     Ctrl.Closed += new EventHandler(galatee_OkClicked);
                     Ctrl.Show();
                 }
                 else
                 {
                     Message.Show(Langue.MsgFactureNonTrouve, "Recherche client");
                     return;
                 }
             };
             service1.RetourneListeReglementAsync(leCentreSelect.PK_ID, leCentreSelect.CODE, this.Txt_Client.Text, this.Txt_Ordre.Text);
             service1.CloseAsync();
             #endregion
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
        //private void btn_Rechercher_Click(object sender, RoutedEventArgs e)
        //{
        //    //Utiliser ToutLeCompteClientRecherche pour charger les facture du client
        //    ToutLeCompteClientDeOrientation = new List<CsLclient>();
        //    if (((CsTypeLot)cbo_TypeBatch.SelectedItem).DC=="D")
        //    {
        //        if (ToutLeCompteClientRecherche != null &&
        //            ToutLeCompteClientRecherche.FirstOrDefault(p=>p.CLIENT == this.Txt_Client.Text && p.NDOC == this.Txt_Ordre.Text )!= null )
        //        {
        //            if (ToutLeCompteClientRecherche.Count() > 0)
        //              foreach (var item in ToutLeCompteClientRecherche)
        //                {
        //                    CsLclient facture = new CsLclient();

        //                        //ACQUITANTERIEUR =item.ACQUIT!=null?item.ACQUIT:string.Empty,
        //                        facture.NDOC = !string.IsNullOrWhiteSpace(item.NDOC) ? item.NDOC : string.Empty;
        //                        facture.REFEM = !string.IsNullOrWhiteSpace(item.REFEM) ? item.REFEM : string.Empty;
        //                        facture.COPER = !string.IsNullOrWhiteSpace(item.COPER) ? item.COPER : string.Empty;
        //                        facture.NATURE = !string.IsNullOrWhiteSpace(item.NATURE) ? item.NATURE : string.Empty;
        //                        facture.DATECREATION = item.DATECREATION;
        //                        facture.DC = !string.IsNullOrWhiteSpace(item.DC) ? item.DC : string.Empty;
        //                        facture.MONTANT  = item.MONTANT != null ? item.MONTANT.Value : decimal.MinValue;
        //                        facture.CENTRE = item.CENTRE;
        //                        facture.CLIENT = item.CLIENT;
        //                        facture.ORDRE = item.ORDRE;
        //                    ToutLeCompteClientDeOrientation.Add(facture);
        //                }
        //            if (ToutLeCompteClientDeOrientation != null && ToutLeCompteClientDeOrientation.Count != 0)
        //            {
        //                UcAjustementRecherche Ctrl = new UcAjustementRecherche(ToutLeCompteClientDeOrientation);
        //                Ctrl.Closed += new EventHandler(galatee_OkClicked);
        //                Ctrl.Show();
        //            }
        //        }
        //        else
        //        {
        //            LoadCompteClient(true);
        //        }
        //    }
        //    else
        //    {
        //        if (ToutLeCompteClientRecherche != null)
        //        {
        //            if (ToutLeCompteClientRecherche.Count() > 0)
        //                foreach (var item in ToutLeCompteClientRecherche)
        //                {
        //                    CsLclient facture = new CsLclient();
        //                    facture.NDOC = !string.IsNullOrWhiteSpace(item.NDOC) ? item.NDOC : string.Empty;
        //                    facture.REFEM = !string.IsNullOrWhiteSpace(item.REFEM) ? item.REFEM : string.Empty;
        //                    facture.COPER = !string.IsNullOrWhiteSpace(item.COPER) ? item.COPER : string.Empty;
        //                    facture.NATURE = !string.IsNullOrWhiteSpace(item.NATURE) ? item.NATURE : string.Empty;
        //                    facture.DATECREATION = item.DATECREATION;
        //                    facture.DC = !string.IsNullOrWhiteSpace(item.DC) ? item.DC : string.Empty;
        //                    facture.MONTANT  = item.MONTANT != null ? item.MONTANT.Value : decimal.MinValue;
        //                    facture.CENTRE = item.CENTRE;
        //                    facture.CLIENT = item.CLIENT;
        //                    facture.ORDRE = item.ORDRE;
        //                    ToutLeCompteClientDeOrientation.Add(facture);
        //                }
        //            if (ToutLeCompteClientDeOrientation != null && ToutLeCompteClientDeOrientation.Count != 0)
        //            {
        //                UcAjustementRecherche Ctrl = new UcAjustementRecherche(ToutLeCompteClientDeOrientation);
        //                Ctrl.Closed += new EventHandler(galatee_OkClicked);
        //                Ctrl.Show();
        //            }
        //        }
        //        else
        //        {
        //            LoadCompteClient(true);
        //        }
        //    }

        //}
        void galatee_OkClicked(object sender, EventArgs e)
        {
            UcAjustementRecherche ctrs = sender as UcAjustementRecherche;

            _leClientLot = new CsLclient();
            _leClientLot = ctrs.MyClientDetailLot;
            if (_leClientLot != null)
            {
                this.Txt_Client.Text = _leClientLot.CLIENT;
                this.Txt_Ordre.Text  = _leClientLot.ORDRE;
                this.Txt_refem.Text  = _leClientLot.REFEM;
                this.Txt_Ndoc.Text   = _leClientLot.NDOC;
            }
        }