示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mniAddToGroup_Click(object sender, System.EventArgs e)
        {
#if FunctionPrivilege
            if (!clsPublicFunction.s_blnCheckCurrentPrivilege(PrivilegeData.enmPrivilegeSF.frmLabCheckItemAdmin, PrivilegeData.enmPrivilegeOperation.AddOrModify))
            {
                clsPublicFunction.s_mthShowNotPermitMessage();
                return;
            }
#endif
            if (lsvCheckItem.SelectedItems.Count == 0)
            {
                return;
            }

            for (int i = 0; i < lsvItemGroup.Items.Count; i++)
            {
                if (lsvItemGroup.Items[i].SubItems[0].Text.Trim() == lsvCheckItem.SelectedItems[0].SubItems[0].Text.Trim())
                {
                    clsPublicFunction.ShowInformationMessageBox("该组中已经存在该项目!");
                    return;
                }
            }

            clsLabCheckGroupItem objLabCheckGroupItem = new clsLabCheckGroupItem();
            objLabCheckGroupItem.m_objLabCheckGroup = (clsLabCheckGroup)trvGroup.SelectedNode.Tag;
            objLabCheckGroupItem.m_objLabCheckItem  = (clsLabCheckItem)lsvCheckItem.SelectedItems[0].Tag;

            ListViewItem lsvItem = new ListViewItem(new string[] { objLabCheckGroupItem.m_objLabCheckItem.m_strLabItemID, objLabCheckGroupItem.m_objLabCheckItem.m_strLabItemDesc });
            lsvItem.Tag = objLabCheckGroupItem;
            lsvItemGroup.Items.Add(lsvItem);
        }
示例#2
0
        /// <summary>
        /// 保存分组信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdApply_Click(object sender, System.EventArgs e)
        {
#if FunctionPrivilege
            if (!clsPublicFunction.s_blnCheckCurrentPrivilege(PrivilegeData.enmPrivilegeSF.frmLabCheckItemAdmin, PrivilegeData.enmPrivilegeOperation.AddOrModify))
            {
                clsPublicFunction.s_mthShowNotPermitMessage();
                return;
            }
#endif
            if (lsvItemGroup.Items.Count == 0)
            {
                clsPublicFunction.ShowInformationMessageBox("组的项目不能为空!");
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            clsLabCheckGroupItem[] objLabCheckGroupItemArr = new clsLabCheckGroupItem[lsvItemGroup.Items.Count];

            for (int i = 0; i < lsvItemGroup.Items.Count; i++)
            {
                objLabCheckGroupItemArr[i] = new clsLabCheckGroupItem();
                objLabCheckGroupItemArr[i] = (clsLabCheckGroupItem)lsvItemGroup.Items[i].Tag;
            }

            m_objLabCheckItemAdminDomain.m_lngModifyGroupItem(((clsLabCheckGroup)trvGroup.SelectedNode.Tag).m_strLabGroupID);
            m_objLabCheckItemAdminDomain.m_lngAddNewGroupItem(objLabCheckGroupItemArr);

            Cursor.Current = Cursors.Default;
        }
示例#3
0
        /// <summary>
        /// 初始化分组
        /// </summary>
        private void m_mthInitializeGroupItem()
        {
            Cursor.Current = Cursors.WaitCursor;

            if (this.trvGroup.SelectedNode == trvGroup.Nodes[0])
            {
                return;
            }

            clsLabCheckItem[] objLabCheckItemArr;
            string            strGroup_ID = ((clsLabCheckGroup)trvGroup.SelectedNode.Tag).m_strLabGroupID;

            long lngRes = m_objLabCheckItemAdminDomain.m_lngGetLabCheckGroupItem(strGroup_ID, out objLabCheckItemArr);

            if (lngRes <= 0 || objLabCheckItemArr == null || objLabCheckItemArr.Length == 0)
            {
                return;
            }

            clsLabCheckGroupItem[] objLabCheckGroupItemArr = new clsLabCheckGroupItem[objLabCheckItemArr.Length];

            for (int i = 0; i < objLabCheckItemArr.Length; i++)
            {
                objLabCheckGroupItemArr[i] = new clsLabCheckGroupItem();

                if (objLabCheckItemArr[i] != null)
                {
                    objLabCheckGroupItemArr[i].m_objLabCheckItem  = objLabCheckItemArr[i];
                    objLabCheckGroupItemArr[i].m_objLabCheckGroup = (clsLabCheckGroup)trvGroup.SelectedNode.Tag;

                    ListViewItem lsvItem = new ListViewItem(new string[] { objLabCheckItemArr[i].m_strLabItemID, objLabCheckItemArr[i].m_strLabItemDesc });

                    lsvItem.Tag = objLabCheckGroupItemArr[i];

                    lsvItemGroup.Items.Add(lsvItem);
                }
            }            //end for

            Cursor.Current = Cursors.Default;
        }