示例#1
0
        static void Test()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Configuration.Return();
            Utils.Load();

            Form_Parent f = new Form_Parent();

            Constantes.FORM_PARENT = f;
            Constantes.ACTIVE      = true;
            f.Hide();
            Application.Run(new Form_Setting());
        }
示例#2
0
 private void btn_connecter_Click(object sender, EventArgs e)
 {
     try
     {
         if (ConnectLog())
         {
             timer1.Stop();
             timer2.Stop();
             this.Close();
             Form_Parent f_parent = new Form_Parent();
             if (Constantes.f_parent == null)
             {
                 f_parent.Show();
                 Constantes.f_parent = f_parent;
             }
             else
             {
                 Constantes.f_parent.InitializeComponent();
                 Constantes.f_parent.Show();
             }
             if (Constantes.users != null)
             {
                 Acces.LoadAcces(Constantes.users.Niveau);
                 Constantes.f_parent.txt_users.Text = Constantes.users.Prenom + " " + Constantes.users.Nom;
                 if (!(Constantes.users.Photo == null || Constantes.users.Photo.Trim().Equals("")))
                 {
                     string chemin = Chemins.getCheminUsers(Constantes.users.Id.ToString());
                     if (System.IO.File.Exists(chemin + Constantes.users.Photo))
                     {
                         Constantes.f_parent.box_users.Image = Image.FromFile(chemin + Constantes.users.Photo);
                         return;
                     }
                 }
             }
             Constantes.f_parent.box_users.Image.Dispose();
             Constantes.f_parent.box_users.Image = global::CATALOGUE_ARTICLE.Properties.Resources.contact;
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }
 public Form_Parent()
 {
     InitializeComponent();
     Instance = this;
 }
示例#4
0
        static void Start(bool registry)
        {
            try
            {
                Utils.WriteStatut(0);
                Utils.Load();

                Utils.WriteStatut(1);
                if (!Appareil.Verify() || !Utils.ExecuteScript())
                {
                    Utils.InstallSDK(!Utils.ExecuteScript());
                }

                Utils.WriteStatut(2);
                if (new TOOLS.Connexion().isConnection(ServeurBLL.ReturnServeur()) ? new TOOLS.Connexion().Connection() == null : true)
                {
                    CloseStart();
                    new IHM.Form_Serveur().ShowDialog();
                    return;
                }
                if (Constantes.USERS != null ? Constantes.USERS.Id < 1 : true)
                {
                    CloseStart();
                    new IHM.Form_Users().ShowDialog();
                    return;
                }
                if (Constantes.SOCIETE != null ? Constantes.SOCIETE.Id < 1 : true)
                {
                    CloseStart();
                    new IHM.Form_Societe(true).ShowDialog();
                    return;
                }

                Utils.WriteStatut(3);
                if (registry)
                {
                    Utils.StartWithWindows();
                }

                Utils.WriteStatut(4);
                if (Utils.Is64BitOperatingSystem())
                {
                    Utils.CreateRegistreDLL64Bits();
                }

                Form_Parent start = new Form_Parent();
                Constantes.FORM_PARENT = start;

                Constantes.FORM_PARENT.activerToolStripMenuItem.Text         = Constantes.ACTIVE ? Mots.Cacher : Mots.Afficher;
                Constantes.FORM_PARENT.activerToolStripMenuItem.Image        = Constantes.ACTIVE ? global::ZK_Lymytz.Properties.Resources.no_vue : global::ZK_Lymytz.Properties.Resources.vue;
                Constantes.FORM_PARENT.déconnectionToolStripMenuItem.Visible = Constantes.SETTING.CheckConnect;
                Constantes.FORM_PARENT.miseÀJourToolStripMenuItem.Visible    = Utils.NewVersion();
                Constantes.FORM_PARENT.miseÀJourToolStripMenuItem1.Visible   = Utils.NewVersion();

                Utils.WriteLog("-------------------------------------------------------------------------------------------------------------------------------------------------------------------");
                Utils.WriteLog("DEMARRAGE DE L'APPLICATION.....");

                Utils.WriteStatut(5);
                if (Constantes.SETTING.Autorun)
                {
                    Fonctions.StartDevices();
                }
                Utils.WriteStatut(6);
                if (Constantes.SETTING.UseFileTamponLog)
                {
                    Fonctions.LoadFileTamponPointeuses(2, true);
                }
                Utils.WriteStatut(7);
                if (Constantes.SETTING.CreateService)
                {
                    Utils.RunService();
                }
                Utils.WriteStatut(8);
                if (Constantes.SETTING.AutoCheckConnectAndSynchro)
                {
                    Fonctions.CreateJobBackupAndSynchronise();
                }
                else
                {
                    Utils.WriteStatut(9);
                    if (Constantes.SETTING.AutoBackupDevice)
                    {
                        Fonctions.CreateJobBackup();
                    }
                }
                Utils.WriteStatut(10);
                if (Constantes.SETTING.AutoSynchro)
                {
                    new Thread(new ThreadStart(Fonctions.CheckPingAndSynchro)).Start();
                }
                Utils.WriteStatut(11);
                Utils.CreateExecuteService();

                CloseStart();
                Application.Run();
            }
            catch (Exception ex)
            {
                Messages.Exception(ex);
                Application.Restart();
            }
        }