/// <summary> /// ���ٹ��� /// </summary> /// <returns></returns> private ShortcutFilter GetShortcutFilter() { ShortcutFilter shFilter = new ShortcutFilter(); if (null == this._xmlnode) return shFilter; XmlNode xmlnode = this._xmlnode.SelectSingleNode("ShortcutFilter"); if (null == xmlnode) return shFilter; if (null != xmlnode.Attributes["linkcol"]) shFilter.ColumnName = xmlnode.Attributes["linkcol"].Value; if (null != xmlnode.Attributes["dataitem"] && null != xmlnode.Attributes["valuecol"] && null != xmlnode.Attributes["textcol"]) { shFilter.DataSrc = xmlnode.Attributes["dataitem"].Value; shFilter.TxtCol = xmlnode.Attributes["textcol"].Value; shFilter.ValueCol = xmlnode.Attributes["valuecol"].Value; } if (null != xmlnode.Attributes["coltype"]) shFilter.ColType = xmlnode.Attributes["coltype"].Value; if (shFilter.ColumnName == "") { if (shFilter.TxtCol != "") { shFilter.ColumnName = shFilter.TxtCol; } else { shFilter.ColumnName = shFilter.ValueCol; } } if (shFilter.ColType == "") { shFilter.ColType = "char"; } return shFilter; }
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(); }
// 通过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(); }