public List <Reporte_Compras> listarOrdenes(int?mes, int?id) { if (mes == -1 || mes == null) { mes = -1; } if (id == -1 || id == null) { id = -1; } List <Reporte_Compras> lista = new List <Reporte_Compras>(); Reporte_Compras reporte = null; SqlConnection cn = new Acceso().getConnection(); SqlCommand cmd = new SqlCommand("SP_REPORTE_COMPRAS", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@MES", mes); cmd.Parameters.AddWithValue("@ID_CLI", id); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { reporte = new Reporte_Compras() { idCompras = Int32.Parse(dr[0].ToString()), fecOrden = DateTime.Parse(dr[1].ToString()), nomCli = dr[2].ToString(), Estado = dr[3].ToString() }; lista.Add(reporte); } return(lista); }
private void ComprasB1_Click_1(object sender, EventArgs e) { //Se abrira el reporte de compras Reporte_Compras C1 = new Reporte_Compras(); C1.ShowDialog(); }