Example #1
0
        private void bt_DelGroup_ItemClick(object sender, ItemClickEventArgs e)
        {
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_InputModel_ColumnGroup)
            {
                MD_InputModel_ColumnGroup _group = _selectedObj as MD_InputModel_ColumnGroup;

                if (DAConfig.DataAccess.DelInputModelColumnGroup(_group.ModelID, _group.GroupID))
                {
                    TreeListNode _pnode = this.treeList1.FocusedNode.ParentNode;
                    _pnode.Nodes.Clear();
                    MD_Title      _title    = _pnode.GetValue(this.treeListColumn1) as MD_Title;
                    MD_InputModel _oldModel = _title.FatherObj as MD_InputModel;
                    MD_InputModel _model    = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName));
                    _title.FatherObj   = _model;
                    _pnode.HasChildren = true;
                    _pnode.Expanded    = false;
                }
                else
                {
                    XtraMessageBox.Show("删除分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #2
0
        private void bt_AddChild_ItemClick(object sender, ItemClickEventArgs e)
        {
            //添加子录入模型
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_Title)
            {
                MD_Title      _title     = _selectedObj as MD_Title;
                MD_InputModel _mainModel = _title.FatherObj as MD_InputModel;

                Dialog_AddChildModel _f = new Dialog_AddChildModel();
                if (_f.ShowDialog() == DialogResult.OK)
                {
                    MD_InputModel _childModel = _f.ChildModel;

                    if (DAConfig.DataAccess.AddChildInputModel(_mainModel.ID, _childModel.ID))
                    {
                        MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _mainModel.NameSpace, _mainModel.ModelName));
                        _title.FatherObj = _model;
                        this.treeList1.FocusedNode.Nodes.Clear();
                        this.treeList1.FocusedNode.HasChildren = true;
                        this.treeList1.FocusedNode.Expanded    = false;
                    }
                }
            }
        }
Example #3
0
        private void barButtonItem9_ItemClick(object sender, ItemClickEventArgs e)
        {
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_Title)
            {
                MD_Title      _title    = _selectedObj as MD_Title;
                MD_InputModel _oldModel = _title.FatherObj as MD_InputModel;
                if (_title.TitleType == "MD_SAVEDEFINE")
                {
                    Dialog_AddSaveTable _f = new Dialog_AddSaveTable();
                    if (_f.ShowDialog() == DialogResult.OK)
                    {
                        if (DAConfig.DataAccess.AddNewInputModelSavedTable(_oldModel.ID, _f.TableName))
                        {
                            MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName));
                            _title.FatherObj = _model;
                            this.treeList1.FocusedNode.Nodes.Clear();
                            this.treeList1.FocusedNode.HasChildren = true;
                            this.treeList1.FocusedNode.Expanded    = false;
                        }
                    }
                }
            }
        }
Example #4
0
        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            object _selectedObj = FocusedItem;

            if (_selectedObj is MD_Title)
            {
                MD_Title      _title    = _selectedObj as MD_Title;
                MD_InputModel _oldModel = _title.FatherObj as MD_InputModel;
                if (_title.TitleType == "MD_INPUTCOLUMES")
                {
                    MD_InputModel_ColumnGroup _group = MenuController.AddInputGroup(_title.FatherObj as MD_InputModel);
                    if (_group != null)
                    {
                        MD_InputModel _model = DAConfig.QueryDataAccess.GetInputModelByName(string.Format("{0}.{1}", _oldModel.NameSpace, _oldModel.ModelName));
                        _title.FatherObj = _model;
                        this.treeList1.FocusedNode.Nodes.Clear();
                        this.treeList1.FocusedNode.HasChildren = true;
                        this.treeList1.FocusedNode.Expanded    = false;
                    }
                    else
                    {
                        XtraMessageBox.Show("添加分组失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #5
0
        private void LoadInputModelDetial(TreeListNode _fnode, MD_InputModel _model)
        {
            MD_Title     _title;
            TreeListNode _node;

            _fnode.Nodes.Clear();

            _title = new MD_Title("录入界面字段定义", "MD_INPUTCOLUMES", _model);
            _node  = treeList1.AppendNode(null, _fnode);
            _node.SetValue(this.treeListColumn1, _title);
            _node.HasChildren      = true;
            _node.ImageIndex       = 5;
            _node.SelectImageIndex = 0;

            _title = new MD_Title("写入表定义", "MD_SAVEDEFINE", _model);
            _node  = treeList1.AppendNode(null, _fnode);
            _node.SetValue(this.treeListColumn1, _title);
            _node.HasChildren      = true;
            _node.ImageIndex       = 4;
            _node.SelectImageIndex = 0;

            _title = new MD_Title("子记录录入模型", "MD_CHILDDEFINE", _model);
            _node  = treeList1.AppendNode(null, _fnode);
            _node.SetValue(this.treeListColumn1, _title);
            _node.HasChildren      = true;
            _node.ImageIndex       = 6;
            _node.SelectImageIndex = 0;
        }
Example #6
0
        private void LoadInputModelColumnGroup(TreeListNode _fnode, MD_InputModel _model)
        {
            TreeListNode _node;

            _fnode.Nodes.Clear();

            MD_Title _title = new MD_Title("无分组", "MD_INPUTGROUP", _model);

            _node = treeList1.AppendNode(null, _fnode);
            _node.SetValue(this.treeListColumn1, _title);
            _node.HasChildren      = false;
            _node.ImageIndex       = 7;
            _node.SelectImageIndex = 0;

            if (_model.Groups != null)
            {
                foreach (MD_InputModel_ColumnGroup _group in _model.Groups)
                {
                    _node = treeList1.AppendNode(null, _fnode);
                    _node.SetValue(this.treeListColumn1, _group);
                    _node.HasChildren      = false;
                    _node.ImageIndex       = 7;
                    _node.SelectImageIndex = 0;
                }
            }
        }
Example #7
0
        private void ShowNodeData(TreeListNode _selectedNode)
        {
            this.splitContainerControl1.Panel2.Controls.Clear();
            CurrentControl = null;
            if (_selectedNode != null)
            {
                object _selectedObj = _selectedNode.GetValue(this.treeListColumn1);
                if (_selectedObj is MD_Nodes)
                {
                }

                if (_selectedObj is MD_InputModel)
                {
                    MD_InputModel _model = _selectedObj as MD_InputModel;
                    UC_InputModel _uc    = new UC_InputModel(string.Format("{0}.{1}", _model.NameSpace, _model.ModelName));
                    _uc.Dock = DockStyle.Fill;
                    this.splitContainerControl1.Panel2.Controls.Add(_uc);
                    CurrentControl = _uc as IMenuControl;
                }
                if (_selectedObj is MD_InputModel_ColumnGroup)
                {
                    ShowInputModelColumns(_selectedObj as MD_InputModel_ColumnGroup);
                }

                if (_selectedObj is MD_InputModel_SaveTable)
                {
                    ShowInputModelWriteTableDefine(_selectedObj as MD_InputModel_SaveTable);
                }

                if (_selectedObj is MD_InputModel_Child)
                {
                    ShowInputModelChild(_selectedObj as MD_InputModel_Child);
                }

                if (_selectedObj is MD_Title)
                {
                    MD_Title _title = _selectedObj as MD_Title;
                    switch (_title.TitleType)
                    {
                    case "MD_INPUTGROUP":
                        ShowInputModelColumns(_title.FatherObj as MD_InputModel);
                        break;

                    case "MD_SAVEDEFINE":
                        break;

                    case "MD_CHILDDEFINE":

                        break;
                    }
                }
            }
        }
Example #8
0
        private void LoadChildData(TreeListNode _fnode, object _value)
        {
            if (_value is MD_Nodes)
            {
                MD_Nodes _nodes = _value as MD_Nodes;
                LoadNamespaceOfNodes(_fnode, _nodes);
            }
            if (_value is MD_Namespace)
            {
                MD_Namespace _ns = _value as MD_Namespace;
                LoadInputViewOfNamespace(_fnode, _ns);
            }
            if (_value is MD_InputModel)
            {
                MD_InputModel _model = _value as MD_InputModel;
                LoadInputModelDetial(_fnode, _model);
            }


            if (_value is MD_Title)
            {
                MD_Title _title = _value as MD_Title;
                switch (_title.TitleType)
                {
                case "MD_INPUTCOLUMES":
                    LoadInputModelColumnGroup(_fnode, _title.FatherObj as MD_InputModel);
                    break;

                case "MD_SAVEDEFINE":
                    Load_SaveDesTables(_fnode, _title.FatherObj as MD_InputModel);
                    break;

                case "MD_CHILDDEFINE":
                    Load_ChildModel(_fnode, _title.FatherObj as MD_InputModel);
                    break;
                }
            }
        }
Example #9
0
        private void RaiseMenuChanged()
        {
            object _selectedObj = FocusedItem;

            this.ribbonPage1.Groups.Clear();

            if (_selectedObj is MD_Nodes)
            {
            }

            if (_selectedObj is MD_Namespace)
            {
                this.ribbonPage1.Groups.Add(this.RPG_MODEL);
                bt_AddInputModel.Enabled = true;
                bt_DelInputModel.Enabled = false;
                bt_ImportModel.Enabled   = true;
                bt_ExportModel.Enabled   = false;
            }

            if (_selectedObj is MD_InputModel)
            {
                this.ribbonPage1.Groups.Add(this.RPG_MODEL);
                bt_AddInputModel.Enabled = false;
                bt_DelInputModel.Enabled = true;
                bt_ImportModel.Enabled   = false;
                bt_ExportModel.Enabled   = true;
            }
            if (_selectedObj is MD_InputModel_ColumnGroup)
            {
                this.ribbonPage1.Groups.Add(this.RPG_GROUP);
                this.bt_AddGroup.Enabled = false;
                this.bt_DelGroup.Enabled = true;
            }

            if (_selectedObj is MD_InputModel_SaveTable)
            {
                this.ribbonPage1.Groups.Add(this.RPG_DESTABLE);
                this.bt_AddSaveTable.Enabled = false;
                this.bt_DelSaveTable.Enabled = true;
            }
            if (_selectedObj is MD_InputModel_Child)
            {
                this.ribbonPage1.Groups.Add(this.RPG_CHILD);
                this.bt_AddChild.Enabled = false;
                this.bt_DelChild.Enabled = true;
            }

            if (_selectedObj is MD_Title)
            {
                MD_Title _title = _selectedObj as MD_Title;
                switch (_title.TitleType)
                {
                case "MD_INPUTCOLUMES":
                    this.ribbonPage1.Groups.Add(this.RPG_GROUP);
                    this.bt_AddGroup.Enabled = true;
                    this.bt_DelGroup.Enabled = false;
                    break;

                case "MD_SAVEDEFINE":
                    this.ribbonPage1.Groups.Add(this.RPG_DESTABLE);
                    this.bt_AddSaveTable.Enabled = true;
                    this.bt_DelSaveTable.Enabled = false;
                    break;

                case "MD_CHILDDEFINE":
                    this.ribbonPage1.Groups.Add(this.RPG_CHILD);
                    this.bt_AddChild.Enabled = true;
                    this.bt_DelChild.Enabled = false;
                    break;
                }
            }



            if (CurrentControl != null)
            {
                foreach (MenuGroup _g in CurrentControl.GetMenuGroups())
                {
                    RibbonPageGroup _group = new RibbonPageGroup();
                    _group.Text = _g.GroupTitle;
                    foreach (string _bname in _g.Buttons)
                    {
                        BarButtonItem _item = GetButtonByName(_bname);
                        if (_item != null)
                        {
                            _group.ItemLinks.Add(_item);
                        }
                    }
                    this.ribbonPage1.Groups.Add(_group);
                }

                if (CurrentControl.DataChanged)
                {
                    this.ribbonPage1.Groups.Add(this.RPG_SAVE);
                }
            }
        }