Example #1
0
 public ScriptRunner()
 {
     InitializeComponent();
     if (CommonUtilities.ConfigFileExists())
     {
         DOAppDatabaseInfo.GetDBInfoFromFile();
     }
 }
Example #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //this is not required but still as a precaution
            if (!InputValidation())
            {
                return;
            }

            if (!DOFileCreateAndUpdate.CreateAndUpdateFile(ServerName, UserID, Password))
            {
                DoRollBack();
                MessageBox.Show("Unable to create config file.");
                return;
            }

            if (!DOAppDatabaseInfo.GetDBInfoFromFile())
            {
                MessageBox.Show("Unable to read config file.");
                return;
            }

            string AppServerName = DOAppDatabaseInfo.ServerName;
            string AppUserID     = DOAppDatabaseInfo.UserID;
            string AppPassword   = DOAppDatabaseInfo.Password;
            string Message       = null;

            DODatabaseCreation dc = new DODatabaseCreation();

            if (dc.CreateDB(AppServerName, AppUserID, AppPassword, out Message))
            {
                UIControls();
                MessageBox.Show(Message);
            }
            else
            {
                DoRollBack();
                MessageBox.Show("Error " + Message);
            }
        }