/// <summary> /// 显示多选检查类型对话框(带VO) /// </summary> /// <returns></returns> public static clsCheckType[] ShowSelect(clsApplyRecord vo) { frmSelectType fm = new frmSelectType(vo); if (fm.ShowDialog() == DialogResult.Cancel) { return(null); } int count = fm.lvApplies.CheckedItems.Count; int i = 0; clsCheckType[] checkTypes = new clsCheckType[count]; foreach (ListViewItem item in fm.lvApplies.CheckedItems) { checkTypes[i] = new clsCheckType(); checkTypes[i].m_strTypeName = item.Text.Trim(); checkTypes[i].m_strCheckPart = item.SubItems[1].Text.Trim(); checkTypes[i].m_strCheckAim = item.SubItems[2].Text.Trim(); checkTypes[i].m_strChargeDetail = item.SubItems[3].Text.Trim(); checkTypes[i].m_strTypeID = item.SubItems[4].Text.Trim(); checkTypes[i].objItem_VO = item.Tag as clsChargeItem_VO; i++; } return(checkTypes); }
/// <summary> /// 显示单选检查类型框 /// </summary> /// <returns></returns> public static clsCheckType[] ShowSingleSelect() { frmSelectType fm = new frmSelectType(); fm.lvApplies.CheckBoxes = false; fm.lvApplies.MultiSelect = false; //fm.lblChargeInfo.Text = chargeInfo; if (fm.ShowDialog() == DialogResult.Cancel) { return(null); } if (fm.lvApplies.SelectedItems.Count < 1) { return(null); } ListViewItem item = fm.lvApplies.SelectedItems[0]; clsCheckType checkType = new clsCheckType(); checkType.m_strTypeName = item.Text.Trim(); checkType.m_strCheckPart = item.SubItems[1].Text.Trim(); checkType.m_strCheckAim = item.SubItems[2].Text.Trim(); checkType.m_strChargeDetail = item.SubItems[3].Text.Trim(); checkType.m_strTypeID = item.SubItems[4].Text.Trim(); checkType.objItem_VO = item.Tag as clsChargeItem_VO; clsCheckType[] c = new clsCheckType[1]; c[0] = checkType; return(c); }