public virtual int Fill(BalanceReportDataTable dataTable, int?category, DateTime?date) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (&category.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = &category.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (&date.HasValue) { this.Adapter.SelectCommand.Parameters[2].Value = &date.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } if (this.ClearBeforeFill) { dataTable.Clear(); } int num = this.Adapter.Fill(dataTable); return(num); }
public virtual BalanceReportDataTable GetReportByCategory(int?category, DateTime?date) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (&category.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = &category.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (&date.HasValue) { this.Adapter.SelectCommand.Parameters[2].Value = &date.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } BalanceReportDataTable balanceReportDataTable = new BalanceReportDataTable(); this.Adapter.Fill(balanceReportDataTable); return(balanceReportDataTable); }