예제 #1
0
 static void start()
 {
     Licence.createLicence();
     if (Licence.verifyLicence())
     {
         if (!Utils.verifyParametre())
         {
             if (!ServeurBLL.CreateServeur(Serveur.getServeurDefault()))
             {
                 return;
             }
         }
         if (Connexion.isConnection())
         {
             new Acces();
             new Form_Parent().Show();
             //new Form_Login().Show();
             Application.Run();
         }
         else
         {
             if (Database.createDb())
             {
                 new Acces();
                 new Form_Parent().Show();
                 //new Form_Login().Show();
                 Application.Run();
             }
         }
     }
     else
     {
         Messages.ShowErreur("Vous devez activer votre compte");
     }
 }
예제 #2
0
        private void LoadServeur()
        {
            Serveur s = ServeurBLL.ReturnServeur();

            if (s != null)
            {
                PopulateServeur(s);
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: dowesw/Scolaris
 static void Start()
 {
     if (Connexion.isInfosServeur(ServeurBLL.ReturnServeur()))
     {
         Application.Run(new Form_Parent());
     }
     else
     {
         new IHM.Form_Serveur().ShowDialog();
     }
 }
예제 #4
0
 private void btn_save_serveur_Click(object sender, EventArgs e)
 {
     RecopieServeur();
     if (serveur.Control())
     {
         if (ServeurBLL.CreateServeur(serveur))
         {
             Messages.Succes();
             Application.Restart();
         }
     }
 }
예제 #5
0
        private void Form_Serveur_Load(object sender, EventArgs e)
        {
            Serveur s = ServeurBLL.ReturnServeur();

            txt_adress.Text = s.Adresse;
            txt_db.Text     = s.Database;
            txt_pwd.Text    = s.Password;
            txt_port.Text   = s.Port.ToString();
            txt_user.Text   = s.User;

            LoadConfig();
        }
예제 #6
0
 public NpgsqlConnection Connection(string adresse)
 {
     if (Utils.asString(adresse))
     {
         ENTITE.Serveur bean = ServeurBLL.ReturnServeur();
         if ((bean != null) ? bean.Port != 0 : false)
         {
             NpgsqlConnection connexion = returnConnexion(bean, adresse, true);
             return(connexion);
         }
         return(null);
     }
     else
     {
         return(Connection());
     }
 }
예제 #7
0
 public NpgsqlConnection Connection()
 {
     if (INSTANCE != null)
     {
         if (INSTANCE.State == System.Data.ConnectionState.Closed)
         {
             INSTANCE.Open();
         }
     }
     else
     {
         ENTITE.Serveur bean = ServeurBLL.ReturnServeur();
         if ((bean != null) ? bean.Port != 0 : false)
         {
             INSTANCE = returnConnexion(bean, true);
         }
     }
     return(INSTANCE);
 }
예제 #8
0
 private void btn_tester_Click(object sender, EventArgs e)
 {
     try
     {
         Societe societe = recopie();
         string  adresse = null;
         if (Utils.asString(societe.AdresseIp))
         {
             adresse = societe.AdresseIp;
         }
         else
         {
             ENTITE.Serveur bean = ServeurBLL.ReturnServeur();
             adresse = bean.Adresse;
         }
         if (!Utils.IsLocalAdress(adresse))
         {
             string fileName = TOOLS.Chemins.CheminBackup("localhost") + "localhost.csv";
             if (!File.Exists(fileName))
             {
                 Logs.WriteCsv(fileName, new IOEMDevice());
             }
             fileName = new RemoteAcces(adresse, societe.Port, societe.TypeConnexion, societe.Users, societe.Password).GetPathFile(@fileName);
             if (Utils.asString(fileName))
             {
                 Messages.Information("Connecté");
             }
             else
             {
                 Messages.ShowErreur("Echec");
             }
         }
     }
     catch (Exception ex)
     {
         Messages.Exception(ex);
     }
 }
예제 #9
0
 public static NpgsqlConnection Connection_()
 {
     return(getConnexion_(ServeurBLL.ReturnServeur()));
 }
예제 #10
0
 public static bool isConnection()
 {
     return(isConnection(ServeurBLL.ReturnServeur()));
 }
예제 #11
0
 private void Form_Serveur_Distant_Load(object sender, EventArgs e)
 {
     serveur     = ServeurBLL.ReturnServeur();
     txt_ip.Text = serveur.Adresse;
 }
예제 #12
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();
            }
        }