private void cmdViewDiff_Click(object sender, EventArgs e) { var _auditFields = new List <SpecialField>(); var oldItem = (tvwRefresh.SelectedNode.Tag as DataTreeItem).SourceItem as SQLObject; var newItem = (tvwRefresh.SelectedNode.Tag as DataTreeItem).TargetItem as SQLObject; //Setup new model _auditFields.Add(new SpecialField { Name = _model.CreatedByColumnName, Type = SpecialFieldTypeConstants.CreatedBy }); _auditFields.Add(new SpecialField { Name = _model.CreatedDateColumnName, Type = SpecialFieldTypeConstants.CreatedDate }); _auditFields.Add(new SpecialField { Name = _model.ModifiedByColumnName, Type = SpecialFieldTypeConstants.ModifiedBy }); _auditFields.Add(new SpecialField { Name = _model.ModifiedDateColumnName, Type = SpecialFieldTypeConstants.ModifiedDate }); _auditFields.Add(new SpecialField { Name = _model.ConcurrencyCheckColumnName, Type = SpecialFieldTypeConstants.Timestamp }); _auditFields.Add(new SpecialField { Name = _model.TenantColumnName, Type = SpecialFieldTypeConstants.Tenant }); var F = new DBObjectDifferenceForm(oldItem, newItem); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } }
private void cmdViewDiff_Click(object sender, EventArgs e) { SQLObject oldItem = null; SQLObject newItem = null; #region Entity if (_modelElement is nHydrate.Dsl.Entity) { oldItem = (_modelElement as nHydrate.Dsl.Entity).ToDatabaseObject(); newItem = _importDomain.GetEntity(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion #region View else if (_modelElement is nHydrate.Dsl.View) { oldItem = (_modelElement as nHydrate.Dsl.View).ToDatabaseObject(); newItem = _importDomain.GetView(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion var F = new DBObjectDifferenceForm(oldItem, newItem); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } }
private void ChangeTextMenuClick(object sender, EventArgs e) { var node = SelectedNode; if (node != null) { var d = node.Tag as DataTreeItem; if (d == null) { return; } if (d.SourceItem is SQLObject) { var F = new DBObjectDifferenceForm(d.SourceItem as SQLObject, d.TargetItem as SQLObject); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { node.Checked = false; } } } }
private void cmdViewDiff_Click(object sender, EventArgs e) { var _auditFields = new List<SpecialField>(); var oldItem = (tvwRefresh.SelectedNode.Tag as DataTreeItem).SourceItem as SQLObject; var newItem = (tvwRefresh.SelectedNode.Tag as DataTreeItem).TargetItem as SQLObject; //Setup new model _auditFields.Add(new SpecialField { Name = _model.CreatedByColumnName, Type = SpecialFieldTypeConstants.CreatedBy }); _auditFields.Add(new SpecialField { Name = _model.CreatedDateColumnName, Type = SpecialFieldTypeConstants.CreatedDate }); _auditFields.Add(new SpecialField { Name = _model.ModifiedByColumnName, Type = SpecialFieldTypeConstants.ModifiedBy }); _auditFields.Add(new SpecialField { Name = _model.ModifiedDateColumnName, Type = SpecialFieldTypeConstants.ModifedDate }); _auditFields.Add(new SpecialField { Name = _model.TimestampColumnName, Type = SpecialFieldTypeConstants.Timestamp }); _auditFields.Add(new SpecialField { Name = _model.TenantColumnName, Type = SpecialFieldTypeConstants.Tenant }); var F = new DBObjectDifferenceForm(oldItem, newItem); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } }
private void ChangeTextMenuClick(object sender, EventArgs e) { var node = SelectedNode; if (node != null) { var d = node.Tag as DataTreeItem; if (d == null) return; if (d.SourceItem is SQLObject) { var F = new DBObjectDifferenceForm(d.SourceItem as SQLObject, d.TargetItem as SQLObject); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { node.Checked = false; } } } }
private void cmdViewDiff_Click(object sender, EventArgs e) { SQLObject oldItem = null; SQLObject newItem = null; #region Entity if (_modelElement is nHydrate.Dsl.Entity) { oldItem = (_modelElement as nHydrate.Dsl.Entity).ToDatabaseObject(); newItem = _importDomain.GetEntity(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion #region View else if (_modelElement is nHydrate.Dsl.View) { oldItem = (_modelElement as nHydrate.Dsl.View).ToDatabaseObject(); newItem = _importDomain.GetView(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion #region Stored Procedure else if (_modelElement is StoredProcedure) { oldItem = (_modelElement as nHydrate.Dsl.StoredProcedure).ToDatabaseObject(); newItem = _importDomain.GetStoredProcedure(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion #region Function else if (_modelElement is nHydrate.Dsl.Function) { oldItem = (_modelElement as nHydrate.Dsl.Function).ToDatabaseObject(); newItem = _importDomain.GetFunction(DatabaseConnectionControl1.ImportOptions.GetConnectionString(), (string)cboItem.SelectedItem, _auditFields); } #endregion var F = new DBObjectDifferenceForm(oldItem, newItem); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } }