Ejemplo n.º 1
0
        /// <summary>
        /// 显示发票分类明细数据
        /// </summary>
        public void m_mthShowChargeDe()
        {
            if (dtChargeCheck.Rows.Count == 0 || this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber < 0)
            {
                return;
            }

            DataTable dtChargeDe = new DataTable();

            this.m_objViewer.LsvChargeDe.Items.Clear();

            string strINVOICENO = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 1].ToString();
            string strSEQID     = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 3].ToString();

            if (strINVOICENO == "" || strSEQID == "")
            {
                return;
            }
            Domain.m_lngGetChargeDe(strINVOICENO, strSEQID, out dtChargeDe);
            double totalMoney = 0.00, decMoney = 0;

            if (dtChargeDe.Rows.Count > 0)
            {
                for (int i1 = 0; i1 < dtChargeDe.Rows.Count; i1++)
                {
                    ListViewItem addItem = new ListViewItem(dtChargeDe.Rows[i1]["TYPENAME_VCHR"].ToString());
                    decMoney = Convert.ToDouble(dtChargeDe.Rows[i1]["TOLFEE_MNY"].ToString());
                    if (string.Compare("0022", dtChargeDe.Rows[i1]["typeid_chr"].ToString()) == 0)
                    {
                        decMoney = Math.Abs(decMoney) * -1;//取负值
                    }
                    totalMoney += decMoney;
                    addItem.SubItems.Add("¥" + decMoney.ToString());
                    this.m_objViewer.LsvChargeDe.Items.Add(addItem);
                }
            }
            ListViewItem addItem1 = new ListViewItem("合计金额");

            addItem1.SubItems.Add("¥" + totalMoney.ToString());
            this.m_objViewer.LsvChargeDe.Items.Add(addItem1);
            this.m_objViewer.LsvChargeDe.Visible = true;
            this.m_objViewer.listView1.Visible   = false;
        }