Пример #1
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.txt_MontantPayes.Text) &&
         !string.IsNullOrEmpty(this.Txt_TotalTTC.Text) &&
         decimal.Parse(this.txt_MontantPayes.Text) > decimal.Parse(this.Txt_TotalTTC.Text))
     {
         var w = new MessageBoxControl.MessageBoxChildWindow(Langue.LibelleModule, Langue.Msg_MontantPayeSuperieur + "  " + this.Txt_TotalTTC.Text, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
         w.OnMessageBoxClosed += (_, result) =>
         {
         };
         w.Show();
     }
     else
     {
         if (!string.IsNullOrEmpty(this.txt_MontantPayes.Text) && VerifieMontantPaye())
         {
             List <CsLclient> _LesFactureFactureInit = (List <CsLclient>) this.LsvFacture.ItemsSource;
             List <CsLclient> _LesFactureASolde      = SoldeFacture(_LesFactureFactureInit, decimal.Parse(this.txt_MontantPayes.Text));
             if (!_LesFactureASolde.First().ISDECAISSEMENT)
             {
                 UcValideEncaissement UcValider = new UcValideEncaissement(_LesFactureASolde, SessionObject.Enumere.OperationDeCaisseEncaissementDevis);
                 UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
                 UcValider.Show();
             }
             if (_LesFactureASolde.First().ISDECAISSEMENT)
             {
                 UcValideEncaissement UcValider = new UcValideEncaissement(_LesFactureASolde, SessionObject.Enumere.OperationDeCaisseEncaissementDevis, "OUI");
                 UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
                 UcValider.Show();
             }
         }
     }
 }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <CsLclient> _Lstfacture = GetFactureOD();

                UcValideEncaissement UcValider = new UcValideEncaissement(_Lstfacture, SessionObject.Enumere.ActionRecuEditionNormale);
                UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
                UcValider.Show(); // UcValider.ShowDialog("Payment validation", INOVA.ISF.WINDOWS.FORMS.ExecMode.Default);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                //MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.DialogResult = true;
        }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            CsLclient _Lafacture = new CsLclient();

            _Lafacture.CENTRE = LeDevis.CENTRE;
            _Lafacture.CLIENT = this.Txt_NumClient.Text;
            //_Lafacture.ORDRE = "//";
            _Lafacture.ORDRE        = LeDevis.ORDRE;
            _Lafacture.MATRICULE    = UserConnecte.matricule;
            _Lafacture.CAISSE       = UserConnecte.numcaisse;
            _Lafacture.NDOC         = "//////";
            _Lafacture.REFEM        = DateTime.Today.Year.ToString() + DateTime.Today.Month.ToString("00");
            _Lafacture.NUMDEVIS     = LeDevis.NUMDEVIS;
            _Lafacture.COPER        = SessionObject.Enumere.CoperOdQPA;
            _Lafacture.Selectionner = true;
            _Lafacture.DC           = SessionObject.Enumere.Debit;
            _Lafacture.SOLDEFACTURE = Convert.ToDecimal(this.Txt_MontantTotal.Text);
            _Lafacture.NOM          = this.Txt_NomClient.Text;
            //_Lafacture.FK_IDETAPEDEVIS = LeDevis.FK_IDETAPEDEVIS;
            //_Lafacture.FK_IDPRODUIT = LeDevis.FK_IDPRODUIT;
            //_Lafacture.FK_IDTYPEDEVIS = LeDevis.FK_IDTYPEDEVIS;
            _Lafacture.FK_IDCENTRE = LeDevis.FK_IDCENTRE;
            //_Lafacture.EXIGIBILITE = LeDevis.EXIGIBILITE;
            List <CsLclient> _ListeDeFacture = new List <CsLclient>();

            _ListeDeFacture.Add(_Lafacture);


            UcValideEncaissement UcValider = new UcValideEncaissement(_ListeDeFacture, SessionObject.Enumere.OperationDeCaisseEncaissementDevis);

            UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
            UcValider.Show();
            //if (UcValider.ValidationEditionfacture == true)
            //{
            //    CaisseServiceClient service1 = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint(this));
            //    service1.MiseAJourDevisCompleted += (send, es) =>
            //    {

            //    };
            //    service1.MiseAJourDevisAsync(this.Txt_NumDevis.Text, this.Txt_Caissier.Text);
            //    service1.CloseAsync();

            //}
            this.DialogResult = true;
        }