private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdCreateView": string sql = AtMng.GetddTable().CreateSQLView(CurrentRowTable()); Clipboard.SetText(sql); MessageBox.Show("SQL statement placed on clipboard"); break; case "cmdRefreshReferences": RefreshReferences(); break; case "cmdPopulate": Populate(); break; case "cmdCancel": Cancel(); break; case "cmdSave": Save(); break; case "cmdExportToXML": ExportToXml(); break; case "cmdNewTable": lmDatasets.appDB.ddTableRow dtr = (lmDatasets.appDB.ddTableRow)AtMng.GetddTable().Add(null); ddTableGridEX.Find(ddTableGridEX.RootTable.Columns["TableName"], Janus.Windows.GridEX.ConditionOperator.Equal, "New Table", 0, 1); ddTableGridEX.CurrentColumn = ddTableGridEX.RootTable.Columns["TableName"]; ddTableGridEX.EditMode = Janus.Windows.GridEX.EditMode.EditOn; break; case "cmdNewField": if (CurrentRowTable() != null) { lmDatasets.appDB.ddFieldRow dfr = (lmDatasets.appDB.ddFieldRow)AtMng.GetddField().Add(CurrentRowTable()); ddFieldGridEX.Find(ddFieldGridEX.RootTable.Columns["FieldId"], Janus.Windows.GridEX.ConditionOperator.Equal, dfr.FieldId, 0, 1); //ddFieldGridEX.CurrentColumn = ddFieldGridEX.RootTable.Columns["FieldName"]; //ddFieldGridEX.EditMode = Janus.Windows.GridEX.EditMode.EditOn; } else { MessageBox.Show("Please select a Table row before choosing to create a new field", "No Table Selected", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdPopulate": Populate(); break; case "cmdCancel": Cancel(); break; case "cmdSave": Save(); break; case "cmdExportToXML": ExportToXml(); break; case "cmdNew": cmdNew1.Expand(); break; case "cmdNewTable": lmDatasets.appDB.ddTableRow dtr = (lmDatasets.appDB.ddTableRow)AtMng.GetddTable().Add(null); ddTableGridEX.Find(ddTableGridEX.RootTable.Columns["TableName"], Janus.Windows.GridEX.ConditionOperator.Equal, "New Table", 0, 1); ddTableGridEX.CurrentColumn = ddTableGridEX.RootTable.Columns["TableName"]; ddTableGridEX.EditMode = Janus.Windows.GridEX.EditMode.EditOn; break; case "cmdNewField": if (CurrentRowTable() != null) { foreach (Janus.Windows.GridEX.GridEXRow gr in ddTableGridEX.GetRows()) { if ((int)gr.Cells["TableId"].Value == CurrentRowTable().TableId) { ddTableGridEX.Row = gr.Position; } } ddTableGridEX.CurrentRow.Expanded = true; lmDatasets.appDB.ddFieldRow dfr = (lmDatasets.appDB.ddFieldRow)AtMng.GetddField().Add(CurrentRowTable()); foreach (Janus.Windows.GridEX.GridEXRow gr in ddTableGridEX.CurrentRow.GetChildRecords()) { if ((int)gr.Cells["FieldId"].Value == dfr.FieldId) { ddTableGridEX.Row = gr.Position; ddTableGridEX.CurrentColumn = ddTableGridEX.RootTable.ChildTables[0].Columns["FieldName"]; ddTableGridEX.EditMode = Janus.Windows.GridEX.EditMode.EditOn; } } } else { MessageBox.Show("Please select a Table row before choosing to create a new field", "No Table Selected", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }