Exemple #1
0
        static void Main(string[] Args)
        {
            if (Args.Length != 1)
            {
                MessageBox.Show("Vous devez fournir un fichier ini en parametre", "attention !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    MDIForm.URLServiceWebDefault = IniFile.GetString(Args[0], "ServiceWeb", "url");
                    MDIForm.URLServiceWeb        = MDIForm.URLServiceWebDefault;

                    MercureService Service = new MercureService();
                    Service.Url = MDIForm.URLServiceWeb;

                    if (Service.GetClients() == null)
                    {
                        MessageBox.Show("La base de données est inconnue.", "attention !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);
                        Application.Run(new MDIForm());
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Le fichier fourni n'est pas correct. Il doit contenir la section ServeurWeb et le tag url.", "attention !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
        /// <summary>
        /// Permet de constuire l'objet SousFamilleForm
        /// </summary>
        public SousFamilleForm()
        {
            InitializeComponent();

            Service     = new MercureService();
            Service.Url = MDIForm.URLServiceWeb;

            Familles = Service.GetFamilles();
        }
Exemple #3
0
        /// <summary>
        /// Permet de constuire l'objet
        /// </summary>
        public ArticleForm()
        {
            InitializeComponent();

            Service     = new MercureService();
            Service.Url = MDIForm.URLServiceWeb;

            Marques      = Service.GetMarques();
            SousFamilles = Service.GetSousFamilles();
        }
        /// <summary>
        /// Permet de gérer la validation de la nouvelle URL
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Valider_Click(object sender, EventArgs e)
        {
            MercureService Service = new MercureService();

            Service.Url = txb_URL.Text;

            if (Service.GetClients() == null)
            {
                MessageBox.Show("L'URL n'est pas valide", "attention !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                MDIForm.URLServiceWeb = txb_URL.Text;
                this.Close();
            }
        }
Exemple #5
0
 /// <summary>
 /// Permet de constuire l'objet
 /// </summary>
 public MarqueForm()
 {
     InitializeComponent();
     Service     = new MercureService();
     Service.Url = MDIForm.URLServiceWeb;
 }