コード例 #1
0
        private void CarregaTotal()
        {
            VendaBD bdVenda = new VendaBD();
            DataSet ds      = bdVenda.GetVendasMesTotal();
            DataRow dr      = ds.Tables[0].Rows[0];

            double venda = 0;

            if (dr["valor"] != DBNull.Value)
            {
                venda         = Convert.ToDouble(dr["valor"]);
                lblVenda.Text = venda.ToString();
            }


            //double venda = Convert.ToDouble(dr["valor"]);
            //lblVenda.Text = venda.ToString();

            DespesaBD bdDespesa = new DespesaBD();
            DataSet   dsTotal   = bdDespesa.GetDespesasMesTotal();
            DataRow   dre       = dsTotal.Tables[0].Rows[0];

            double despesa = 0;

            if (dre["Valor"] != DBNull.Value)
            {
                despesa         = Convert.ToDouble(dre["Valor"]);
                lblDespesa.Text = despesa.ToString();
            }

            //double despesa = Convert.ToDouble(dre["Valor"]);
            //lblDespesa.Text = despesa.ToString();

            double total = venda - despesa;

            lblTotal.Text = Convert.ToString(total);
        }