コード例 #1
0
        private void SPX_RPT_SELECT_FACTURES_TOURNEE_DETAIL(List <string> Listcategorie, string TypeEdition, string ValueJour, string ValueMois, string ValueAnnee, Dictionary <string, string> listeParam)
        {
            int loaderHandler           = LoadingManager.BeginLoading("Please Wait for catégorie detail ... ");
            ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Report"));

            //List<ServiceReport.CsFacture> liste = service.SPX_RPT_AREAS_CATEGORY_DETAIL(categorie, TypeEdition, ValueJour, ValueMois, ValueAnnee, null, listeParam);
            List <ServiceReport.CsFacture> liste = new List <CsFacture>();
            string key = Utility.getKey();

            service.SPX_RPT_SELECT_FACTURES_TOURNEE_DETAILAsync(Listcategorie, TypeEdition, ValueJour, ValueMois, ValueAnnee, key, listeParam);
            service.SPX_RPT_SELECT_FACTURES_TOURNEE_DETAILCompleted += (er, res) =>
            {
                try
                {
                    if (res.Error != null || res.Cancelled)
                    {
                        LoadingManager.EndLoading(loaderHandler);
                        Message.ShowInformation("Erreur survenue lors de l'appel service", "ERROR");
                        return;
                    }
                    if (res.Result == null)
                    {
                        LoadingManager.EndLoading(loaderHandler);
                        Message.ShowInformation("Impossible d'afficher le rapport", "ERROR");
                        return;
                    }

                    liste = res.Result;

                    List <ServiceReport.CsFacture> reportPrint = new List <CsFacture>();

                    if (this.ddbSolde.SelectedValue != null && this.ddbSolde.SelectedValue.ToString() != string.Empty &&
                        this.txtMarge.Text != string.Empty)
                    {
                        reportPrint = ConstruireNouvelleListe(liste);
                    }
                    else
                    {
                        reportPrint.AddRange(liste);
                    }

                    listefinale.AddRange(reportPrint);
                    this.DefinedRDLC = reportName;

                    Utility.ActionPreview <ServicePrintings.CsFacture, ServiceReport.CsFacture>(listefinale, listeParam, this.DefinedRDLC, "Report");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    LoadingManager.EndLoading(loaderHandler);
                }
            };
        }