private void hsRunStatement_Click(object sender, EventArgs e) { //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify); string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); var riOk = riList.Find(x => x.commandDone == true); long costs = AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); var sb = new StringBuilder(); if (riFailure != null) { messages_count++; if (messages_count > 0) { sb.Append($@"Messages ({messages_count}) "); } if (error_count > 0) { sb.Append($@"Errors ({error_count})"); } } tabPageMessages.Text = sb.ToString(); fctMessages.ScrollLeft(); lblUsedMs.Text = costs.ToString(); }
private void Create() { //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify); string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); oldIndexColumnName = _indexObject.Name; if (_dataFilled) { MakeSQL(); } AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); string info = (riFailure == null) ? $@"Index {_dbReg.Alias}->{_indexObject.Name} updated." : $@"Index {_dbReg.Alias}->{_indexObject.Name} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}"; DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadIndex, $@"->Proc:{Name}->Create"); _localNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadIndex, $@"->Proc:{Name}->Create"); }
private void Create() { //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify); string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); if (riFailure == null) { old_constraint_name = txtConstraintName.Text; } AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); string info = (riFailure == null) ? $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} updated." : $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}"; DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadAllForeignKeys, $@"->Proc:{Name}->Create"); _localNotify.Notify.RaiseInfo(info); BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit; }
private void ExecueteSQL() { string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); //_sql.ScriptNotify.Register4Info(InfoRaised); _sql.ScriptNotify.Register4Error(ErrorRaised); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); EditToData(); if (riFailure == null) { OrgFieldObject = FieldObject.DeepClone(); BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit; ObjectToEdit(FieldObject); MakeSQL(); } AppStaticFunctionsClass.SendResultNotify(riList, localNotify); string info = (riFailure == null) ? $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} updated." : $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors"; DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadFields, $@"->Proc:{Name}->ExecueteSQL()"); _localTableNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadFields); }
private void ExecueteSQL() { string _connstr = ConnectionStrings.Instance.MakeConnectionString(DBReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); //_sql.ScriptNotify.Register4Info(InfoRaised); _sql.ScriptNotify.Register4Error(ErrorRaised); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); _localNotify.Notify.RaiseInfo("info", StaticVariablesClass.ReloadFields); RefreshUsers(); }
private void Create() { string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); string info = (riFailure == null) ? $@"Domain {_dbReg.Alias}->{DomainObject.Name} updated." : $@"Domain {_dbReg.Alias}->{DomainObject.Name} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors"; //DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info,StaticVariablesClass.ReloadDomains,$@"->Proc:{Name}->Create"); _localNotify.Notify.RaiseInfo(info); EditToData(); }
private void Create() { //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify); string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg); var _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT"); var riList = _sql.ExecuteCommands(fctSQL.Lines); var riFailure = riList.Find(x => x.commandDone == false); AppStaticFunctionsClass.SendResultNotify(riList, _localNotify); string info = (riFailure == null) ? $@"NotNull {_dbReg.Alias}->Field:{cbFields.Text}->NOT NULL Constraint:{txtConstraintName.Text} updated." : $@"NotNull {_dbReg.Alias}->Field:{cbFields.Text}->NOT NULL Constraint {txtConstraintName.Text} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}"; DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadConstraits, $@"->Proc:{Name}->Create"); _localNotify.Notify.RaiseInfo(info); }