/// <summary> /// 获取楼盘照片个数 /// </summary> /// <param name="projectId"></param> /// <param name="cityId"></param> /// <param name="companyId"></param> /// <param name="_db"></param> /// <returns></returns> public static int GetLNKPPhotoCountByProjectId(int projectId, int cityId, int companyId, DataBase _db = null) { DataBase db = new DataBase(_db); int count = 0; try { string sql = "{0} Valid=1 and CityId={1} and ProjectId={2} and FxtCompanyId={3} "; sql = string.Format(sql, NHibernateUtility.GetMSSQL_SQL_COUNT(NHibernateUtility.TableName_LNKPPhoto), cityId, projectId, companyId); object obj = db.DB.GetCustomSQLQueryUniqueResult <object>(sql, null); count = Convert.ToInt32(obj); } catch (Exception ex) { log.Error("获取照片个数", ex); } db.Close(); return(count); }