Exemplo n.º 1
0
        public void m_Del(bool IsAll)
        {
            int index = 0;

            if (m_objViewer.m_cboUsage.SelectItemValue == "" || m_objViewer.m_lvw.Items.Count == 0)
            {
                return;
            }
            clsChargeItemUsageGroup_VO clsVO = new clsChargeItemUsageGroup_VO();

            if (IsAll)
            {
                clsVO.m_strUsageID = m_objViewer.m_cboUsage.SelectItemValue;
                clsVO.m_strItemID  = null;
            }
            else
            {
                if (m_objViewer.m_lvw.SelectedItems.Count == 0 || m_objViewer.m_lvw.SelectedItems[0].Tag == null)
                {
                    return;
                }
                clsVO.m_strItemID  = m_objViewer.m_lvw.SelectedItems[0].Tag.ToString();
                clsVO.m_strUsageID = m_objViewer.m_cboUsage.SelectItemValue;
                index = m_objViewer.m_lvw.SelectedItems[0].Index;
            }
            long lngRes = clsDomain.m_lngDelUsageGroupByID(clsVO);

            if (lngRes > 0)
            {
                if (IsAll)
                {
                    m_objViewer.m_lvw.Items.Clear();
                }
                else
                {
                    m_objViewer.m_lvw.Items[index].Remove();
                }
                if (m_objViewer.m_lvw.Items.Count > 0 && index > 0)
                {
                    m_objViewer.m_lvw.Items[index - 1].Selected = true;
                }
                this.m_FillItemGrid();
            }
        }