var empList = from p in customers
                          select new
                          {
                              p.Personnel_ID,
                              p.PersonName
                          };
            var empTempList = empList.Distinct().ToList();
            Dictionary<string, string> dict = new Dictionary<string, string>();
            if (empTempList != null && empTempList.Count() > 0)
            {
                foreach (var item in empTempList)
                {
                    dict.Add(item.Personnel_ID, item.PersonName);
                }
            }
            ViewBag.EmpList = dict;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-12-29
  • 2022-01-12
  • 2021-12-10
相关资源
相似解决方案