Пример #1
0
        /// <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);
        }
Пример #2
0
        public clsCheckType[] SelectType()
        {
            int count = this.lvApplies.CheckedItems.Count;

            if (count == 0)
            {
                MessageBox.Show("请选择检查类型!");
                return(null);
            }
            int i = 0;

            clsCheckType[] checkTypes = new clsCheckType[count];

            foreach (ListViewItem item in this.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);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        /// <summary>
        /// 返回指定检查类型
        /// </summary>
        /// <param name="p_strARTypeArr"></param>
        /// <returns></returns>
        public clsCheckType[] GetSpecCheckTypes(string[] p_strARTypeArr)
        {
            string strSQL = "";

            string strAR = "";

            if (p_strARTypeArr == null || p_strARTypeArr.Length <= 0)
            {
                strSQL = "select * from AR_APPLY_TYPELIST";
            }
            else
            {
                for (int j = 0; j < p_strARTypeArr.Length; j++)
                {
                    if (j == 0)
                    {
                        strAR = "TYPEID = " + p_strARTypeArr[j];
                    }
                    else
                    {
                        strAR += " or TYPEID = " + p_strARTypeArr[j];
                    }
                }

                strSQL = "select * from AR_APPLY_TYPELIST where ";
            }
            DataTable ds = dp.SqlSelect(strSQL + strAR);

            if (ds.Rows.Count < 1)
            {
                return(null);
            }

            clsCheckType[] checks = new clsCheckType[ds.Rows.Count];

            int i = 0;

            foreach (DataRow dr in ds.Rows)
            {
                checks[i]               = new clsCheckType();
                checks[i].m_strTypeID   = dr["TypeID"].ToString().ToString();
                checks[i].m_strTypeName = dr["TypeText"].ToString().ToString();
                i++;
            }

            return(checks);
        }
Пример #5
0
        /// <summary>
        /// 返回所有检查类型
        /// </summary>
        /// <returns></returns>
        public clsCheckType[] GetAllCheckTypes()
        {
            DataTable ds = dp.SqlSelect("select * from AR_APPLY_TYPELIST");

            if (ds.Rows.Count < 1)
            {
                return(null);
            }

            clsCheckType[] checks = new clsCheckType[ds.Rows.Count];

            int i = 0;

            foreach (DataRow dr in ds.Rows)
            {
                checks[i]               = new clsCheckType();
                checks[i].m_strTypeID   = dr["TypeID"].ToString().ToString();
                checks[i].m_strTypeName = dr["TypeText"].ToString().ToString();
                i++;
            }

            return(checks);
        }