Esempio n. 1
0
        public ValidationDBPage(ActDBValidation validationDB)
        {
            InitializeComponent();

            this.mValidationDB = validationDB;

            if (String.IsNullOrEmpty(mValidationDB.GetInputParamValue("SQL")))
            {
                mValidationDB.AddOrUpdateInputParamValue("SQL", mValidationDB.GetInputParamValue("Value"));
            }

            FillAppComboBox();

            //New UI Controls:
            //Query Type selection radio button :
            QueryTypeRadioButton.Init(typeof(ActDBValidation.eQueryType), SqlSelection, mValidationDB.GetOrCreateInputParam(ActDBValidation.Fields.QueryTypeRadioButton, ActDBValidation.eQueryType.FreeSQL.ToString()), QueryType_SelectionChanged);
            checkQueryType();

            //Free SQL
            //needs to be unmarked when fixed VE issue
            SQLUCValueExpression.Init(mValidationDB.GetOrCreateInputParam(ActDBValidation.Fields.SQL));

            //Read from sql file
            QueryFile.Init(mValidationDB.GetOrCreateInputParam(ActDBValidation.Fields.QueryFile), true, true, UCValueExpression.eBrowserType.File, "sql", BrowseQueryFile_Click);

            QueryFile.ValueTextBox.TextChanged += ValueTextBox_TextChanged;

            //Import SQL file in to solution folder
            GingerCore.General.ActInputValueBinding(ImportFile, CheckBox.IsCheckedProperty, mValidationDB.GetOrCreateInputParam(ActDBValidation.Fields.ImportFile, "True"));

            //OLD binding and UI
            App.FillComboFromEnumVal(ValidationCfgComboBox, validationDB.DBValidationType);

            //TODO: fix hard coded
            App.ObjFieldBinding(ValidationCfgComboBox, ComboBox.SelectedValueProperty, validationDB, "DBValidationType");

            App.ObjFieldBinding(AppNameComboBox, ComboBox.TextProperty, validationDB, ActDBValidation.Fields.AppName);
            App.ObjFieldBinding(DBNameComboBox, ComboBox.TextProperty, validationDB, ActDBValidation.Fields.DBName);
            App.ObjFieldBinding(TablesComboBox, ComboBox.TextProperty, validationDB, ActDBValidation.Fields.Table);
            App.ObjFieldBinding(KeySpaceComboBox, ComboBox.TextProperty, validationDB, ActDBValidation.Fields.Keyspace);
            App.ObjFieldBinding(ColumnComboBox, ComboBox.TextProperty, validationDB, ActDBValidation.Fields.Column);
            App.ObjFieldBinding(txtWhere, TextBox.TextProperty, validationDB, ActDBValidation.Fields.Where);
            GingerCore.General.ActInputValueBinding(CommitDB, CheckBox.IsCheckedProperty, mValidationDB.GetOrCreateInputParam(ActDBValidation.Fields.CommitDB));

            KeySpaceComboBox.Items.Add(mValidationDB.Keyspace);
            ComboAutoSelectIfOneItemOnly(KeySpaceComboBox);
            TablesComboBox.Items.Add(mValidationDB.Table);
            ComboAutoSelectIfOneItemOnly(TablesComboBox);
            ColumnComboBox.Items.Add(mValidationDB.Column);
            ComboAutoSelectIfOneItemOnly(ColumnComboBox);
            SetVisibleControlsForAction();
            SetQueryParamsGrid();
        }
Esempio n. 2
0
        public ValidationDBPage(ActDBValidation act)
        {
            InitializeComponent();

            this.mAct = act;

            if (String.IsNullOrEmpty(mAct.GetInputParamValue("SQL")))
            {
                mAct.AddOrUpdateInputParamValue("SQL", mAct.GetInputParamValue("Value"));
            }

            FillAppComboBox();

            //New UI Controls:
            //Query Type selection radio button :
            QueryTypeRadioButton.Init(typeof(ActDBValidation.eQueryType), SqlSelection, mAct.GetOrCreateInputParam(ActDBValidation.Fields.QueryTypeRadioButton, ActDBValidation.eQueryType.FreeSQL.ToString()), QueryType_SelectionChanged);
            checkQueryType();

            //Free SQL
            //needs to be unmarked when fixed VE issue
            SQLUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActDBValidation.Fields.SQL));

            //Read from sql file
            QueryFile.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActDBValidation.Fields.QueryFile), true, true, UCValueExpression.eBrowserType.File, "sql", BrowseQueryFile_Click, WorkSpace.Instance.SolutionRepository.SolutionFolder);

            QueryFile.ValueTextBox.TextChanged += ValueTextBox_TextChanged;

            //OLD binding and UI
            GingerCore.General.FillComboFromEnumObj(ValidationCfgComboBox, act.DBValidationType);

            //TODO: fix hard coded
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ValidationCfgComboBox, ComboBox.SelectedValueProperty, act, "DBValidationType");

            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(AppNameComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.AppName);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(DBNameComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.DBName);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(TablesComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Table);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(KeySpaceComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Keyspace);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ColumnComboBox, ComboBox.TextProperty, act, ActDBValidation.Fields.Column);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtWhere, TextBox.TextProperty, act, ActDBValidation.Fields.Where);
            GingerCore.GeneralLib.BindingHandler.ActInputValueBinding(CommitDB, CheckBox.IsCheckedProperty, mAct.GetOrCreateInputParam(ActDBValidation.Fields.CommitDB));

            KeySpaceComboBox.Items.Add(mAct.Keyspace);
            ComboAutoSelectIfOneItemOnly(KeySpaceComboBox);
            TablesComboBox.Items.Add(mAct.Table);
            ComboAutoSelectIfOneItemOnly(TablesComboBox);
            ColumnComboBox.Items.Add(mAct.Column);
            ComboAutoSelectIfOneItemOnly(ColumnComboBox);
            SetVisibleControlsForAction();
            SetQueryParamsGrid();
        }