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();
在此我想通过条件,如果收盘股票为负,如收盘股票为 -2850,则价值应显示为类似2850 Cr
,收盘股票为正,如 2850,因此价值应显示为2850 Dr
。
怎么可能。?请帮帮我。