LINQ for SuperAdmin (Add the property count) -- join & count function
来源:互联网 发布:平面美工 招聘条件 编辑:程序博客网 时间:2024/05/29 03:18
LINQ Code
//Search with linq var TBsearch = from tb in dc.Agencies join tb1 in dc.Users on tb.idUser equals tb1.idUser join tb2 in dc.AgencyOffices on tb.idAgency equals tb2.idAgency join tb3 in dc.Agents on tb2.idOffice equals tb3.idOffice join tb4 in dc.Properties on tb3.idUser equals tb4.idCreatedBy into ps where (userempty || tb.idUser.ToString().Equals(idUser)) && (agencyempty || tb.idAgency.ToString().Equals(queryagencyid)) && (addressempty || (tb1.AddressLine1 + tb1.AddressLine2 + tb1.AddressLine3).Contains(addrkeywordAr[0]) && (tb1.AddressLine1 + tb1.AddressLine2 + tb1.AddressLine3).Contains(addrkeywordAr[1]) && (tb1.AddressLine1 + tb1.AddressLine2 + tb1.AddressLine3).Contains(addrkeywordAr[2]) )&& (nameempty || (tb1.UserFName + tb1.UserSName + tb1.UserName).Contains(namekeywordAr[0]) && (tb1.UserFName + tb1.UserSName + tb1.UserName).Contains(namekeywordAr[1]) && (tb1.UserFName + tb1.UserSName + tb1.UserName).Contains(namekeywordAr[2]) ) && (startempty || tb1.UserFName.StartsWith(startwith)) && (officeempty || tb.idAgency == oid_aid) && (usertypeempty || tb1.idUserType.ToString().Equals(queryusertypeid)) select new { tb.idAgency, tb.PublicPwd, tb.idUser, tb1.Name, tb1.UserFName, tb1.UserName, Address=tb1.AddressLine1+tb1.AddressLine2+tb1.AddressLine3, pcounts = ps.Count(), };
Call LINQ query Result
listStr += "<td class='" + styleClass + "'>" + resultList.ElementAt(i).pcounts + "</td>";
- LINQ for SuperAdmin (Add the property count) -- join & count function
- PHP Tip: Getting the property count for an object
- The " count " function in map (STL)
- LINQ to SQL Count/Sum/Min/Max/Avg Join
- superAdmin: Quickly change the status of EmailReport && Property
- LINQ之Count
- Linq 4pm superadmin
- Incorrect parameter count in the call to native function 'ISNULL'
- function to count the number of "1" of one byte
- Count
- COUNT
- count
- Count
- count
- count
- count
- count
- Count
- 线段树
- Gitorious Remote Command Execution
- Qt多国语言(国际化)问题小结 (2011-04-24 16:53)转载
- s3c2440 uda1341声卡驱动分析(oos) (2011-03-10 12:56)转载
- UDA1341在linux2.6.30上的移植 (2011-03-10 12:55)转载
- LINQ for SuperAdmin (Add the property count) -- join & count function
- QT-Linguist使用方法48043111062 (2011-03-08 18:25)转载
- 中国集成电路工业困局——市场、科技和产业相互隔离
- Oracle11g新特性导致空表不能导出问题
- HTC的鸿门宴
- qt程序中文国际化
- POJ1250 Tanning Salon 简单模拟
- 英特尔今年资本支出 超越三星台积
- Windows Azure Platform 2nd Edition Note