`

where并列条件

    博客分类:
  • Linq
阅读更多
/// 合同标的总和
        /// </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;
            }
        }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics