private void FirstStartUp()
        {
            if (txtServerAndSQL.Text != "")
            {
                if (connection == null)
                {
                    if (DataLayer.TestConnection(txtServerAndSQL.Text.Trim() + DatabaseConstants.MSSQLConnectionString))
                    {
                        SystemRegistryHandler.SaveRegistry(ProjectConstants.ProjectName, "Connection", txtServerAndSQL.Text.Trim(), EncryptionOptions.NoEncryption);
                        MessageBox.Show(Messages.ConnectionOK, ProjectConstants.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        pnlLogin.Visible = true;
                        pnlSetup.Visible = false;
                    }
                    else
                    {
                        MessageBox.Show(Messages.ConnectionError, ProjectConstants.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    pnlLogin.Visible = true;
                }
            }
            else
            {
                MessageBox.Show(Messages.Invalid, ProjectConstants.ProjectName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
 public static void SaveWindowPosition(Form form, string root)
 {
     SystemRegistryHandler.SaveRegistry(root, "Top", form.Top.ToString(), EncryptionOptions.NoEncryption);
     SystemRegistryHandler.SaveRegistry(root, "Left", form.Left.ToString(), EncryptionOptions.NoEncryption);
 }