Ejemplo n.º 1
0
 private void frmSetup_Load(object sender, EventArgs e)
 {
     Commons.ReadConfigFile();
     TxtPathDatabase.Text        = Commons.PathDatabase;
     TxtFileDatabase.Text        = Commons.FileDatabase;
     TxtPathImages.Text          = Commons.PathImages;
     TxtPathStartLinks.Text      = Commons.PathStartLinks; // not longer used
     Commons.PathAndFileDatabase = Commons.PathDatabase + "\\" + Commons.FileDatabase;
     TxtPathDocuments.Text       = Commons.PathDocuments;
     chkSaveBackup.Checked       = Commons.SaveBackupWhenExiting;
 }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // read configuration file or run configuration
            if (!Commons.ReadConfigFile())
            {
                MessageBox.Show("Configurazione del programma.\r\nSistemare le cartelle con il percorso dei file (in particalore la cartella che contiene il database), " +
                                "poi scegliere il file di dati .sqlite e premere 'Salva configurazione'", "SchoolGrades", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FrmSetup f = new FrmSetup();
                f.ShowDialog();
                if (!File.Exists(Commons.PathAndFileDatabase))
                {
                    MessageBox.Show("Configurare il programma!", "SchoolGrades", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            //Application.Run(new frmLogin());
            Application.Run(new frmMain());
        }
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // read configuration file or run configuration
            if (!Commons.ReadConfigFile())
            {
                // config file is unexistent or broken
                if (Commons.PathAndFileDatabase.Contains("DEMO") && File.Exists(Commons.PathAndFileDatabase))
                {
                    // if demo database exists, save the configuration program with demo file
                    WriteConfigFile();
                }
                else
                {
                    // we don't want the demo file or it doesn't exist. Let's ask the user
                    MessageBox.Show("Configurazione del programma.\r\nSistemare le cartelle con il percorso dei file (in particolare la cartella che contiene il database), " +
                                    "poi scegliere il file di dati .sqlite e premere 'Salva configurazione'", "SchoolGrades", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    FrmSetup f = new FrmSetup();
                    f.ShowDialog();
                    if (!File.Exists(Commons.PathAndFileDatabase))
                    {
                        MessageBox.Show("Configurare il programma!", "SchoolGrades", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
            }
            else
            {
                // config file has been read
                // di nothing
            }

            //Application.Run(new frmLogin());
            Application.Run(new frmMain());
        }
Ejemplo n.º 4
0
        private void frmTopicsRecover_Load(object sender, EventArgs e)
        {
            Commons.ReadConfigFile();
            txtPathNewDatabase.Text = Commons.PathDatabase;
            txtPathOldDatabase.Text = Commons.PathDatabase;
            txtFileNewDatabase.Text = Commons.FileDatabase;

            DbAndBusiness dbNew = new DbAndBusiness(txtPathNewDatabase.Text + "\\" + txtFileNewDatabase.Text);

            treeNew = new TreeMptt(trwNewTopics,
                                   txtNewTopicName, txtNewDescription, txtSearchNew, null, txtCodNewTopic,
                                   Commons.globalPicLed, DragDropEffects.Copy);
            treeNew.AddNodesToTreeviewByBestMethod();
            treeNew.ClearBackColorOnClick = false;

            picNewOnly.BackColor  = colorNewOnly;
            picOldOnly.BackColor  = colorOldOnly;
            picSameId.BackColor   = colorSameId;
            picSameName.BackColor = colorSameName;
            picSameDesc.BackColor = colorSameDesc;
            picSameNodeChangedParent.BackColor   = colorSameNodeChangedParent;
            picSameNodeChangedPosition.BackColor = colorSameNodeChangedPosition;
        }