示例#1
0
        private void ChangeGroup(TreeNode node)
        {
            if (node.Tag is FieldGroupInfo)
            {
                SectionGroupInfo m_GroupInfo = new SectionGroupInfo();

                m_GroupInfo.ColumnHeading = "New Section Group";

                m_GroupInfo.DistinctValues = false;

                node.Tag = m_GroupInfo.Copy();

                node.Text = m_GroupInfo.ToString();
            }
            else
            {
                FieldGroupInfo m_GroupInfo = new FieldGroupInfo();

                m_GroupInfo.GroupByField = Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString();

                m_GroupInfo.ColumnHeading = "New Group";

                node.Tag = m_GroupInfo.Copy();

                node.Text = m_GroupInfo.ToString();
            }


            this.C_PropertyGrid.Refresh();

            this.C_GroupInfoTree.Focus();

            this.C_PropertyGrid.SelectedObject = node.Tag;
        }
 internal void Initialize(Configuration config, SectionGroupInfo group)
 {
     if (_initialized)
     {
         throw new Exception("INTERNAL ERROR: this configuration section is being initialized twice: " +
                             GetType());
     }
     _initialized = true;
     _config      = config;
     _group       = group;
 }
示例#3
0
        //Modified at 2008-11-3 15:00:44@Scott
        private void AddSectionGroup(TreeNode node)
        {
            if (!(node.Tag is GroupInfo))
            {
                return;
            }

            SectionGroupInfo m_GroupInfo = new SectionGroupInfo();

            m_GroupInfo.ColumnHeading = "New Section Group";

            m_GroupInfo.DistinctValues = false;

            TreeNode m_Node = this.CreateGroupNode(m_GroupInfo);

            node.Nodes.Add(m_Node);
        }
示例#4
0
        private void C_ChangeGroup_Click(object sender, System.EventArgs e)
        {
            TreeNode node = this.C_GroupInfoTree.SelectedNode;

            if (node == null || !(node.Tag is GroupInfo))
            {
                return;
            }

            if (node.Tag is FieldGroupInfo)
            {
                SectionGroupInfo m_GroupInfo = new SectionGroupInfo();

                m_GroupInfo.ColumnHeading = "New Section Group";

                m_GroupInfo.DistinctValues = false;

                node.Tag = m_GroupInfo.Copy();

                node.Text = m_GroupInfo.ToString();
            }
            else
            {
                FieldGroupInfo m_GroupInfo = new FieldGroupInfo();

                m_GroupInfo.GroupByField = Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString();

                m_GroupInfo.ColumnHeading = "New Group";

                node.Tag = m_GroupInfo.Copy();

                node.Text = m_GroupInfo.ToString();
            }


            this.C_PropertyGrid.Refresh();

            this.C_GroupInfoTree.Focus();

            this.C_PropertyGrid.SelectedObject = node.Tag;
        }
示例#5
0
        //Modified at 2008-11-3 15:00:44@Scott
        private void AddSectionGroup()
        {
            TreeNode node = this.C_GroupInfoTree.SelectedNode;

            if (this.C_GroupInfoTree.Nodes.Count == 0)
            {
                SectionGroupInfo m_rootGroupInfo = new SectionGroupInfo();

                m_rootGroupInfo.ColumnHeading = "New Section Group";

                TreeNode m_rootNode = this.CreateGroupNode(m_rootGroupInfo);

                this.C_GroupInfoTree.Nodes.Add(m_rootNode);
            }

            if (node == null)
            {
                return;
            }

            if (this.HaveGroupChild(node))
            {
                MessageBox.Show("This node can only have one child group.");

                return;
            }

            if (!(node.Tag is GroupInfo))
            {
                return;
            }

            SectionGroupInfo m_GroupInfo = new SectionGroupInfo();

            m_GroupInfo.ColumnHeading = "New Section Group";

            TreeNode m_Node = this.CreateGroupNode(m_GroupInfo);

            node.Nodes.Add(m_Node);
        }
        private void CreateSectionGroupInfo(SectionFilterCollection i_Sections)
        {
            if (this._RootGroupInfo is SectionGroupInfo)
            {
                (this._RootGroupInfo as SectionGroupInfo).SetSectionFilters(i_Sections);
            }
            else
            {
                SectionGroupInfo m_SectionInfo = new SectionGroupInfo();

                m_SectionInfo.SetSectionFilters(i_Sections);

                m_SectionInfo.SubGroupInfos.Clear();

                m_SectionInfo.SubGroupInfos.Add(this._RootGroupInfo);

                this._RootGroupInfo = m_SectionInfo;
            }

            this._RootGroupInfo.ColumnHeading = this.SectionTitle;

            this._RootGroupInfo.DistinctValues = this.SectionInOneRow;
        }
示例#7
0
        private void BtnLoad_Click(object sender, EventArgs e)
        {
            if (backDataTable == null)
            {
                Webb.Utilities.MessageBoxEx.ShowError("Error datasource!");

                return;
            }

            if (UserOrderCls.RelativeGroupInfo is FieldGroupInfo)
            {
                string strField = (UserOrderCls.RelativeGroupInfo as FieldGroupInfo).GroupByField;

                if (backDataTable.Columns.Contains(strField))
                {
                    string strQuestion = "The operation would lead to reset the orders of the values\n\nContinue?";

                    if (Webb.Utilities.MessageBoxEx.ShowQuestion_YesNo(strQuestion) != DialogResult.Yes)
                    {
                        return;
                    }

                    this.LstValue.Items.Clear();

                    foreach (DataRow dr in backDataTable.Rows)
                    {
                        object objValue = dr[strField];

                        if (objValue == null || objValue is DBNull)
                        {
                            continue;
                        }

                        if (!this.LstValue.Items.Contains(objValue))
                        {
                            this.LstValue.Items.Add(objValue);
                        }
                    }
                }
            }
            else
            {
                string strQuestion = "The operation would lead to reset the orders of the values\n\nContinue?";

                if (Webb.Utilities.MessageBoxEx.ShowQuestion_YesNo(strQuestion) != DialogResult.Yes)
                {
                    return;
                }

                SectionGroupInfo sectionInfo = UserOrderCls.RelativeGroupInfo as  SectionGroupInfo;

                if (sectionInfo == null)
                {
                    return;
                }

                this.LstValue.Items.Clear();

                foreach (SectionFilter scFilter in sectionInfo.SectionFiltersWrapper.SectionFilters)
                {
                    object objValue = scFilter.FilterName;

                    if (objValue == null || objValue is DBNull)
                    {
                        continue;
                    }

                    this.LstValue.Items.Add(objValue);
                }
            }
        }
示例#8
0
        private void SetView()
        {
            this.LstValue.Items.Clear();

            foreach (object objValue in UserOrderCls.OrderValues)
            {
                this.LstValue.Items.Add(objValue);
            }

            DataSet ds = Webb.Reports.DataProvider.VideoPlayBackManager.DataSource;

            if (ds != null && ds.Tables.Count > 0)
            {
                backDataTable = ds.Tables[0];

                if (UserOrderCls.RelativeGroupInfo is FieldGroupInfo)
                {
                    #region Field Group Info

                    string strField = (UserOrderCls.RelativeGroupInfo as FieldGroupInfo).GroupByField;

                    if (backDataTable.Columns.Contains(strField))
                    {
                        #region Contains the Field

                        dataType = backDataTable.Columns[strField].DataType;

                        this.BtnLoad.Enabled = true;

                        foreach (DataRow dr in backDataTable.Rows)
                        {
                            object objValue = dr[strField];

                            if (objValue == null || objValue is DBNull)
                            {
                                continue;
                            }

                            if (!this.LstValue.Items.Contains(objValue))
                            {
                                this.LstValue.Items.Add(objValue);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        this.BtnLoad.Enabled = false;
                    }
                    #endregion
                }
                else
                {
                    #region Section Group Info

                    dataType = typeof(string);

                    this.BtnLoad.Enabled = true;



                    SectionGroupInfo sectionInfo = UserOrderCls.RelativeGroupInfo as SectionGroupInfo;

                    if (sectionInfo == null)
                    {
                        return;
                    }

                    this.LstValue.Items.Clear();

                    foreach (SectionFilter scFilter in sectionInfo.SectionFiltersWrapper.SectionFilters)
                    {
                        object objValue = scFilter.FilterName;

                        if (objValue == null || objValue is DBNull)
                        {
                            continue;
                        }

                        this.LstValue.Items.Add(objValue);
                    }
                    #endregion
                }
            }
            else
            {
                this.BtnLoad.Enabled = false;
            }
        }