private void UpdateXmlQuery()
        {
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWhereTabInNotInColumns);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWhereTabInNotInColumns);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (mainWindow.ValidateAllTabCntrls(rvc))
                {
                    SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);
                    if (queryBuilder != null)
                    {
                        queryString = queryBuilder.BuildQuery();
                    }
                    XmlSerializer SerializerObj = new XmlSerializer(typeof(SelectQueryBuilder));
                    StringWriter writer = new StringWriter();
                    SerializerObj.Serialize(writer, queryBuilder);
                    //rvc.txtQuery.Text = writer.ToString();
                    //rvc.lblActionTabErrorMessage.Content = "";
                }
                else
                {
                    //rvc.txtQuery.Text = "";
                    //rvc.lblActionTabErrorMessage.Content = "There is an error on one or more tab, please fix an error";
                }
            }
        }
 private void txtCrossTabulationTabGroupByAlias_TextChanged(object sender, TextChangedEventArgs e)
 {
     this.txtCrossTabulationTabGroupByAlias.BorderBrush = TextBoxOriginalBorderBrush;
     FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
     DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabGroupByColumnsName);
     if (parent != null)
     {
         ResultViewControl rvc = (ResultViewControl)parent;
     }
 }
 private void txtCrossTabulationTabSummaryAlias_TextChanged(object sender, TextChangedEventArgs e)
 {
     // seting the style if style is changed due to Error it changes border of the combobox
     this.txtCrossTabulationTabSummaryAlias.BorderBrush = TextBoxOriginalBorderBrush;
     FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
     DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabSummaryColumnsName);
     if (parent != null)
     {
         ResultViewControl rvc = (ResultViewControl)parent;
     }
 }
 private void cmbCrossTabulationTypeOfSummary_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     // seting the style if style is changed due to Error it changes border of the combobox
     this.cmbCrossTabulationTypeOfSummary.Style = ComboboxOriginalStyle;
     FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
     DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabSummaryColumnsName);
     if (parent != null)
     {
         ResultViewControl rvc = (ResultViewControl)parent;
     }
 }
Esempio n. 5
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            
            AddFromTabStackPanel();
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbFromTable);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.CustomQueryAccordion.LayoutChildren(true);
            }
        }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWhereTabNullNotNullColumns);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWhereTabNullNotNullColumns);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count > 0)
                {
                    DockPanel dkp = (DockPanel)btnDelete.Parent;
                    WhereTabNullNotNullConditionControl wsp = (WhereTabNullNotNullConditionControl)((Grid)((StackPanel)dkp.Parent).Parent).Parent;
                    rvc.WhereTabCntrl.StackPanelWhereTab.Children.Remove(wsp);
                    
                    if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count != 0)
                    {
                        string controlType = rvc.WhereTabCntrl.StackPanelWhereTab.Children[0].GetType().ToString();
                        switch (controlType)
                        {
                            case "FastDB.Control.WhereTabRegularConditionControl":
                                WhereTabRegularConditionControl wr = (WhereTabRegularConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wr.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wr.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabBetweenConditionControl":
                                WhereTabBetweenConditionControl wb = (WhereTabBetweenConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wb.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wb.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabInNotInConditionControl":
                                WhereTabInNotInConditionControl wInNotin = (WhereTabInNotInConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wInNotin.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wInNotin.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabNullNotNullConditionControl":
                                WhereTabNullNotNullConditionControl wNullNotNull = (WhereTabNullNotNullConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wNullNotNull.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wNullNotNull.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                        }
                    }
                }
            }
        }
 private void cmbCrossTabulationTabSummaryColumnsName_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     this.cmbCrossTabulationTabSummaryColumnsName.Style = ComboboxOriginalStyle;
     FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
     DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabSummaryColumnsName);
     if (parent != null)
     {
         if (this.cmbCrossTabulationTabSummaryColumnsName.SelectedItem != null)
         {
             this.txtCrossTabulationTabSummaryAlias.Text = this.cmbCrossTabulationTabSummaryColumnsName.SelectedItem.ToString();
             this.txtCrossTabulationTabSummaryAlias.Text = this.txtCrossTabulationTabSummaryAlias.Text.Substring(txtCrossTabulationTabSummaryAlias.Text.IndexOf('.') + 1); 
             this.txtCrossTabulationTabSummaryAlias.Text = this.txtCrossTabulationTabSummaryAlias.Text.Replace("_", " ");
             this.txtCrossTabulationTabSummaryAlias.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.txtCrossTabulationTabSummaryAlias.Text);
         }
         ResultViewControl rvc = (ResultViewControl)parent;
     }
 }
        private void cmbCrossTabulationTabGroupByColumnsName_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((SQLBuilder.Clauses.Column)this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem != null)
            {
                this.txtCrossTabulationTabGroupByColFormat.Text = ((SQLBuilder.Clauses.Column)this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem).Format;
                this.txtCrossTabulationTabGroupByAlias.Text = this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem.ToString();
                this.txtCrossTabulationTabGroupByAlias.Text = this.txtCrossTabulationTabGroupByAlias.Text.Substring(txtCrossTabulationTabGroupByAlias.Text.IndexOf('.') + 1);
                this.txtCrossTabulationTabGroupByAlias.Text = this.txtCrossTabulationTabGroupByAlias.Text.Replace("_", " ");

                this.txtCrossTabulationTabGroupByAlias.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.txtCrossTabulationTabGroupByAlias.Text);
                this.cmbCrossTabulationSort.SelectedItem = "Ascending";
            }

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabGroupByColumnsName);
            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
            }

        }
Esempio n. 9
0
        private void cmbFromTable_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.cmbFromTable.SelectedIndex > -1)
            {
                FromTabStackPanelControl fromTabSPCntrl = new FromTabStackPanelControl();
                DependencyObject         parent         = fromTabSPCntrl.GetRVC(this.cmbFromTable);

                if (parent != null)
                {
                    ResultViewControl rvc = (ResultViewControl)parent;
                    fromTabSPCntrl.UpdateAllControls(rvc);
                    rvc.SelectTabCntrl._SelectedColCollection.Clear();
                }
                this.cmbFromTable.Style = ComboboxOriginalStyle;
                for (int i = 0; i < this.StackPanelFromTab.Children.Count; i++)
                {
                    FromTabStackPanelControl fs1 = (FromTabStackPanelControl)this.StackPanelFromTab.Children[i];
                    LoadFromTableColumnComboBox(fs1);
                }
            }
        }
Esempio n. 10
0
        private void cmbCrossTabulationTabGroupByColumnsName_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((SQLBuilder.Clauses.Column) this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem != null)
            {
                this.txtCrossTabulationTabGroupByColFormat.Text = ((SQLBuilder.Clauses.Column) this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem).Format;
                this.txtCrossTabulationTabGroupByAlias.Text     = this.cmbCrossTabulationTabGroupByColumnsName.SelectedItem.ToString();
                this.txtCrossTabulationTabGroupByAlias.Text     = this.txtCrossTabulationTabGroupByAlias.Text.Substring(txtCrossTabulationTabGroupByAlias.Text.IndexOf('.') + 1);
                this.txtCrossTabulationTabGroupByAlias.Text     = this.txtCrossTabulationTabGroupByAlias.Text.Replace("_", " ");

                this.txtCrossTabulationTabGroupByAlias.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.txtCrossTabulationTabGroupByAlias.Text);
                this.cmbCrossTabulationSort.SelectedItem    = "Ascending";
            }

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabGroupByColumnsName);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
            }
        }
Esempio n. 11
0
        private void btnRemove_Click(object sender, RoutedEventArgs e)
        {
            if (this._SelectedColCollection.Count == 0)
            {
                this.lblErrorMessage.Content = "Please select column(s)";
            }

            int count = this.lstSelectedCol.SelectedItems.Count;

            for (int i = 0; i < count; i++)
            {
                Column col = (Column)this.lstSelectedCol.SelectedItems[0];
                _SelectedColCollection.Remove(col);
            }
            this.lstToSelecteColFrom.SelectedIndex = -1;
            this.lstSelectedCol.SelectedIndex      = -1;

            if (_SelectedColCollection.Count <= 11 && isExpanded == true)
            {
                SelectedColsStackPanel.Width -= 16;
                isExpanded = false;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/
        }
Esempio n. 12
0
        private List<string> GetColumnsFromAllFromTabTable()
        {
            List<string> list = new List<string>();
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWherTabCondition);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);  //get resultview control containing cmbWherTabCondition

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                //get the From table columns 
                if (mainWindow.listOfTable != null & mainWindow.listOfTable.Count > 0)
                {
                    List<string> fc = GetFromTableColums(mainWindow.listOfTable[rvc.FromTabCntrl.cmbFromTable.SelectedIndex].columns, rvc.FromTabCntrl.txtFromAlias.Text);

                    if (fc != null)
                    {
                        list.AddRange(fc);
                    }
                }

                if (rvc.FromTabCntrl.StackPanelFromTab.Children.Count > 0)
                {
                    for (int i = 0; i < rvc.FromTabCntrl.StackPanelFromTab.Children.Count; i++)
                    {
                        FromTabStackPanelControl fs = (FromTabStackPanelControl)rvc.FromTabCntrl.StackPanelFromTab.Children[i];

                        List<string> jc = GetJoinTableColums((List<string>)fs.cmbFromTabJoinColumns.ItemsSource, fs.txtJoinTableAlias.Text);
                        if (jc != null)
                        {
                            list.AddRange(jc);
                        }
                    }
                }
            }
            return list;
        }
Esempio n. 13
0
        private List <string> GetColumnsFromAllFromTabTable()
        {
            List <string>            list                   = new List <string>();
            MainWindow               mainWindow             = (MainWindow)GetTopLevelControl(this.cmbWherTabCondition);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent                 = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition); //get resultview control containing cmbWherTabCondition

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                //get the From table columns
                if (mainWindow.listOfTable != null & mainWindow.listOfTable.Count > 0)
                {
                    List <string> fc = GetFromTableColums(mainWindow.listOfTable[rvc.FromTabCntrl.cmbFromTable.SelectedIndex].columns, rvc.FromTabCntrl.txtFromAlias.Text);

                    if (fc != null)
                    {
                        list.AddRange(fc);
                    }
                }

                if (rvc.FromTabCntrl.StackPanelFromTab.Children.Count > 0)
                {
                    for (int i = 0; i < rvc.FromTabCntrl.StackPanelFromTab.Children.Count; i++)
                    {
                        FromTabStackPanelControl fs = (FromTabStackPanelControl)rvc.FromTabCntrl.StackPanelFromTab.Children[i];

                        List <string> jc = GetJoinTableColums((List <string>)fs.cmbFromTabJoinColumns.ItemsSource, fs.txtJoinTableAlias.Text);
                        if (jc != null)
                        {
                            list.AddRange(jc);
                        }
                    }
                }
            }
            return(list);
        }
Esempio n. 14
0
        private void cmbTabulationTabSummaryColumnsName_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // seting the style if style is changed due to Error it changes border of the combobox
            this.cmbTabulationTabSummaryColumnsName.Style = ComboboxOriginalStyle;

            /****************************************************/
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.cmbTabulationTabSummaryColumnsName);

            if (parent != null)
            {
                if (this.cmbTabulationTabSummaryColumnsName.SelectedItem != null)
                {
                    this.txtTabulationTabSummaryAlias.Text = this.cmbTabulationTabSummaryColumnsName.SelectedItem.ToString();
                    this.txtTabulationTabSummaryAlias.Text = this.txtTabulationTabSummaryAlias.Text.Substring(txtTabulationTabSummaryAlias.Text.IndexOf('.') + 1);
                    this.txtTabulationTabSummaryAlias.Text = this.txtTabulationTabSummaryAlias.Text.Replace("_", " ");
                    this.txtTabulationTabSummaryAlias.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.txtTabulationTabSummaryAlias.Text);
                }

                ResultViewControl rvc = (ResultViewControl)parent;
            }
            /****************************************************/
        }
Esempio n. 15
0
        private List <string> GetColumnsFromAllFromTabTable()
        {
            List <string>            list                   = new List <string>();
            MainWindow               mainWindow             = (MainWindow)GetTopLevelControl(this.ComputedColFormatComboBox);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent                 = fromTabStackPanelCntrl.GetRVC(this.ComputedColFormatComboBox); //get resultview control containing cmbWherTabCondition

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                //get the From table columns
                if (mainWindow.listOfTable != null & mainWindow.listOfTable.Count > 0)
                {
                    List <string> fc = GetFromTableColums(mainWindow.listOfTable[rvc.FromTabCntrl.cmbFromTable.SelectedIndex].columns, rvc.FromTabCntrl.txtFromAlias.Text);

                    if (fc != null)
                    {
                        list.AddRange(fc);
                    }
                }
            }
            return(list);
        }
Esempio n. 16
0
        private void AddAllBtn_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstToSelecteColFrom);

            _SelectedColCollection.Clear();

            foreach (Column col in this.lstToSelecteColFrom.Items)
            {
                IEnumerable <Column> columns = _SelectedColCollection.Where(x => x.Name == col.Name & x.AliasName == col.AliasName);
                if (columns.Count() == 0)
                {
                    _SelectedColCollection.Add(col);
                }
            }

            if (_SelectedColCollection.Count > 11 && isExpanded == false)
            {
                SelectedColsStackPanel.Width += 16;
                isExpanded = true;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
            }
            /**************************************/
        }
Esempio n. 17
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < this.lstToSelecteColFrom.SelectedItems.Count; i++)
            {
                Column col = (Column)this.lstToSelecteColFrom.SelectedItems[i];
                //check if alias already exist
                IEnumerable<Column> columnsWithSameAlias = _SelectedColCollection.Where(x => x.AliasName == col.AliasName);
                if (columnsWithSameAlias.Count() == 0)
                {
                    //check if column alreadyexist
                    IEnumerable<Column> columns = _SelectedColCollection.Where(x => x.Name == col.Name & x.AliasName == col.AliasName);
                    if (columns.Count() == 0)
                    {
                        _SelectedColCollection.Add(col);
                    }
                    else
                    {
                        System.Media.SystemSounds.Beep.Play();
                    }
                }
                else
                {
                    System.Media.SystemSounds.Beep.Play();
                }
            }

            if (this.lstToSelecteColFrom.SelectedIndex == -1)
            {
                Column computedCol = new Column();
                computedCol.Name = ComputedColExpTxtBox.Text;
                computedCol.AliasName = "";
                if (ComputedColFormatComboBox.SelectedValue.ToString() != "Select One")
                    computedCol.Format = ComputedColFormatComboBox.SelectedValue.ToString();
                else
                    computedCol.Format = "NO";

                if (computedCol != null)
                {
                    if (computedCol.Name != System.String.Empty & computedCol.AliasName != System.String.Empty)
                    {
                        IEnumerable<Column> columnsWithSameAlias = _SelectedColCollection.Where(x => x.AliasName == computedCol.AliasName);
                        if (columnsWithSameAlias.Count() == 0)
                        {
                            IEnumerable<Column> columns = _SelectedColCollection.Where(x => x.Name == computedCol.Name & x.AliasName == computedCol.AliasName);
                            if (columns.Count() == 0)
                            {
                                _SelectedColCollection.Add(computedCol);
                            }
                            else
                            {
                                System.Media.SystemSounds.Beep.Play();
                            }
                        }
                        else
                        {
                            System.Media.SystemSounds.Beep.Play();
                        }
                    }
                }

            }

            if (_SelectedColCollection.Count > 11 && isExpanded == false)
            {
                SelectedColsStackPanel.Width += 16;
                isExpanded = true;
            }

            this.lstToSelecteColFrom.SelectedIndex = -1;
            this.lstSelectedCol.SelectedIndex = -1;
            if (this._SelectedColCollection.Count > 0)
            {
                this.lblErrorMessage.Content = "";
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /************Update query**************/
            //UpdateXmlQuery();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/

            /*****************To Enable Save***********/
            //FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            //DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            //if (parent != null)
            //{
            //    ResultViewControl rvc = (ResultViewControl)parent;
            //    string directoryPath = rvc.result.directoryPath;

            //    //MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            //    //SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);

            //    //MainGirdViewControl mainGridView1 = new MainGirdViewControl(queryBuilder, mainWindow.CurrentDatabaseName);
            //    //rvc.result = mainGridView1.result;
            //    rvc.result.isModified = true;
            //    rvc.result.isNew = false;
            //    rvc.result.directoryPath = directoryPath;
            //}
            /********************************************/
        }
Esempio n. 18
0
        private void UpdateXmlQuery()
        {
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (mainWindow.ValidateAllTabCntrls(rvc))
                {
                    SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);
                    if (queryBuilder != null)
                    {
                        queryString = queryBuilder.BuildQuery();
                    }
                    XmlSerializer SerializerObj = new XmlSerializer(typeof(SelectQueryBuilder));
                    StringWriter writer = new StringWriter();
                    SerializerObj.Serialize(writer, queryBuilder);
                }
                else
                {
                    
                }
            }
        }
Esempio n. 19
0
        private void lstToSelecteColFrom_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var col = ((FrameworkElement)e.OriginalSource).DataContext as Column;
            if (col != null)
            {
                IEnumerable<Column> columns = _SelectedColCollection.Where(x => x.Name == col.Name && x.AliasName == col.AliasName);
                if (columns.Count() == 0)
                {
                    IEnumerable<Column> columnsWithSameAlias = _SelectedColCollection.Where(x => x.AliasName == col.AliasName);
                    if (columnsWithSameAlias.Count() == 0)
                    {
                        _SelectedColCollection.Add(col);
                    }
                    else
                    {
                        MessageBox.Show("Duplicate Alias");
                    }
                }
                else
                {
                    MessageBox.Show("Duplicate Column");
                }
                this.lstToSelecteColFrom.SelectedIndex = -1;
            }

            if (_SelectedColCollection.Count > 11 && isExpanded == false)
            {
                SelectedColsStackPanel.Width += 16;
                isExpanded = true;
            }

            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            
        }
Esempio n. 20
0
        private void AddRegularConditionRow()
        {
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);
            ResultViewControl rvc = null;

            if (parent != null)
            {
                rvc = (ResultViewControl)parent;
            }

            WhereTabRegularConditionControl ws = new WhereTabRegularConditionControl();
            ws.Name = "Fs1";
            ws.cmbWhereTabQueryLevel.SelectedIndex = 0;
            ws.cmbWhereTabQueryAndOr.SelectedIndex = 0;
            ////** Check for AllDisabled
            if (isAllDisabled)
            {
                this.lblErrorMessage.Content = "";
                ws.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                ws.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
            }
            ws.btnDelete.Visibility = System.Windows.Visibility.Visible;
            LoadColumnComboBox(ws);
            this.StackPanelWhereTab.Children.Add(ws);
        }
Esempio n. 21
0
        private void btnRemove_Click(object sender, RoutedEventArgs e)
        {
            if (this._SelectedColCollection.Count == 0)
            {
                this.lblErrorMessage.Content = "Please select column(s)";
            }

            int count = this.lstSelectedCol.SelectedItems.Count;

            for (int i = 0; i < count; i++)
            {
                Column col = (Column)this.lstSelectedCol.SelectedItems[0];
                _SelectedColCollection.Remove(col);
            }
            this.lstToSelecteColFrom.SelectedIndex = -1;
            this.lstSelectedCol.SelectedIndex = -1;

            if (_SelectedColCollection.Count <= 11 && isExpanded == true)
            {
                SelectedColsStackPanel.Width -= 16;
                isExpanded = false;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/
        }
Esempio n. 22
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            whereborder.Visibility = System.Windows.Visibility.Visible;
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWherTabCondition);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.FromTabCntrl.isValidated)
                {
                    this.lblErrorMessage.Content = "";

                    //validate before adding stack panel row
                    Validate();
                    //** Check for AllDisabled
                    SetIsAllDisabled();
                    //***Add condition control
                    if (this.cmbWherTabCondition.SelectedIndex != -1)
                    {
                        switch (this.cmbWherTabCondition.Text)
                        {
                            case "Regular":
                                AddRegularConditionRow();
                                break;
                            case "Between":
                                AddBetweenConditionRow();
                                break;
                            case "In":
                                AddInNotInConditionRow();
                                break;
                            case "Not In":
                                AddInNotInConditionRow();
                                break;
                            case "Null":
                                AddNullNotNullConditionRow();
                                break;
                            case "Not Null":
                                AddNullNotNullConditionRow();
                                break;
                        }
                    }
                    Size size = new Size(1200, 500);
                }
                else
                {
                    this.lblErrorMessage.Content = "********There is an error on From Tab**********";
                    rvc.lblXmlQueryTabErrorMessage.Content = "There is an error in one of Tabs";
                }
            }
        }
Esempio n. 23
0
        private List<string> GetColumnsFromAllFromTabTable()
        {
            List<string> list = new List<string>();
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.ComputedColFormatComboBox);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.ComputedColFormatComboBox);  //get resultview control containing cmbWherTabCondition

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                //get the From table columns 
                if (mainWindow.listOfTable != null & mainWindow.listOfTable.Count > 0)
                {
                    List<string> fc = GetFromTableColums(mainWindow.listOfTable[rvc.FromTabCntrl.cmbFromTable.SelectedIndex].columns, rvc.FromTabCntrl.txtFromAlias.Text);

                    if (fc != null)
                    {
                        list.AddRange(fc);
                    }
                }

            }
            return list;
        }
Esempio n. 24
0
        private void AddAllBtn_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstToSelecteColFrom);
            _SelectedColCollection.Clear();
           
            foreach (Column col in this.lstToSelecteColFrom.Items)
            {
                IEnumerable<Column> columns = _SelectedColCollection.Where(x => x.Name == col.Name & x.AliasName == col.AliasName);
                if (columns.Count() == 0)
                {
                    _SelectedColCollection.Add(col);
                }
            }

            if (_SelectedColCollection.Count > 11 && isExpanded == false)
            {
                SelectedColsStackPanel.Width += 16;
                isExpanded = true;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/
            
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                
            }
            /**************************************/
        }
Esempio n. 25
0
        private void cmbFromTable_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.cmbFromTable.SelectedIndex > -1)
            {
                FromTabStackPanelControl fromTabSPCntrl = new FromTabStackPanelControl();
                DependencyObject parent = fromTabSPCntrl.GetRVC(this.cmbFromTable);

                if (parent != null)
                {
                    ResultViewControl rvc = (ResultViewControl)parent;
                    fromTabSPCntrl.UpdateAllControls(rvc);
                    rvc.SelectTabCntrl._SelectedColCollection.Clear();
                }
                this.cmbFromTable.Style = ComboboxOriginalStyle;
                for (int i = 0; i < this.StackPanelFromTab.Children.Count; i++)
                {
                    FromTabStackPanelControl fs1 = (FromTabStackPanelControl)this.StackPanelFromTab.Children[i];
                    LoadFromTableColumnComboBox(fs1);
                }
            }
        }
Esempio n. 26
0
        private void StackPanelWhereTab_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.CustomQueryAccordion.LayoutChildren(true);
            }
        }
Esempio n. 27
0
        private void DockPanel_GotFocus(object sender, RoutedEventArgs e)
        {
            bool isEqual = true;
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWherTabCondition);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.FromTabCntrl.isValidated)
                {
                    for (int i = 0; i < this.StackPanelWhereTab.Children.Count; i++)
                    {
                        string controlType = this.StackPanelWhereTab.Children[i].GetType().ToString();
                        switch (controlType)
                        {
                            case "FastDB.Control.WhereTabRegularConditionControl":
                                WhereTabRegularConditionControl ws = (WhereTabRegularConditionControl)this.StackPanelWhereTab.Children[i];
                                List<string> listofRegCol = GetColumnsFromAllFromTabTable();
                                isEqual = (listofRegCol.SequenceEqual((List<string>)ws.cmbWhereTabLeftSideColumns.ItemsSource));
                                if (isEqual == false)
                                {
                                    ReLoadColumnComboBox(ws);
                                }
                                break;
                            case "FastDB.Control.WhereTabBetweenConditionControl":
                                WhereTabBetweenConditionControl wsb = (WhereTabBetweenConditionControl)this.StackPanelWhereTab.Children[i];
                                isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List<string>)wsb.cmbWhereTabBetweenColumns.ItemsSource));
                                if (isEqual == false)
                                {
                                    ReLoadColumnComboBox(wsb);
                                }
                                break;
                            case "FastDB.Control.WhereTabInNotInConditionControl":
                                WhereTabInNotInConditionControl wInNotIn = (WhereTabInNotInConditionControl)this.StackPanelWhereTab.Children[i];
                                isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List<string>)wInNotIn.cmbWhereTabInNotInColumns.ItemsSource));
                                if (isEqual == false)
                                {
                                    ReLoadColumnComboBox(wInNotIn);
                                }
                                break;
                            case "FastDB.Control.WhereTabNullNotNullConditionControl":
                                WhereTabNullNotNullConditionControl wNullNotNull = (WhereTabNullNotNullConditionControl)this.StackPanelWhereTab.Children[i];
                                isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List<string>)wNullNotNull.cmbWhereTabNullNotNullColumns.ItemsSource));
                                if (isEqual == false)
                                {
                                    ReLoadColumnComboBox(wNullNotNull);
                                }
                                break;
                        }


                    }
                }
                else
                {
                    this.lblErrorMessage.Content = "********There is an error on From Tab**********";
                    SetWhereTabRowControlDisabled();
                }
            }
        }
Esempio n. 28
0
        private void lstSelectedCol_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var col = ((FrameworkElement)e.OriginalSource).DataContext as Column;

            if (col != null)
            {
                _SelectedColCollection.Remove(col);
            }

            if (_SelectedColCollection.Count <= 11 && isExpanded == true)
            {
                SelectedColsStackPanel.Width -= 16;
                isExpanded = false;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/
        }
Esempio n. 29
0
        private void txtFromAlias_LostFocus(object sender, RoutedEventArgs e)
        {
            FromTabStackPanelControl fromTabSPCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabSPCntrl.GetRVC(this.cmbFromTable);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                fromTabSPCntrl.UpdateAllControls(rvc);
                rvc.SelectTabCntrl.ColsToSelectAcc.LayoutChildren(true);
            }
        }
Esempio n. 30
0
        private void RemoveAllBtn_Click(object sender, RoutedEventArgs e)
        {
            _SelectedColCollection.Clear();
            if (_SelectedColCollection.Count <= 11 && isExpanded == true)
            {
                SelectedColsStackPanel.Width -= 16;
                isExpanded = false;
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /*****Update Cross Tabulation and Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/
        }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            Button btnDelete = (Button)sender;
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWhereTabLeftSideColumns);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbWhereTabLeftSideColumns);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count > 0)
                {
                    DockPanel dkp = (DockPanel)btnDelete.Parent;
                    WhereTabRegularConditionControl fsp = (WhereTabRegularConditionControl)((Grid)((StackPanel)dkp.Parent).Parent).Parent;
                    rvc.WhereTabCntrl.StackPanelWhereTab.Children.Remove(fsp);
                    
                    if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count != 0)
                    {
                        string controlType = rvc.WhereTabCntrl.StackPanelWhereTab.Children[0].GetType().ToString();
                        switch (controlType)
                        {
                            case "FastDB.Control.WhereTabRegularConditionControl":
                                WhereTabRegularConditionControl wr = (WhereTabRegularConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wr.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wr.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabBetweenConditionControl":
                                WhereTabBetweenConditionControl wb = (WhereTabBetweenConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wb.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wb.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabInNotInConditionControl":
                                WhereTabInNotInConditionControl wInNotin = (WhereTabInNotInConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wInNotin.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wInNotin.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                            case "FastDB.Control.WhereTabNullNotNullConditionControl":
                                WhereTabNullNotNullConditionControl wNullNotNull = (WhereTabNullNotNullConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                                wNullNotNull.lblLogicalOpreator.Visibility = System.Windows.Visibility.Hidden;
                                wNullNotNull.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                                break;
                        }
                    }
                }
                /**********Update Xml Query*********/
                if (mainWindow.ValidateAllTabCntrls(rvc))
                {
                    SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);
                    if (queryBuilder != null)
                    {
                        queryString = queryBuilder.BuildQuery();
                    }
                    XmlSerializer SerializerObj = new XmlSerializer(typeof(SelectQueryBuilder));
                    StringWriter writer = new StringWriter();
                    SerializerObj.Serialize(writer, queryBuilder);
                }
                else
                {
                    
                }
                /************************************/
            }
        }
 private void cmbCrossTabulationTabUserSelectSummaryColFormat_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.cmbCrossTabulationTabUserSelectSummaryColFormat.SelectedIndex != -1)
     {
         this.txtCrossTabulationTabSummaryColFormat.Text = this.cmbCrossTabulationTabUserSelectSummaryColFormat.SelectedValue.ToString();
     }
     FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
     DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.cmbCrossTabulationTabSummaryColumnsName);
     if (parent != null)
     {
         ResultViewControl rvc = (ResultViewControl)parent;
     }
 }
Esempio n. 33
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < this.lstToSelecteColFrom.SelectedItems.Count; i++)
            {
                Column col = (Column)this.lstToSelecteColFrom.SelectedItems[i];
                //check if alias already exist
                IEnumerable <Column> columnsWithSameAlias = _SelectedColCollection.Where(x => x.AliasName == col.AliasName);
                if (columnsWithSameAlias.Count() == 0)
                {
                    //check if column alreadyexist
                    IEnumerable <Column> columns = _SelectedColCollection.Where(x => x.Name == col.Name & x.AliasName == col.AliasName);
                    if (columns.Count() == 0)
                    {
                        _SelectedColCollection.Add(col);
                    }
                    else
                    {
                        System.Media.SystemSounds.Beep.Play();
                    }
                }
                else
                {
                    System.Media.SystemSounds.Beep.Play();
                }
            }

            if (this.lstToSelecteColFrom.SelectedIndex == -1)
            {
                Column computedCol = new Column();
                computedCol.Name      = ComputedColExpTxtBox.Text;
                computedCol.AliasName = "";
                if (ComputedColFormatComboBox.SelectedValue.ToString() != "Select One")
                {
                    computedCol.Format = ComputedColFormatComboBox.SelectedValue.ToString();
                }
                else
                {
                    computedCol.Format = "NO";
                }

                if (computedCol != null)
                {
                    if (computedCol.Name != System.String.Empty & computedCol.AliasName != System.String.Empty)
                    {
                        IEnumerable <Column> columnsWithSameAlias = _SelectedColCollection.Where(x => x.AliasName == computedCol.AliasName);
                        if (columnsWithSameAlias.Count() == 0)
                        {
                            IEnumerable <Column> columns = _SelectedColCollection.Where(x => x.Name == computedCol.Name & x.AliasName == computedCol.AliasName);
                            if (columns.Count() == 0)
                            {
                                _SelectedColCollection.Add(computedCol);
                            }
                            else
                            {
                                System.Media.SystemSounds.Beep.Play();
                            }
                        }
                        else
                        {
                            System.Media.SystemSounds.Beep.Play();
                        }
                    }
                }
            }

            if (_SelectedColCollection.Count > 11 && isExpanded == false)
            {
                SelectedColsStackPanel.Width += 16;
                isExpanded = true;
            }

            this.lstToSelecteColFrom.SelectedIndex = -1;
            this.lstSelectedCol.SelectedIndex      = -1;
            if (this._SelectedColCollection.Count > 0)
            {
                this.lblErrorMessage.Content = "";
            }
            /***********Validate Control***********/
            Validate();
            /**************************************/

            /************Update query**************/
            //UpdateXmlQuery();
            /**************************************/

            /*****Update Cross Tabulation**********/
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;
                rvc.UpdateCrossTabulationTabCntrl(mainWindow);
                rvc.UpdateTabulationTabCntrl(mainWindow);
            }
            /**************************************/

            /*****************To Enable Save***********/
            //FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            //DependencyObject parent = fromTabStackPanelCntrl.GetRVC(this.lstSelectedCol);

            //if (parent != null)
            //{
            //    ResultViewControl rvc = (ResultViewControl)parent;
            //    string directoryPath = rvc.result.directoryPath;

            //    //MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.lstSelectedCol);
            //    //SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);

            //    //MainGirdViewControl mainGridView1 = new MainGirdViewControl(queryBuilder, mainWindow.CurrentDatabaseName);
            //    //rvc.result = mainGridView1.result;
            //    rvc.result.isModified = true;
            //    rvc.result.isNew = false;
            //    rvc.result.directoryPath = directoryPath;
            //}
            /********************************************/
        }
Esempio n. 34
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            Button     btnDelete  = (Button)sender;
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWhereTabLeftSideColumns);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.cmbWhereTabLeftSideColumns);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count > 0)
                {
                    DockPanel dkp = (DockPanel)btnDelete.Parent;
                    WhereTabRegularConditionControl fsp = (WhereTabRegularConditionControl)((Grid)((StackPanel)dkp.Parent).Parent).Parent;
                    rvc.WhereTabCntrl.StackPanelWhereTab.Children.Remove(fsp);

                    if (rvc.WhereTabCntrl.StackPanelWhereTab.Children.Count != 0)
                    {
                        string controlType = rvc.WhereTabCntrl.StackPanelWhereTab.Children[0].GetType().ToString();
                        switch (controlType)
                        {
                        case "FastDB.Control.WhereTabRegularConditionControl":
                            WhereTabRegularConditionControl wr = (WhereTabRegularConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                            wr.lblLogicalOpreator.Visibility    = System.Windows.Visibility.Hidden;
                            wr.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                            break;

                        case "FastDB.Control.WhereTabBetweenConditionControl":
                            WhereTabBetweenConditionControl wb = (WhereTabBetweenConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                            wb.lblLogicalOpreator.Visibility    = System.Windows.Visibility.Hidden;
                            wb.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                            break;

                        case "FastDB.Control.WhereTabInNotInConditionControl":
                            WhereTabInNotInConditionControl wInNotin = (WhereTabInNotInConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                            wInNotin.lblLogicalOpreator.Visibility    = System.Windows.Visibility.Hidden;
                            wInNotin.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                            break;

                        case "FastDB.Control.WhereTabNullNotNullConditionControl":
                            WhereTabNullNotNullConditionControl wNullNotNull = (WhereTabNullNotNullConditionControl)(rvc.WhereTabCntrl.StackPanelWhereTab.Children[0]);
                            wNullNotNull.lblLogicalOpreator.Visibility    = System.Windows.Visibility.Hidden;
                            wNullNotNull.cmbWhereTabQueryAndOr.Visibility = System.Windows.Visibility.Hidden;
                            break;
                        }
                    }
                }
                /**********Update Xml Query*********/
                if (mainWindow.ValidateAllTabCntrls(rvc))
                {
                    SelectQueryBuilder queryBuilder = mainWindow.LoadSelectQueryBuilderNew(rvc);
                    if (queryBuilder != null)
                    {
                        queryString = queryBuilder.BuildQuery();
                    }
                    XmlSerializer SerializerObj = new XmlSerializer(typeof(SelectQueryBuilder));
                    StringWriter  writer        = new StringWriter();
                    SerializerObj.Serialize(writer, queryBuilder);
                }
                else
                {
                }
                /************************************/
            }
        }
Esempio n. 35
0
        private void DockPanel_GotFocus(object sender, RoutedEventArgs e)
        {
            bool       isEqual    = true;
            MainWindow mainWindow = (MainWindow)GetTopLevelControl(this.cmbWherTabCondition);

            FromTabStackPanelControl fromTabStackPanelCntrl = new FromTabStackPanelControl();
            DependencyObject         parent = fromTabStackPanelCntrl.GetRVC(this.cmbWherTabCondition);

            if (parent != null)
            {
                ResultViewControl rvc = (ResultViewControl)parent;

                if (rvc.FromTabCntrl.isValidated)
                {
                    for (int i = 0; i < this.StackPanelWhereTab.Children.Count; i++)
                    {
                        string controlType = this.StackPanelWhereTab.Children[i].GetType().ToString();
                        switch (controlType)
                        {
                        case "FastDB.Control.WhereTabRegularConditionControl":
                            WhereTabRegularConditionControl ws = (WhereTabRegularConditionControl)this.StackPanelWhereTab.Children[i];
                            List <string> listofRegCol         = GetColumnsFromAllFromTabTable();
                            isEqual = (listofRegCol.SequenceEqual((List <string>)ws.cmbWhereTabLeftSideColumns.ItemsSource));
                            if (isEqual == false)
                            {
                                ReLoadColumnComboBox(ws);
                            }
                            break;

                        case "FastDB.Control.WhereTabBetweenConditionControl":
                            WhereTabBetweenConditionControl wsb = (WhereTabBetweenConditionControl)this.StackPanelWhereTab.Children[i];
                            isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List <string>)wsb.cmbWhereTabBetweenColumns.ItemsSource));
                            if (isEqual == false)
                            {
                                ReLoadColumnComboBox(wsb);
                            }
                            break;

                        case "FastDB.Control.WhereTabInNotInConditionControl":
                            WhereTabInNotInConditionControl wInNotIn = (WhereTabInNotInConditionControl)this.StackPanelWhereTab.Children[i];
                            isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List <string>)wInNotIn.cmbWhereTabInNotInColumns.ItemsSource));
                            if (isEqual == false)
                            {
                                ReLoadColumnComboBox(wInNotIn);
                            }
                            break;

                        case "FastDB.Control.WhereTabNullNotNullConditionControl":
                            WhereTabNullNotNullConditionControl wNullNotNull = (WhereTabNullNotNullConditionControl)this.StackPanelWhereTab.Children[i];
                            isEqual = (GetColumnsFromAllFromTabTable().SequenceEqual((List <string>)wNullNotNull.cmbWhereTabNullNotNullColumns.ItemsSource));
                            if (isEqual == false)
                            {
                                ReLoadColumnComboBox(wNullNotNull);
                            }
                            break;
                        }
                    }
                }
                else
                {
                    this.lblErrorMessage.Content = "********There is an error on From Tab**********";
                    SetWhereTabRowControlDisabled();
                }
            }
        }