public void VerifieLotCompteClient(string Origine, string NumeroLot, string TypeLot)
        {
            AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));

            service1.RetourneListeDesTypeLotCompleted += (sr, res) =>
            {
                LeLot     = new CsLotCompteClient();
                ListDeLot = new List <CsLotCompteClient>();
                if (res != null && res.Cancelled)
                {
                    return;
                }
                ListDeLot = res.Result;
                if (ListDeLot != null && ListDeLot.Count != 0)
                {
                    LeLot = ListDeLot.First(p => p.NUMEROLOT == NumeroLot);
                    if (LeLot != null)
                    {
                        LotExit = true;
                    }
                }
            };
            service1.RetourneListeDesTypeLotAsync(Origine, TypeLot);
            service1.CloseAsync();
        }
Exemple #2
0
        public void VerifieLotCompteClient(string Origine, string NumeroLot, string TypeLot)
        {
            List <CsLotCompteClient> ListDeLotInit = new List <CsLotCompteClient>();

            LeLot = new CsLotCompteClient();

            AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));

            service1.RetourneListeDesTypeLotCompleted += (sr, res) =>
            {
                ListDeLotInit = new List <CsLotCompteClient>();
                if (res != null && res.Cancelled)
                {
                    return;
                }
                ListDeLotInit = res.Result;
                if (ListDeLotInit != null && ListDeLotInit.Count != 0)
                {
                    LeLot = ListDeLotInit.FirstOrDefault(p => p.NUMEROLOT == NumeroLot && p.ORIGINE == Origine);
                    if (LeLot != null)
                    {
                        if (LeLot.STATUS == "0")
                        {
                            IsLotExit = true;
                            RetourneDetailLot(LeLot.IDLOT);
                        }
                        else
                        {
                            Message.ShowInformation(Langue.msglotExit, "Saisi de lot");
                        }
                    }
                    else
                    {
                        RemplireDeuxiemeOnglet(IsLotExit);
                    }
                }
                else
                {
                    RemplireDeuxiemeOnglet(IsLotExit);
                    this.ogl_SaisieDetail.Visibility = System.Windows.Visibility.Visible;
                    this.tabControl1.SelectedItem    = ogl_SaisieDetail;
                }
            };
            service1.RetourneListeDesTypeLotAsync(null, null);
            service1.CloseAsync();
        }
Exemple #3
0
        private void ValiderBacth(CsLotCompteClient LeBatch, List <CsDetailLot> LeDetailLot)
        {
            CsSaisieDeMasse _LeLotDeSaisi = new CsSaisieDeMasse();

            _LeLotDeSaisi.LotCompteClient = LeBatch;
            _LeLotDeSaisi.LstDetailLot    = LeDetailLot;
            AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));

            service1.ValiderSaisieBactchCompleted += (sr, res) =>
            {
                var w = new MessageBoxControl.MessageBoxChildWindow("Mise a jour", Langue.MsgOperationTerminee, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                w.OnMessageBoxClosed += (_, result) =>
                {
                };
                w.Show();
            };
            service1.ValiderSaisieBactchAsync(_LeLotDeSaisi);
            service1.CloseAsync();
        }
Exemple #4
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;
            }
        }