private void DisplayTypePanel(PLMDataType attrType) { switch (attrType) { case PLMDataType.String: case PLMDataType.Guid: case PLMDataType.Clob: case PLMDataType.Card: this.pnlBool.Visible = false; this.pnlGrid.Visible = false; this.pnlString.Visible = true; if ((this.ultraEditor.Tag != null) && ModelContext.MetaModel.IsCard(this.ultraEditor.Tag.ToString())) { this.chkReturn.Checked = true; } if (this.IsPrintTemplate) { this.numReturnRows.Visible = false; return; } this.label11.Text = "换行行数"; this.label11.AutoEllipsis = true; this.label11.AutoSize = true; this.numJumpPage.Visible = false; return; case PLMDataType.Bool: this.pnlBool.Visible = this.IsPrintTemplate; this.pnlGrid.Visible = false; this.pnlString.Visible = false; return; case PLMDataType.Grid: this.txtGridStart.Text = this.address; if (!this.IsPrintTemplate) { this.chkGridReturn.Text = "是否换页"; } this.pnlBool.Visible = false; this.pnlGrid.Visible = true; this.pnlString.Visible = false; return; } this.pnlBool.Visible = false; this.pnlGrid.Visible = false; this.pnlString.Visible = false; }
private void GetMasRevList(string mainClassName, ArrayList mastersList, ArrayList revsList) { DEItemMaster2[] masters = null; DEItemRevision2[] revs = null; string[] fieldNames = null; string[] operators = null; object[] values = null; PLMDataType[] attrTypes = null; ArrayList allAncestorName = CLCard.GetAllAncestorName(mainClassName); for (int i = allAncestorName.Count - 1; i >= 0; i--) { fieldNames = new string[] { "M.PLM_R_RELEASEDESC", "M.PLM_M_STATE" }; operators = new string[] { " LIKE ", "=" }; values = new object[] { "%:" + allAncestorName[i].ToString(), 'R' }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); mastersList.AddRange(masters); revsList.AddRange(revs); } }
public void FillTemplateListView(string headClassName, string mainClassName, SortableListView lvwTemplates, Guid uOid, bool isDialog) { lvwTemplates.Items.Clear(); DEItemMaster2[] masters = null; DEItemRevision2[] revs = null; ArrayList mastersList = new ArrayList(); ArrayList revsList = new ArrayList(); string[] fieldNames = null; string[] operators = null; object[] values = null; PLMDataType[] attrTypes = null; if (mainClassName == null) { //20180823 modifiedy by kexp 加入过程流程图 if ((headClassName == null) || (!ModelContext.MetaModel.IsCard(headClassName) && !ModelContext.MetaModel.IsForm(headClassName) && !ModelContext.MetaModel.IsChild("PROFLOWCHART", headClassName))) { if (headClassName == null) { this.GetItemMasRev(out masters, out revs, null, null, null, null); } else { if (this.virtualClsName != "") { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE", "I.PLM_VIRTUALCLASSNAME" }; operators = new string[] { "=", "=", "=" }; values = new object[] { headClassName, 'R', this.virtualClsName }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char, PLMDataType.String }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } if ((this.virtualClsName == "") || (masters.Length == 0)) { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE" }; operators = new string[] { "=", "=" }; values = new object[] { headClassName, 'R' }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } } if (masters != null) { for (int i = 0; i < masters.Length; i++) { if (this.IsOutPutTemplate(revs[i], this.user.Oid)) { int objectImage = ClientData.ItemImages.GetObjectImage(masters[i].ClassName, PLDataModel.GetStateByMasterInfo(masters[i].State, true)); ListViewItem lvi = new ListViewItem(masters[i].Id, objectImage); this.FillListViewItem(lvi, masters[i], revs[i]); lvi.Tag = new DEBusinessItem(masters[i], revs[i], null); lvwTemplates.Items.Add(lvi); } } this.lvwTemplates.SetColumnSortFormat(1, SortedListViewFormatType.Numeric); this.lvwTemplates.SetColumnSortFormat(2, SortedListViewFormatType.Numeric); } return; } if (!isDialog) { fieldNames = new string[] { "I.PLM_TEMPLATETYPE" }; operators = new string[] { "=" }; values = new object[] { headClassName }; attrTypes = new PLMDataType[] { PLMDataType.String }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } else { if (this.virtualClsName != "") { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE", "I.PLM_VIRTUALCLASSNAME" }; operators = new string[] { "=", "=", "=" }; values = new object[] { headClassName, 'R', this.virtualClsName }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char, PLMDataType.String }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } if ((this.virtualClsName == "") || (masters.Length == 0)) { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE" }; operators = new string[] { "=", "=" }; values = new object[] { headClassName, 'R' }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } } mastersList.AddRange(masters); revsList.AddRange(revs); } else if (headClassName == null) { this.GetMasRevList(mainClassName, mastersList, revsList); } else { this.GetMasRevList(mainClassName, mastersList, revsList); if (this.virtualClsName != "") { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE", "I.PLM_VIRTUALCLASSNAME" }; operators = new string[] { "=", "=", "=" }; values = new object[] { headClassName, 'R', this.virtualClsName }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char, PLMDataType.String }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } if ((this.virtualClsName == "") || (masters.Length == 0)) { fieldNames = new string[] { "I.PLM_TEMPLATETYPE", "M.PLM_M_STATE" }; operators = new string[] { "=", "=" }; values = new object[] { headClassName, 'R' }; attrTypes = new PLMDataType[] { PLMDataType.String, PLMDataType.Char }; this.GetItemMasRev(out masters, out revs, fieldNames, operators, values, attrTypes); } for (int j = 0; j < revs.Length; j++) { if (!this.HasSameTemplate(revs[j], revsList)) { mastersList.Add(masters[j]); revsList.Add(revs[j]); } } } this.FillTemplateListView(isDialog, mastersList, revsList, lvwTemplates); }