I\'m getting the error use of unassigned variable \"ps\" when declaring if paymentstatus is null or has value in the \"if\" statement. I\'m thinking that i allready declared ps
You have declared the local variable but you have not assigned a value. Therefore the compiler helps you to prevent this bug.
PaymentStatus? ps;
// ...
if (ps.HasValue)
So assign a value:
PaymentStatus? ps = null;
// ...
if (ps.HasValue)
However, thix fixes the compiler error but is still pointless since it will never have a value. Maybe you want to use a method parameter instead:
public IList DailyBestsellersReport(PaymentStatus? ps)
{