private void selectdConnection() { if (this.cbtemplate.SelectedIndex > -1) { _currentEntity = ConfigureModel.Find(cbtemplate.SelectedValue.ToString()); tbConnectInfo.Text = _currentEntity.ConnectionString; } }
private void toolbtnupdate_Click(object sender, EventArgs e) { var table = Project.Tables .FirstOrDefault(p => p.Table_Name == lbTableList.SelectedValue.ToString()); var _config = ConfigureModel.Find(Project.ConnectionName); var updatefrm = new Updateschema(table, _config); updatefrm.Notify += Updatefrm_Notify; updatefrm.ShowDialog(); if (tableschemaContext != null) { int currentindex = this.lbTableList.SelectedIndex; tableschemaContext.ResetBindings(false); LoadTableList(tbKeyword.Text); this.lbTableList.SelectedIndex = currentindex; } }
private async void btnupdate_Click(object sender, EventArgs e) { ProjectModel model = new ProjectModel(); if (!cbIsoriginal.Checked) { _config = ConfigureModel.Find(cbtemplate.SelectedValue.ToString()); } model.Notify += Model_Notify; await Task.Run(() => { this.Invoke(new Action(() => { btnupdate.Enabled = false; })); model.UpdateSchema(_table, rbselect2.Checked, cbIsoriginal.Checked, _config, this.Invoke); }); btnupdate.Enabled = true; }
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { var editor = (this.ActiveMdiChild as editor); if (editor != null) { var entity = ConfigureModel.Find(editor.Project.ConnectionName); using (DbContext context = new DbContext(entity)) { ProjectModel model = new ProjectModel(); var _columns = context.GetColumns(editor.Project.Tables.Select(p => p.Table_Name).ToArray()); foreach (var item in editor.Project.Tables) { var columns = _columns.Where(p => p.Table == item.Table_Name); item.Object_id = columns.First().Object_id; foreach (var column in item.Columns) { var co = _columns.FirstOrDefault(p => p.Column == column.Column); column.Column_id = co.Column_id; } } } } }