private void LoadAttrData() { DEResFolder defolder = new DEResFolder { Oid = this.g_ClsOid, ClassOid = this.g_ClsOid, ClassName = this.className }; ArrayList showAttrList = ResFunc.GetShowAttrList(defolder, emTreeType.NodeTree); this.al_attrs = ResFunc.CloneMetaAttrLst(showAttrList); }
private void ConvertOuterDSHeader(DataSet ds_ret, Guid g_clsoid) { ArrayList attrList = new ArrayList(); ArrayList outList = new ArrayList(); DEResFolder defolder = new DEResFolder { ClassOid = g_clsoid }; DEMetaClass class2 = ModelContext.MetaModel.GetClass(g_clsoid); attrList = this.GetAttributes(class2.Name); outList = ResFunc.GetOuterAttr(defolder); this.ReplaceAttrName(ds_ret, outList, attrList); }
public void Output(DEResFolder curResFolder) { if (curResFolder != null) { this.curFolder = curResFolder; this.InitResInfo(); this.TotalNum = this.GetResDataCount(); if (this.TotalNum == 0) { MessageBoxPLM.Show("资源的记录数为零,不能导出", "资源数据导出", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { this.TotalPage = ((this.TotalNum % this.showNum) == 0) ? (this.TotalNum / this.showNum) : ((this.TotalNum / this.showNum) + 1); this.attrShow = new PLReference().GetDefAttrLst(this.curFolder.Oid, emTreeType.NodeTree); foreach (DEDefAttr attr in this.attrShow) { if (!attr.ISVISUAL) { for (int i = this.attrList.Count - 1; i >= 0; i--) { DEMetaAttribute attribute = this.attrList[i] as DEMetaAttribute; if (attribute.Oid == attr.ATTROID) { this.attrList.RemoveAt(i); } } } } FrmOutputOption option = new FrmOutputOption(this.TotalPage, this.attrList); if (option.ShowDialog() == DialogResult.OK) { SaveFileDialog dialog; this.StartNum = option.StartPage; this.EndNum = option.EndPage; this.IsMultiPageOut = option.IsMultiPage; if (this.saveFile(out dialog)) { IProgressCallback progressWindow = ClientData.GetProgressWindow(); ArrayList state = new ArrayList { progressWindow, dialog.FileName }; ThreadPool.QueueUserWorkItem(new WaitCallback(this.outPageExcel), state); progressWindow.ShowWindow(); } } } } }
private void SetFolder() { this.myFolder = new DEResFolder(); this.myFolder.Oid = this.g_ClsOid; this.myFolder.ClassOid = this.g_ClsOid; this.myFolder.ClassName = this.className; ArrayList clsTreeCls = new ArrayList(); clsTreeCls = new PLReference().GetClsTreeCls(this.g_ClsOid); if (clsTreeCls.Count > 0) { DEDefCls cls = (DEDefCls)clsTreeCls[0]; this.myFolder.Filter = cls.FILTER; this.myFolder.FilterString = cls.FILTERSTRING; this.myFolder.FilterValue = cls.FILTERVALUE; } }
private bool CheckOptionByDA() { bool flag = true; DEResFolder defolder = new DEResFolder { Oid = Guid.Empty, ClassOid = this.clsOid, ClassName = this.clsName, Filter = this.FilterConditon.ToString(), FilterString = this.FilterString, FilterValue = this.FilterValue }; ArrayList list = new ArrayList(); ArrayList outerAttr = new ArrayList(); list = ResFunc.CloneMetaAttrLst(ResFunc.GetShowAttrList(defolder, emTreeType.NodeTree)); outerAttr = ResFunc.GetOuterAttr(defolder); try { if (ResFunc.IsOnlineOutRes(defolder.ClassOid)) { ResFunc.GetDataCount(defolder, list, outerAttr, emResourceType.OutSystem); return(flag); } if (ResFunc.IsRefRes(defolder.ClassOid)) { PLSPL plspl = new PLSPL(); DEMetaClass class2 = ModelContext.MetaModel.GetClass(defolder.ClassOid); DEMetaClass class3 = ModelContext.MetaModel.GetClass(class2.RefClass); plspl.GetSPLCount(class3.Name, list, ClientData.LogonUser.Oid, defolder.FilterString, defolder.FilterValue); return(flag); } if (ResFunc.IsTabRes(defolder.ClassOid)) { ArrayList list4 = new ArrayList(); ResFunc.GetDataCount(defolder, list4, outerAttr, emResourceType.Customize); } } catch { return(false); } return(flag); }
private void NodeSelected(TreeNode node) { if (this.dropDownTree.SelectedNode == null) { this.gbFilter.Visible = false; this.lvw.Clear(); } else if (this.dropDownTree.SelectedNode.Text != this.clsName) { this.curFolder = (DEResFolder)this.dropDownTree.SelectedNode.Tag; if (typeof(DEMetaClass).IsInstanceOfType(this.dropDownTree.SelectedNode.Tag)) { this.gbFilter.Visible = true; this.clsName = this.dropDownTree.SelectedNode.Text; DEMetaClass tag = (DEMetaClass)this.dropDownTree.SelectedNode.Tag; this.attrList = this.GetAttributes(tag.Name); this.AddFilter(this.attrList); this.myView = null; if (this.txtValue.Text != "") { this.txtValue.Text = ""; } if (this.cob.Text != "等于") { this.cob.Text = "等于"; } PLSPL plspl = new PLSPL(); try { this.theDataSet = plspl.GetSPLDataSet(tag.Name, this.attrList, this.userOid, this.curFolder.FilterString, this.curFolder.FilterValue); } catch (PLMException exception) { PrintException.Print(exception); } catch (Exception exception2) { MessageBoxPLM.Show("读取数据集发生错误" + exception2.ToString(), "读取数据集", MessageBoxButtons.OK, MessageBoxIcon.Hand); } if (this.theDataSet.Tables.Count != 0) { this.CreateLvwStyle(this.lvw, this.attrList); if (this.theDataSet.Tables[0].Rows.Count == 0) { this.tbnNext.Enabled = false; this.tbnPre.Enabled = false; } else { this.myView = this.theDataSet.Tables[0].DefaultView; this.DisplayData(this.myView); } } } else { this.gbFilter.Visible = false; this.lvw.Clear(); } } }
private void FrmFilterData_Load(object sender, EventArgs e) { ArrayList attrList = new ArrayList(); ArrayList attrOuter = new ArrayList(); ArrayList list3 = new ArrayList(); try { DEMetaAttribute attribute; DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.clsOid); attrList = ResFunc.CloneMetaAttrLst(ModelContext.MetaModel.GetAttributes(this.clsName)); if (this.isOnLineOutRes) { DEResFolder defolder = new DEResFolder { ClassOid = this.clsOid }; attrOuter = ResFunc.GetOuterAttr(defolder); this.SetAttrDataType(attrList, attrOuter); } if (class2.IsRefResClass) { DEMetaClass refCls = this.GetRefCls(this.clsOid); ArrayList attributes = ModelContext.MetaModel.GetAttributes(refCls.Name); ArrayList fixedAttrList = ResFunc.GetFixedAttrList(); attributes.AddRange(fixedAttrList); attrList = ResFunc.CloneMetaAttrLst(attributes); } for (int i = 0; i < attrList.Count; i++) { attribute = (DEMetaAttribute)attrList[i]; if (attribute.IsViewable) { list3.Add(attribute.Label); this.filterAttrs.Add(attribute); } } if (this.isOnLineOutRes) { PLOuterResource resource = new PLOuterResource(); ArrayList list7 = new ArrayList(); attrOuter = resource.GetOuterResAttrs(this.clsOid); ArrayList list8 = new ArrayList(); for (int j = 0; j < this.filterAttrs.Count; j++) { bool flag = false; attribute = (DEMetaAttribute)this.filterAttrs[j]; foreach (DEOuterAttribute attribute2 in attrOuter) { if (attribute2.FieldOid == attribute.Oid) { list7.Add(attribute2); flag = true; break; } } if (!flag) { list8.Add(attribute); } } foreach (DEMetaAttribute attribute3 in list8) { this.filterAttrs.Remove(attribute3); list3.Remove(attribute3.Label); } if (list7.Count > 0) { this.cobParamName.Tag = list7; } } if (list3.Count > 0) { this.cobParamName.Properties.Items.AddRange(list3.ToArray()); } } catch (Exception exception) { PrintException.Print(exception); } }