コード例 #1
0
        public List <ServiceReport.CsConnexion> GetPrintObjects(string module)
        {
            try
            {
                ReportServiceClient service = new ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint(module));
                // string mois = (Cmb_month.SelectedIndex < 0) ? null : (Cmb_month.SelectedIndex + 1).ToString("00");
                List <ServiceReport.CsConnexion> reportPrint = new List <CsConnexion>();


                int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... ");
                service.ObtenirNewWaterConnexionAsync(Txt_year.Text);
                service.ObtenirNewWaterConnexionCompleted += (er, res) =>
                {
                    try
                    {
                        if (res.Error != null || res.Cancelled)
                        {
                            LoadingManager.EndLoading(loaderHandler);
                            throw new Exception("Cannot display report");
                        }
                        if (res.Result != null)
                        {
                            reportPrint = res.Result;
                            Utility.ActionPreview <ServicePrintings.CsConnexion, Galatee.Silverlight.ServiceReport.CsConnexion>(reportPrint, null, "VisuReportYear", module);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    finally
                    {
                        LoadingManager.EndLoading(loaderHandler);
                    }
                };

                return(reportPrint);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }