private void CarregaDGVs() { DateTime Data = new DateTime(AnoAtual, mesAtual, 1); DALConexao cx = new DALConexao(DadosDaConexao.StringDaConexao); BLLConsultaCMV bll = new BLLConsultaCMV(cx); DataTable table = bll.ListarCustoReceitaPaxAcrescimos(idUnidade, Data); dgvCusto.DataSource = table; dgvCusto.Columns[0].Width = 70; dgvCusto.Columns[0].HeaderText = "DATA"; dgvCusto.Columns[1].Width = 70; dgvCusto.Columns[1].HeaderText = "CUSTO"; dgvCusto.Columns[2].Width = 70; dgvCusto.Columns[2].HeaderText = "+CUSTO"; dgvCusto.Columns[3].Width = 70; dgvCusto.Columns[3].HeaderText = "RECEITA_B"; dgvCusto.Columns[4].Width = 70; dgvCusto.Columns[4].HeaderText = "RECEITA_L"; dgvCusto.Columns[5].Width = 70; dgvCusto.Columns[5].HeaderText = "+RECEITA"; dgvCusto.Columns[6].Width = 50; dgvCusto.Columns[6].HeaderText = "PAX"; dgvCusto.Columns[7].Width = 50; dgvCusto.Columns[7].HeaderText = "+PAX"; //carrega dgvAcrescimos dgvAcrescimos.Rows.Clear(); BLLAcrescimos blla = new BLLAcrescimos(cx); DataTable acrescimos = blla.LocalizarAcrescimos(idUnidade, Data); string data; String[] S; for (int i = 0; i < acrescimos.Rows.Count; i++) { data = Convert.ToDateTime(acrescimos.Rows[i][1]).ToShortDateString(); S = new string[] { acrescimos.Rows[i][0].ToString(), data, acrescimos.Rows[i][2].ToString(), acrescimos.Rows[i][3].ToString(), acrescimos.Rows[i][4].ToString(), acrescimos.Rows[i][5].ToString() }; dgvAcrescimos.Rows.Add(S); } }