private void btnComboRemoteName_D_Click(object sender, EventArgs e) { if (radioButtonEntity.Checked) { EFAssembly.EFClientToolsAssemblyAdapt.RemoteNameEditorDialog remoteNameEditorDialog = new EFAssembly.EFClientToolsAssemblyAdapt.RemoteNameEditorDialog(); if (remoteNameEditorDialog.RemoteNameEditorDialogForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { tbComboRemoteName_D.Text = remoteNameEditorDialog.ReturnValue; tbComboEntityName_D.Text = remoteNameEditorDialog.ReturnClassName; List<object> refvals = WzdUtils.GetAllDataByTableName("SYS_REFVAL"); for (int i = 0; i < refvals.Count; i++) { if ((refvals[i] as SYS_REFVAL).REFVAL_NO == "SL." + tbComboEntityName_D.Text && lvSelectedFields.SelectedItems[0].Text == (refvals[i] as SYS_REFVAL).VALUE_MEMBER) { cbComboDisplayField_D.Text = (refvals[i] as SYS_REFVAL).DISPLAY_MEMBER; cbComboValueField_D.Text = (refvals[i] as SYS_REFVAL).VALUE_MEMBER; tbOtherFields_D.Text = (refvals[i] as SYS_REFVAL).SELECT_COMMAND; break; } } } } else if (radioButtonInfoCommand.Checked) { string[] fSelectedList = new string[10]; string strSelected = ""; IGetValues aItem = (IGetValues)FInfoDataSet; FProviderNameList = aItem.GetValues("RemoteName"); PERemoteName form = new PERemoteName(FProviderNameList, strSelected); if (form.ShowDialog() == DialogResult.OK) { tbComboRemoteName_D.Text = form.RemoteName; InfoDataSet ds = new InfoDataSet(); ds.SetWizardDesignMode(true); ds.RemoteName = tbComboRemoteName_D.Text; ds.ClearWhere(); ds.SetWhere("1=0"); ds.Active = true; String DataSetName = ds.RealDataSet.Tables[0].TableName; String ModuleName = ds.RemoteName.Substring(0, ds.RemoteName.IndexOf('.')); String SolutionName = System.IO.Path.GetFileNameWithoutExtension(FDTE2.Solution.FullName); tbComboEntityName_D.Text = CliUtils.GetTableName(ModuleName, DataSetName, SolutionName, "", true); DataSet dsSYS_REFVAL = GetDataFromSYS_REFVAL(tbComboEntityName_D.Text, lvSelectedFields.SelectedItems[0].Text); if (dsSYS_REFVAL.Tables.Count > 0 && dsSYS_REFVAL.Tables[0].Rows.Count > 0) { cbComboDisplayField_D.Text = dsSYS_REFVAL.Tables[0].Rows[0]["DISPLAY_MEMBER"].ToString(); cbComboValueField_D.Text = dsSYS_REFVAL.Tables[0].Rows[0]["VALUE_MEMBER"].ToString(); tbOtherFields_D.Text = dsSYS_REFVAL.Tables[0].Rows[0]["SELECT_COMMAND"].ToString(); } } } }
private void frmDGVGridRefVal_FormClosed(object sender, FormClosedEventArgs e) { if (!bCloseEventArises) { this.RefVal.Close(new OnCloseEventArgs()); bCloseEventArises = true; } dsAllData = (InfoDataSet)this.DataSource.GetDataSource(); //if (!bClearWhere) //{ if (this.RefVal.SelectCommand == null || this.RefVal.SelectCommand == "") { dsAllData.ClearWhere(); } else { //modified by lily 2007/3/13 RefVal.SelectAlias-->null,for runtime loginDB is the right db. dsAllData.Execute(RefVal.SelectCommand, null, true); } //} }
private void tbTableName_TextChanged(object sender, EventArgs e) { if (radioButtonEntity.Checked) { if (tbComboEntityName.Text != String.Empty) { Dictionary<string, object> htFields = WzdUtils.GetFieldsByEntityName(FClientData.AssemblyName, FClientData.CommandName, this.tbComboEntityName.Text); cbDataTextField.Items.Clear(); cbDataValueField.Items.Clear(); foreach (var field in htFields) { cbDataTextField.Items.Add(field.Key.ToString()); cbDataValueField.Items.Add(field.Key.ToString()); } } else { cbDataTextField.Items.Clear(); cbDataValueField.Items.Clear(); } } else if (radioButtonInfoCommand.Checked) { if (tbComboEntityName.Text != String.Empty) { InfoDataSet ds = new InfoDataSet(); ds.SetWizardDesignMode(true); ds.RemoteName = tbComboRemoteName.Text; ds.ClearWhere(); ds.SetWhere("1=0"); ds.Active = true; cbDataTextField.Items.Clear(); cbDataValueField.Items.Clear(); foreach (DataColumn field in ds.GetRealDataSet().Tables[0].Columns) { cbDataTextField.Items.Add(field.ColumnName); cbDataValueField.Items.Add(field.ColumnName); } } else { cbDataTextField.Items.Clear(); cbDataValueField.Items.Clear(); } } }