欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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;
            }
        }
相关标签: linq where