Ejemplo n.º 1
0
 /// <summary>
 /// 获取公司列表
 /// </summary>
 /// <param name="MenuService"></param>
 /// <param name="key">移除当前键,当为""或null不移除</param>
 /// <returns></returns>
 public static List<ChooseDictionary> ListAllCompanyInfo(ICompanyService CompanyService, string key)
 {
     NameValueCollection nvc = new NameValueCollection();
     nvc.Add("isvalid", "1");
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add("menuname", "asc");
     List<CompanyInfo> datalist = CompanyService.ListAllByCondition(nvc, orderby);
     if (!string.IsNullOrEmpty(key))
     {
         datalist.Remove(datalist.Where(x => x.Id.Equals(key)).SingleOrDefault());
     }
     var dicMenu = (from slist in datalist
                    select new ChooseDictionary { Text = slist.CompanyName, Value = slist.Id, ParentId = slist.ParentId }).ToList();
     return dicMenu;
 }