private void LoadDataObject()
        {
            ITreeListViewHoster treeListHoster = _TreeListHoster;
            IList lstDatas = null;

            try {
                int id = (int)_SortingNode.GetValue(_TreeListHoster.TreeViewCfg.KeyFieldName);
                MB.Util.Model.QueryParameterInfo[] queryParams = new Util.Model.QueryParameterInfo[1];
                queryParams[0] = new Util.Model.QueryParameterInfo(_TreeListHoster.TreeViewCfg.ParentFieldName, id, Util.DataFilterConditions.Equal);
                lstDatas       = _ClientRuleObject.GetObjects((int)_ClientRuleObject.MainDataTypeInDoc, queryParams);
            }
            catch (Exception ex) {
                throw MB.Util.APPExceptionHandlerHelper.PromoteException(ex, "DefaultTreeListViewForm.GetObjects 出错!");
            }

            if (_BindingSource == null)
            {
                IBindingList bl = _ClientRuleObject.CreateMainBindList(lstDatas);
                _BindingSource            = new MB.WinBase.Binding.BindingSourceEx();
                _BindingSource.DataSource = bl;
                treeListHoster.CreateTreeListViewDataBinding(trvLstMain, _BindingSource);

                if (trvLstMain.Nodes.Count > 0)
                {
                    trvLstMain.Nodes[0].Expanded = true;
                    trvLstMain.FocusedNode       = trvLstMain.Nodes[0];
                }
            }
            else
            {
                treeListHoster.RefreshTreeListData(trvLstMain, lstDatas);
            }
        }
Beispiel #2
0
        public List <ChartTemplateInfo> GetObjectByUser(string userCode)
        {
            List <MB.Util.Model.QueryParameterInfo> list = new List <Util.Model.QueryParameterInfo>();

            MB.Util.Model.QueryParameterInfo p = new Util.Model.QueryParameterInfo(Util.Model.QueryGroupLinkType.OR);
            p.Childs.Add(new Util.Model.QueryParameterInfo("TEMPLATE_TYPE", "PUBLIC", Util.DataFilterConditions.Equal));
            p.Childs.Add(new Util.Model.QueryParameterInfo("CREATE_USER", userCode, Util.DataFilterConditions.Equal));
            list.Add(p);

            string xmlFilterParam = MB.Util.Serializer.QueryParameterXmlSerializer.DefaultInstance.Serializer(list.ToArray());

            return(GetObjects(xmlFilterParam));
        }