Exemplo n.º 1
0
        public void m_Add()
        {
            string strID   = "";
            string strName = "";

            if (m_objViewer.m_cboUsage.SelectItemValue == "")
            {
                MessageBox.Show("请选择用法", "提示");
                m_objViewer.m_cboUsage.Focus();
                return;
            }
            if (m_objViewer.m_dg.VisibleRowCount > 0 && m_objViewer.m_dg.CurrentCell.RowNumber > -1)
            {
                strID = m_objViewer.m_dg[m_objViewer.m_dg.CurrentCell.RowNumber, 0].ToString();
                if (strID == "")
                {
                    return;
                }
                strName = m_objViewer.m_dg[m_objViewer.m_dg.CurrentCell.RowNumber, 2].ToString();
            }
            else
            {
                return;
            }
            clsChargeItemUsageGroup_VO clsVO = new clsChargeItemUsageGroup_VO();

            clsVO.m_strItemID  = strID;
            clsVO.m_strUsageID = m_objViewer.m_cboUsage.SelectItemValue;
            long lngRes = clsDomain.m_lngDoAddNewChargeItemUsageGroup(clsVO);

            if (lngRes > 0)
            {
                ListViewItem lvw = new ListViewItem(strName);
                lvw.Tag = clsVO.m_strItemID;
                m_objViewer.m_lvw.Items.Add(lvw);
                this.m_FillItemGrid();
            }
        }