Exemple #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Verifies the existence of the specified FW data source.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private static void CheckExistenceOfFwDatabase(PaDataSource ds)
        {
            if (ds == null)
            {
                return;
            }

            if (!FwDBUtils.IsSQLServerStarted && !FwDBUtils.StartSQLServer(true))
            {
                return;
            }

            if (ds.FwDataSourceInfo != null)
            {
                var fwDBInfoList =
                    FwDBUtils.GetFwDataSourceInfoList(ds.FwDataSourceInfo.Server, false);

                if (fwDBInfoList.Any(fwinfo => ds.FwPrjName == fwinfo.Name))
                {
                    return;
                }

                ds.FwDataSourceInfo.IsMissing = true;
            }

            MissingFWDatabaseMsgBox.ShowDialog(ds.ToString(true));
            ds.SkipLoadingBecauseOfProblem = true;
        }
 /// ------------------------------------------------------------------------------------
 public static DialogResult ShowDialog(string dbName)
 {
     using (var msgBox = new MissingFWDatabaseMsgBox())
     {
         msgBox.lblDBName.Text = dbName;
         App.CloseSplashScreen();
         return(msgBox.ShowDialog());
     }
 }