日期:2014-05-17 浏览次数:20473 次
public bool ExistGspComQualify(string ComQualifyId, string CompanyId)
{
string sql = "select count(1) from SysComQualify where LicStatus>=0 and DATEDIFF(DAY,ValidStratDate,ValidUntil)>0 and ComQualifyId = '" + ComQualifyId + "' and CompanyId='" + CompanyId + "' ";
return DBHelperSQL.Exists(sql);
}
//去掉 && (c.ValidUntil.Value - c.ValidStratDate.Value).Days > 0 代码才能正常
public bool ExistGspComQualify1(string ComQualifyId, string CompanyId)
{
string[] licStatusNo = { "-1", "-2", "-10" };
var query = Context.SysComQualify.Where(c => !licStatusNo.Contains(c.LicStatus) && c.ComQualifyId == ComQualifyId && c.CompanyId == CompanyId && (c.ValidUntil.Value - c.ValidStratDate.Value).Days > 0);
return query.Count() > 0 ? true : false;
}