I'm new to MVC. I have a button to do an export to excel. On the Command class I have FilterData() and ExportData() method. This data have been filtered from a FilterData() method with a select.
public DataTable FilterData()
{
//My code to filter data
sql= "select * from table where date = today()"
}
public IEnumerable<DB_Data> ExportData() //this is for the export button
{
//My code to export data
}
My question is, in my Command class and as the result of the two methods is the same, how can I call the FilterData() method on the ExportData() method so I can export only the rows I have filtered?