var a = (from t in unitOfWork1.Query<LedgerPosting>().Where(t => t.Oid == 1)
group t by new { t.LedgerId.Oid, t.LedgerId.Name, t.LedgerId.OpeningBalance }
into grp
select new
{
grp.Key.Oid,
grp.Key.Name,
grp.Key.OpeningBalance,
Debit = grp.Sum(t => t.Debit),
Credit = grp.Sum(t => t.Credit),
ClosingStock = (grp.Key.OpeningBalance + grp.Sum(t => t.Debit) - grp.Sum(t => t.Credit))
}
).ToList();
In this i want to pass if condition like if closing stock is negative like closing stock is -2850 so value should be display like 2850 Cr
and closing stock is positive like 2850 so value should be displayed like 2850 Dr
.
How can it Possible.? Help me Please.