Example #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;
     }
 }
        private void cbo_TypeBatch_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CsTypeLot _LeTypeLotSelect = (CsTypeLot)this.cbo_TypeBatch.SelectedItem;

            if (_LeTypeLotSelect != null)
            {
                this.Txt_CodeControle.Text = _LeTypeLotSelect.LIBELLECODECONTROLE;
            }
        }
Example #3
0
 private void btn_Rechercher_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         CsCentre  leCentreSelect = (CsCentre)this.Cbo_Centre.SelectedItem;
         CsTypeLot leTypeSelect   = (CsTypeLot)this.cbo_TypeBatch.SelectedItem;
         RetourneCompteFromCoper(leTypeSelect, leCentreSelect);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void cbo_UpdateTypeBatchDeb_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     LeTypeSelect   = (CsTypeLot)this.cbo_UpdateTypeBatchDeb.SelectedItem;
     LeCentreSelect = (CsCentre )this.Cbo_UpdateOrigineDeb.SelectedItem;
     ChargerCompteClient(LeCentreSelect.CODE, LeTypeSelect.CODE);
 }
Example #5
0
        private void RemplireDeuxiemeOnglet(bool IsLotExist)
        {
            try
            {
                decimal?MontantTotal = 0;
                if (IsLotExist)
                {
                    this.Txt_Origine.Text           = LeLot.ORIGINE + "        " + LeLot.MOISCOMPTABLE + "         " + LeLot.TYPELOT;
                    this.Txt_Numlot2.Text           = LeLot.NUMEROLOT;
                    this.Txt_BatchDate.Text         = (LeLot.DATECREATION != null) ? LeLot.DATECREATION.ToString() :  System.DateTime.Now.ToShortDateString();
                    this.Txt_NombreClientBatch.Text = "0";
                    if (LeDetail != null && LeDetail.Count != 0)
                    {
                        foreach (CsDetailLot item in LeDetail)
                        {
                            MontantTotal  = MontantTotal + item.MONTANT;
                            item.IsACTION = SessionObject.Enumere.IsUpdate;
                        }
                        this.Txt_BatchAmount.Text       = LeLot.MONTANT.ToString();
                        this.Txt_MontantOnglet1.Text    = MontantTotal.ToString();
                        this.Txt_MontantCourant.Text    = MontantTotal.ToString();
                        this.Txt_NombreClientBatch.Text = LeDetail.Count.ToString();
                        Dtg_ListeDetail.ItemsSource     = null;
                        Dtg_ListeDetail.ItemsSource     = LeDetail;
                    }
                    LeLot.STATUS = "0";
                }
                else
                {
                    string _Origine = string.Empty;
                    if (this.Cbo_Origine.SelectedItem != null)
                    {
                        _Origine = ((CsCentre)this.Cbo_Origine.SelectedItem).CODE;
                    }

                    string    _NumeroLot  = this.Txt_NumeroBatch.Text;
                    string    _TypeLot    = string.Empty;
                    CsTypeLot leLotSelect = new CsTypeLot();
                    if (this.cbo_TypeBatch.SelectedItem != null)
                    {
                        leLotSelect = ((CsTypeLot)this.cbo_TypeBatch.SelectedItem);
                    }

                    this.Txt_Origine.Text = (string.IsNullOrEmpty(_Origine) ? string.Empty : _Origine) + "        " +
                                            (string.IsNullOrEmpty(this.Cbo_MoisComptable.SelectedValue.ToString()) ? string.Empty : this.Cbo_MoisComptable.SelectedValue.ToString()) + "        " +
                                            (string.IsNullOrEmpty(_TypeLot) ? string.Empty : _TypeLot);

                    this.Txt_Numlot2.Text     = string.IsNullOrEmpty(this.Txt_NumeroBatch.Text) ? string.Empty : this.Txt_NumeroBatch.Text;
                    this.Txt_BatchAmount.Text = "0";
                    this.Txt_BatchDate.Text   = string.IsNullOrEmpty(this.dtp_DateCreationLot.Text) ? string.Empty : dtp_DateCreationLot.Text;

                    string _LeMoisCpt = string.Empty;
                    if (Cbo_MoisComptable.SelectedItem != null)
                    {
                        _LeMoisCpt = Cbo_MoisComptable.SelectedValue.ToString();
                    }

                    LeLot                  = new CsLotCompteClient();
                    LeLot.TYPELOT          = leLotSelect.CODE;
                    LeLot.DC               = leLotSelect.DC;
                    LeLot.NUMEROLOT        = _NumeroLot;
                    LeLot.ORIGINE          = _Origine;
                    LeLot.DATECREATION     = System.DateTime.Now;
                    LeLot.MOISCOMPTABLE    = _LeMoisCpt;
                    LeLot.MONTANT          = 0;
                    LeLot.STATUS           = "0";
                    LeLot.IDLOT            = int.Parse((MaxIdLot + 1).ToString());
                    LeLot.USERCREATION     = UserConnecte.matricule;
                    LeLot.USERMODIFICATION = UserConnecte.matricule;
                    LeLot.DATECREATION     = System.DateTime.Now.Date;
                    LeLot.DATEMODIFICATION = System.DateTime.Now.Date;
                }
                this.Txt_Coper.Text              = LeLot.TYPELOT.ToString().PadLeft(3, '0');
                this.Txt_Type.Text               = Natgen != null?(!string.IsNullOrWhiteSpace(Natgen.NATURE)?Natgen.NATURE:string.Empty):string.Empty;
                this.Txt_Type.Text               = "01";
                this.OKButton.Content            = "Creer";
                this.ogl_SaisieDetail.Visibility = System.Windows.Visibility.Visible;
                this.tabControl1.SelectedItem    = ogl_SaisieDetail;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }