空对象判断

parent 501e26f3
......@@ -762,7 +762,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
{
sheettype = 8;
//amount = Math.Round(doctor?.ScoringAverage ?? 0, 4);
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == type && t.IsTotal == 1)?.FirstOrDefault().CellValue ?? 0, 4);
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 4);
}
var item = new DetailDtos
......@@ -1001,7 +1001,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
{
sheettype = 8;
//amount = Math.Round(special.FirstOrDefault()?.ScoringAverage ?? 0, 4);
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)UnitType.特殊核算组 && t.IsTotal == 1)?.FirstOrDefault().CellValue ?? 0, 4);
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)UnitType.特殊核算组 && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 4);
}
var item = new DetailDtos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment