IDataItemDetailService DataItemDetail_Service = new DataItemDetailService();
IList<DataItemDetailEntity> dicList_POINTTYPE = DataItemDetail_Service.GetItemDetailList("MONITORSUGGESTION").ToList(); var a = GetDicName(dicList_POINTTYPE, "A,B,C"); IList<DataItemDetailEntity> dicList_POINTTYPE2 = DataItemDetail_Service.GetItemDetailList("HazardType").ToList(); var b = GetDicName(dicList_POINTTYPE2, "02");private string GetDicName(IList<DataItemDetailEntity> dicList, string dicvalue)
{ string returnValue = string.Empty; if (!dicvalue.IsEmpty()) { string[] strArr = dicvalue.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); returnValue = string.Join(",", dicList.Where(p => strArr.Contains(p.F_ItemValue)).Select(p => p.F_ItemName)); } return returnValue; }