private void ShowAddColumn() { try { ColumnObjectModel column = new ColumnObjectModel { Column_Id = int.MaxValue }; ColumnsEdit columnEdit = new ColumnsEdit(column, this.Table.TableName); bool?result = columnEdit.ShowDialog(); if (result == null || !result.Value) { return; } column.HasModelChanged = false; // This is to clear the model changes values. Especialy for new column creation this.Table.Columns = this.Table.Columns.Add(columnEdit.Column); Integrity.MapColumn(column, this.Table.TableName); if (column.IsForeignkey) { this.ForeignKeyColumnAdded?.Invoke(this, column); } this.TableColumnChanged?.Invoke(this, column); } catch (Exception err) { MessageBox.Show(err.GetFullExceptionMessage()); } }