private void buttonBDVendas_Click(object sender, EventArgs e) { chart1.Series[0].Points.Clear(); BDVendasBLL.conecta(); while (!Erro.getErro()) { BDVendasBLL.getProximo(); chart1.Series[0].Points.AddXY(BDVendasBLL.getBDX(), BDVendasBLL.getBDY()); } BDVendasBLL.desconecta(); }
public static void getProximo() { Erro.setErro(false); ++i; if (i >= dt.Rows.Count) { Erro.setErro(true); } else { BDVendasBLL.setBDX((int)dt.Rows[i].ItemArray[0]); BDVendasBLL.setBDY((int)dt.Rows[i].ItemArray[1]); } }