Example #1
0
        /// <summary>
        /// Charge la liste des auteurs déjà existants dans la DB pour choix
        /// lors d'ajout d'un volume.
        /// </summary>
        private void SetAllAuthors()
        {
            ServiceReference.IadminServiceClient sClient = new ServiceReference.IadminServiceClient();

            try
            {
                List <ServiceReference.Author> authors = sClient.GetAllAuthorsNames().ToList();
                if (authors != null)
                {
                    _dBAuthors = authors;
                }
                else
                {
                    MessageBox.Show("La liste des auteurs n'a pas pu être récupérée !", "Une erreur est survenue",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException endpointEx)
            {
                int       cstmErrorN = 9; // "End point not found! Vérifiez que le serveur est lancé."
                CstmError cstmError  = new CstmError(cstmErrorN, endpointEx);
                CstmError.Display(cstmError);
            }
            catch (System.ServiceModel.FaultException <ServiceReference.CustomFault> Fault)
            {
                CstmError.Display(Fault.Message);
            }
            catch (CstmError cstmError)
            {
                CstmError.Display(cstmError);
            }
            catch (Exception e)
            {
                MessageBox.Show(string.Format("Une exception s'est produite à la récupération des données : \n {0}", e.Message), "Erreur",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }