コード例 #1
0
        private void InitialiseCtrl()
        {
            #region Remplissage du comboBox des collecteurs


            int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... ");


            ReportServiceClient service = new ReportServiceClient(Utility.Protocole(), Utility.EndPoint("Report"));

            //List<CsSales> reportPrint = new List<CsSales>();

            service.SelectionAgentParNomAsync(Matricule);
            service.SelectionAgentParNomCompleted += (er, res) =>
            {
                try
                {
                    if (res.Error != null || res.Cancelled)
                    {
                        LoadingManager.EndLoading(loaderHandler);
                        throw new Exception("Cannot display report");
                    }
                    if (res.Result != null)
                    {
                        List <CsReglement> liste = res.Result;
                        if (liste != null || liste.Count > 0)
                        {
                            listeDeReglement = liste;
                            foreach (CsReglement reg in liste)
                            {
                                this.CmbCollector.Items.Add(reg.NOMCAISSIERE);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    LoadingManager.EndLoading(loaderHandler);
                }
            };



            #endregion
        }