Ejemplo n.º 1
0
        public void LoadAllTarifFacturation(int?idCentre, int?idProduit, int?idRedevance, int?idCodeRecherche)
        {
            try
            {
                ListeTarifFacturation.Clear();
                TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification"));
                int handler = LoadingManager.BeginLoading("Chargement des donnée ...");
                service.LoadAllTarifFacturationAsync(idCentre, idProduit, idRedevance, idCodeRecherche);
                service.LoadAllTarifFacturationCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur");
                        }
                        else
                        if (res.Result != null)
                        {
                            SessionObject.ListeTarifFacturation = res.Result;
                            //LoadAllDetailTarifFacturation(SessionObject.ListeTarifFacturation);
                            foreach (var item in res.Result)
                            {
                                ListeTarifFacturation.Add(item);
                            }

                            LoadDatagrid(ListeTarifFacturation.OrderBy(t => t.CTARCOMP).ToList());
                        }
                        else
                        {
                            Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Erreur");
                        }
                        LoadingManager.EndLoading(handler);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }