Ejemplo n.º 1
0
 private void RefreshData()
 {
     TE_ID.EditValue               = _guideLine.ID;
     TE_Name.EditValue             = _guideLine.GuideLineName;
     TE_ORDER.EditValue            = _guideLine.DisplayOrder;
     TE_SF.EditValue               = _guideLine.GuideLineMethod;
     _fgList                       = MC_GuideLine.GetFieldGroupsFromMeta(_guideLine.GuideLineMeta);
     this.te_Description.EditValue = _guideLine.Description;
     _treeData                     = new TreeObj_GuideLineFieldList();
     foreach (MD_GuideLineFieldGroup _glg in _fgList)
     {
         TreeObj_GuideLineFieldGroup _group = new TreeObj_GuideLineFieldGroup(_glg);
         TreeObj_GuidelLineFieldItem _item  = _group as TreeObj_GuidelLineFieldItem;
         foreach (MD_GuideLineFieldName _fname in _glg.Fields)
         {
             TreeObj_GuidelLineFieldItem _fitem = new TreeObj_GuidelLineFieldItem(_fname);
             _item.Children.Add(_fitem);
         }
         _treeData.Add(_item);
     }
     this.treeList1.DataSource = _treeData;
     _pList = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta);
     this.gridParameter.DataSource = _pList;
     _dList = MC_GuideLine.GetDetaiDefinelFromMeta(_guideLine.GuideLineMeta);
     this.gridDetail.DataSource = _dList;
     this._haveChange           = false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加字段组
        /// </summary>
        private void AddFieldGroup()
        {
            string _gname = string.Format("GROUP{0}", _treeData.Count + 1);
            MD_GuideLineFieldGroup      _fg     = new MD_GuideLineFieldGroup(_gname, "新建组", "CENTER", 0, false, "SHOW");
            TreeObj_GuideLineFieldGroup _treeFG = new TreeObj_GuideLineFieldGroup(_fg);
            TreeObj_GuidelLineFieldItem _item   = _treeFG as TreeObj_GuidelLineFieldItem;

            this._treeData.Add(_item);
            this.treeList1.DataSource = null;
            this.treeList1.DataSource = _treeData;

            this._haveChange = true;
            RaiseDataChanged();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 字段移往其它组
        /// </summary>
        private void MoveItem()
        {
            if (!this.IsFieldFocused())
            {
                return;
            }
            Dialog_MoveFieldToGroup _f          = new Dialog_MoveFieldToGroup();
            List <string>           _groupNames = new List <string>();

            foreach (TreeListNode _node in this.treeList1.Nodes)
            {
                string _gname = (string)_node.GetValue("Name");
                _groupNames.Add(_gname);
            }
            _f.InitItems(_groupNames);
            if (_f.ShowDialog() == DialogResult.OK)
            {
                TreeListNode _tn       = this.treeList1.FocusedNode;
                TreeListNode _fnode    = _tn.ParentNode;
                string       _oldGroup = (string)_fnode.GetValue("Name");
                if (_oldGroup == _f.SelectdGroupName)
                {
                    XtraMessageBox.Show("移往的组与当前所在组名称相同!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    TreeObj_GuidelLineFieldItem _fItem = this.treeList1.GetDataRecordByNode(_tn) as TreeObj_GuidelLineFieldItem;
                    _fnode.Nodes.Remove(_tn);
                    TreeListNode _newFather = null;
                    foreach (TreeListNode _node in this.treeList1.Nodes)
                    {
                        string _gname = (string)_node.GetValue("Name");
                        if (_gname == _f.SelectdGroupName)
                        {
                            _newFather = _node;
                            break;
                        }
                    }
                    if (_newFather != null)
                    {
                        TreeObj_GuideLineFieldGroup _gItem = this.treeList1.GetDataRecordByNode(_newFather) as TreeObj_GuideLineFieldGroup;
                        _gItem.Children.Add(_fItem);
                        this._haveChange = true;
                        RaiseDataChanged();
                    }
                }
            }
        }
Ejemplo n.º 4
0
 private void Paste_FieldDefine()
 {
     this.treeList1.BeginUpdate();
     foreach (MD_GuideLineFieldGroup _fg in ClipPad_Fields)
     {
         TreeObj_GuideLineFieldGroup _treeFG = new TreeObj_GuideLineFieldGroup(_fg);
         TreeObj_GuidelLineFieldItem _item   = _treeFG as TreeObj_GuidelLineFieldItem;
         this._treeData.Add(_item);
         foreach (MD_GuideLineFieldName _fn in _fg.Fields)
         {
             TreeObj_GuidelLineFieldItem _fi = new TreeObj_GuidelLineFieldItem(_fn);
             _treeFG.Children.Add(_fi);
         }
     }
     this.treeList1.DataSource = null;
     this.treeList1.DataSource = _treeData;
     this.treeList1.EndUpdate();
     this._haveChange = true;
     RaiseDataChanged();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 添加字段定义
        /// </summary>
        private void AddFieldDefine()
        {
            if (!this.IsFieldGroupFocused())
            {
                return;
            }
            TreeListNode _tn = this.treeList1.FocusedNode;

            if (_tn == null)
            {
                return;
            }
            MD_GuideLineFieldName _gf = new MD_GuideLineFieldName();

            _gf.FieldName = "字段";
            TreeObj_GuidelLineFieldItem _fi = new TreeObj_GuidelLineFieldItem(_gf);
            TreeObj_GuideLineFieldGroup _fg = this.treeList1.GetDataRecordByNode(_tn) as TreeObj_GuideLineFieldGroup;

            _fg.Children.Add(_fi);
            this._haveChange = true;
            RaiseDataChanged();
        }