public void DisableConditionModules() { OperatorsComboBox.Items.Clear(); ValueTextBox.Clear(); DateValueMaskedTextBox.Clear(); OperatorsComboBox.Enabled = false; ValueTextBox.Enabled = false; DateValueMaskedTextBox.Enabled = false; AddConditionButton.Enabled = false; ColumnsComboBox.SelectedIndex = -1; }
private void AddConditionButton_Click(object sender, EventArgs e) { if (IsParsing(GetValue())) { Condition condition = new Condition(GetColumn(), GetOperator(), GetValue()); ConditionsListBox.Items.Add(condition.ToString()); conditions.Add(condition); ConditionsListBox.SelectedIndex = 0; DisableConditionModules(); } else { ValueTextBox.Clear(); DateValueMaskedTextBox.Clear(); MessageBox.Show("Not Parsed!"); } }
private void OperatorsComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (OperatorsComboBox.SelectedItem != null) { AddConditionButton.Enabled = true; string op = OperatorsComboBox.SelectedItem.ToString(); if (op == "IS NULL" || op == "IS NOT NULL") { DateValueMaskedTextBox.Clear(); ValueTextBox.Clear(); DateValueMaskedTextBox.Enabled = false; ValueTextBox.Enabled = false; } else { SwitchTextBoxes(IsDate(GetColumnType())); } } }
public void SwitchTextBoxes(bool isDate) { if (isDate) { DateValueMaskedTextBox.Clear(); ValueTextBox.Clear(); DateValueMaskedTextBox.Enabled = true; DateValueMaskedTextBox.Visible = true; ValueTextBox.Enabled = false; ValueTextBox.Visible = false; } else { DateValueMaskedTextBox.Clear(); ValueTextBox.Clear(); DateValueMaskedTextBox.Enabled = false; DateValueMaskedTextBox.Visible = false; ValueTextBox.Enabled = true; ValueTextBox.Visible = true; } }