Exemple #1
0
        /// <summary>
        /// �����
        /// </summary>
        /// <returns></returns>
        private TreeFilter GetTreeFilter()
        {
            TreeFilter treeFilter = new TreeFilter();
            if (null == this._xmlnode) return treeFilter;
            XmlNode xmlnode = this._xmlnode.SelectSingleNode("TreeFilter");

            if (null == xmlnode) return treeFilter;

            #region  ����Դ����

            if (null != xmlnode.Attributes["dataitem"])
            {
                treeFilter.DataSrc = xmlnode.Attributes["dataitem"].Value;
                if (null != xmlnode.Attributes["linkcol"])
                    treeFilter.ColumnName = xmlnode.Attributes["linkcol"].Value;
                if (null != xmlnode.Attributes["level"])
                    treeFilter.Level = xmlnode.Attributes["level"].Value;
            }

            #endregion

            #region  ������ʾ����
            if (xmlnode.Attributes["alert"] != null)
                treeFilter.Alertmsg = xmlnode.Attributes["alert"].Value;
            if (xmlnode.Attributes["gounititem"] != null)
                treeFilter.GoUnitItem = xmlnode.Attributes["gounititem"].Value;

            if (xmlnode.Attributes["treetype"] != null)
                treeFilter.TreeType = xmlnode.Attributes["treetype"].Value;

            if (xmlnode.Attributes["readtype"] != null)
                treeFilter.ReadType = xmlnode.Attributes["readtype"].Value;

            if (xmlnode.Attributes["treefun"] != null)
                treeFilter.TreeFun = xmlnode.Attributes["treefun"].Value;

            if (xmlnode.Attributes["hasall"] != null)
                treeFilter.HasAll = xmlnode.Attributes["hasall"].Value;

            if (xmlnode.Attributes["isfirst"] != null
                    && ("1" == xmlnode.Attributes["isfirst"].Value || "true" == xmlnode.Attributes["isfirst"].Value.ToLower()))
                treeFilter.IsFirst = true;
            else
                treeFilter.IsFirst = false;

            if (xmlnode.Attributes["firsthide"] != null
                 && ("1" == xmlnode.Attributes["firsthide"].Value || xmlnode.Attributes["firsthide"].Value.ToLower() == "true"))
                treeFilter.FirstHide = true;
            else
                treeFilter.FirstHide = false;

            if (xmlnode.Attributes["refreshed"] != null
                    && ("1" == xmlnode.Attributes["refreshed"].Value || xmlnode.Attributes["refreshed"].Value.ToLower() == "true"))
                treeFilter.EditFreshed = true;
            else
                treeFilter.EditFreshed = false;

            if (xmlnode.Attributes["tree2edit"] != null
                    && ("1" == xmlnode.Attributes["tree2edit"].Value || xmlnode.Attributes["tree2edit"].Value.ToLower() == "true"))
                treeFilter.TreeToEdit = true;
            else
                treeFilter.TreeToEdit = false;

            if (xmlnode.Attributes["tree2edit"] != null)
                treeFilter.TreeToEditFields = xmlnode.Attributes["tree2edit"].Value;
            #endregion

            return treeFilter;
        }
Exemple #2
0
        private XmlNode _xmlnode = null; //��ǰ��_sworkUnitһ�µĽڵ�

        #endregion Fields

        #region Constructors

        // ͨ��workUnitName�õ����е�����Դdataitem,��ͨ��dataitem�鵽��Ӧ��sqltext,���õ�table
        // workUnitFileԭ���ڴ�ָ�����������ļ�������workitem.xml��Ŀǰworkitem.xml��hmsys���ݿ��������ˣ����Բ��ٿ���
        // ��ʱ��workUnitNameΪ��Ԫ���ƣ�ֻ����hmsys��unititem���ҵ�workUnitName���ϼ���,Ȼ����ȡ��workUnitName��Ԫ����������
        public UnitItem(string	workUnitFile,string	workUnitName)
        {
            if (workUnitName == "") return;
            this._unitFile = workUnitFile;
            CreateAppTable(workUnitFile,workUnitName);
            if (this.dtWorkUnit == null) return;

            DataRow[] _drnodes = this.dtWorkUnit.Select("ntype='UnitItem'");
             if (_drnodes.Length == 0) return;
             this._drnode = _drnodes[0];
            this.SetWorkUnit(workUnitName);

            this.WorkItemList		=	this.GetWorkItemList();
            this.CommandItemList	=	this.GetCommandItemList();
            this.AppendItemList		=	this.GetAppendItemList();
            this.UnitType			=	this.GetWorkUnitType();
            this.DataSrcFile		=	this.GetDataSrcFile();
            this.FileEditTp			=	this.GetFileEditTp();
            this.WorkFlow           =   this.GetWorkFlow();

            this.FilePrnTp          =   this.GetFilePrintTp();
            this.SaveOPType			=	this.GetSaveType();
            this.DictColSrcFile		=	this.GetDictColSrcFile();
            this.StFilter			=	this.GetShortcutFilter();
            this.treeFilter			=	this.GetTreeFilter();

            this.BillType			=	this.GetBillType();
            this.PrintType          =   this.GetPrnType();
            this.IsVisibleNav       =   this.GetVisibleNav();
        }
Exemple #3
0
        // 通过workUnitName得到其中的数据源dataitem,再通过dataitem查到对应的sqltext,最后得到table
        // workUnitFile原用于打开指定操作集的文件名,即workitem.xml,目前workitem.xml由hmsys数据库替代,因此,可以不再考虑
        // 此时,workUnitName为单元名称,只需在hmsys的unititem中找到workUnitName集合即可,然后再取出workUnitName单元的所有属性
		public UnitItem(string	workUnitFile,string	workUnitName)
		{
            if (workUnitName == "") return;
            this._unitFile = workUnitFile;
            string strConn = DataAccRes.DefaultDataConnInfo.Value;
            myConnection = new SqlConnection(strConn);
            CreateAppTable(workUnitFile, workUnitName);
            if (this.dtWorkUnit == null || this.dtWorkUnit.Columns.Count < 1 || !this.dtWorkUnit.Columns.Contains("ntype"))
                return;

            DataRow[] _drnodes = this.dtWorkUnit.Select("ntype='UnitItem'");
             if (_drnodes.Length == 0) return;
             this._drnode = _drnodes[0];
			this.SetWorkUnit(workUnitName);

			this.WorkItemList		=	this.GetWorkItemList();
			this.CommandItemList	=	this.GetCommandItemList();
			this.AppendItemList		=	this.GetAppendItemList();
			this.UnitType			=	this.GetWorkUnitType();
			this.DataSrcFile		=	this.GetDataSrcFile();
			this.FileEditTp			=	this.GetFileEditTp();
            this.WorkFlow           =   this.GetWorkFlow();
            
            this.FilePrnTp          =   this.GetFilePrintTp();
			this.SaveOPType			=	this.GetSaveType();
			this.DictColSrcFile		=	this.GetDictColSrcFile();
			this.StFilter			=	this.GetShortcutFilter();
			this.treeFilter			=	this.GetTreeFilter();
			
			this.BillType			=	this.GetBillType();
            this.PrintType          =   this.GetPrnType();
            this.IsVisibleNav       =   this.GetVisibleNav();
		}