Carrotware.CMS.DBUpdater.DatabaseUpdate.DoCMSTablesExist C# (CSharp) Method

DoCMSTablesExist() public method

public DoCMSTablesExist ( ) : bool
return bool
        public bool DoCMSTablesExist()
        {
            if (!DatabaseUpdate.FailedSQL) {
                bool bTestResult = SQLUpdateNugget.EvalNuggetKey("DoCMSTablesExist");

                if (bTestResult) {
                    return bTestResult;
                }
            }

            return false;
        }

Usage Example

コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DatabaseUpdate du = new DatabaseUpdate();

            if (!string.IsNullOrEmpty(Request.QueryString["signout"])) {
                FormsAuthentication.SignOut();
            }

            List<DatabaseUpdateMessage> lst = new List<DatabaseUpdateMessage>();

            btnLogin.Visible = false;
            btnCreate.Visible = false;

            if (DatabaseUpdate.LastSQLError != null) {
                du.HandleResponse(lst, DatabaseUpdate.LastSQLError);
                DatabaseUpdate.LastSQLError = null;
            } else {
                bool bUpdate = true;

                if (!du.DoCMSTablesExist()) {
                    bUpdate = false;
                }

                bUpdate = du.DatabaseNeedsUpdate();

                if (bUpdate) {
                    DatabaseUpdateStatus status = du.PerformUpdates();
                    lst = du.MergeMessages(lst, status.Messages);
                } else {
                    DataInfo ver = DatabaseUpdate.GetDbSchemaVersion();
                    du.HandleResponse(lst, "Database up-to-date [" + ver.DataValue + "] ");
                }

                bUpdate = du.DatabaseNeedsUpdate();

                if (!bUpdate && DatabaseUpdate.LastSQLError == null) {
                    if (du.UsersExist) {
                        btnLogin.Visible = true;
                    } else {
                        btnCreate.Visible = true;
                    }
                }
            }

            if (DatabaseUpdate.LastSQLError != null) {
                du.HandleResponse(lst, DatabaseUpdate.LastSQLError);
            }

            if (lst.Where(x => !string.IsNullOrEmpty(x.ExceptionText)).Count() > 0) {
                bOK = false;
            } else {
                bOK = true;
            }

            GeneralUtilities.BindRepeater(rpMessages, lst.OrderBy(x => x.Order));

            using (CMSConfigHelper cmsHelper = new CMSConfigHelper()) {
                cmsHelper.ResetConfigs();
            }
        }
All Usage Examples Of Carrotware.CMS.DBUpdater.DatabaseUpdate::DoCMSTablesExist