Example #1
0
        private void SubmitBtn_Click(object sender, EventArgs e)
        {
            DBRestoreParam dBRestoreParam = null;

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (EnterConfigRadioBtn.Checked)
                {
                    dBRestoreParam = GetDBRestoreParam();
                }
                else if (ConfigFileRadioBtn.Checked)
                {
                    dBRestoreParam = DBRestoreParam.NewDBRestoreParam(this.ConfigFileTextBox.Text);
                }

                List <string> strList = DBRestoreHelper.RestoreCleanupShrinkDB(dBRestoreParam);
                AddToResults(strList);
            }
            catch (Exception ex)
            {
                AddToResults(ex.Message);
                if (ex.InnerException != null)
                {
                    AddToResults(ex.InnerException.Message);
                }
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Example #2
0
 private void AddDBAndSetState(bool onOrOff, bool addOptionalDBs = true)
 {
     this.DBToRestoreTxtBox.Text = string.Empty;
     this.DBToRestoreTxtBox.Text = String.Join(",", DBRestoreHelper.DatabaseToRestore().ToArray());
     if (addOptionalDBs)
     {
         this.DBToRestoreTxtBox.Text += String.Join(",", DBRestoreHelper.OptionalDBToRestore().ToArray());
     }
 }
Example #3
0
 private static void RunTool(CmdOptions cmdOptions)
 {
     if (!string.IsNullOrEmpty(cmdOptions.InputFile))
     {
         if (!System.IO.File.Exists(cmdOptions.InputFile))
         {
             Console.WriteLine("Input file {0} doesn't exists.", cmdOptions.InputFile);
         }
         else
         {
             DBRestoreParam dBRestoreParam = DBRestoreParam.NewDBRestoreParam(cmdOptions.InputFile);
             List <string>  strList        = DBRestoreHelper.RestoreCleanupShrinkDB(dBRestoreParam);
             foreach (string str in strList)
             {
                 Console.WriteLine(str);
             }
         }
     }
 }