選擇資料庫聯絡人【選擇之後將不在列表】
阿新 • • 發佈:2018-12-07
1.組合id
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 var badid = ""; 2 var selectedRow = $('#shopinfo').jfGridGet('rowdatas'); 3 for (var i = 0; i < selectedRow.length; i++) { 4 badid += "'" + selectedRow[i].F_ID + "',"; 5 } 6View Codeif (badid.length > 0) { 7 badid = badid.substring(0, badid.length - 1); 8 }
2.
not in
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 private void aa(StringBuilder strSql, JObject queryParam, DynamicParameters dp) 2 { 3View Codeif (!queryParam["AreaName"].IsEmpty()) 4 { 5 dp.Add("AreaName", "" + queryParam["AreaName"].ToString() + "", DbType.String); 6 strSql.Append(" AND a.AreaName = @AreaName "); 7 } 8 if (!queryParam["ProjectId"].IsEmpty())9 { 10 dp.Add("ProjectId", "" + queryParam["ProjectId"].ToString() + "", DbType.String); 11 strSql.Append(" AND a.ProjectId = @ProjectId "); 12 } 13 if (!queryParam["Keyword"].IsEmpty()) 14 { 15 dp.Add("Keyword", "%" + queryParam["Keyword"].ToString() + "%", DbType.String); 16 strSql.Append(" AND a.Name like @Keyword "); 17 } 18 if (!queryParam["badid"].IsEmpty()) 19 { 20 strSql.Append(" AND a.F_ID not in("+ queryParam["badid"].ToString() + ") "); 21 } 22 }