where并列条件
程序员文章站
2022-05-10 15:28:12
...
/// 合同标的总和
/// </summary>
/// <param name="contractId">合同Id</param>
/// <param name="userId">用户Id</param>
/// <returns>合同标的总和</returns>
/// <remarks>jun.2011.08.03</remarks>
public string GetSubjectMatterSum(string contractId, int userId)
{
try
{
WCMSDATA wd = DataEntity.Initializes();
var query = from sub in wd.WOO_CONT_SUBJECTMATTER
where (sub.CONTRACT_ID == Convert.ToInt32(contractId) || sub.CONTRACT_ID == (0 - userId))
select sub.FINAL_AMOUNT_MONEY;
return query.Sum().ToString();
}
catch (Exception e)
{
WooLogger.Error(e.ToString());
return String.Empty;
}
}
/// </summary>
/// <param name="contractId">合同Id</param>
/// <param name="userId">用户Id</param>
/// <returns>合同标的总和</returns>
/// <remarks>jun.2011.08.03</remarks>
public string GetSubjectMatterSum(string contractId, int userId)
{
try
{
WCMSDATA wd = DataEntity.Initializes();
var query = from sub in wd.WOO_CONT_SUBJECTMATTER
where (sub.CONTRACT_ID == Convert.ToInt32(contractId) || sub.CONTRACT_ID == (0 - userId))
select sub.FINAL_AMOUNT_MONEY;
return query.Sum().ToString();
}
catch (Exception e)
{
WooLogger.Error(e.ToString());
return String.Empty;
}
}