/// <summary> /// Generate install billing OCC combobox /// </summary> /// <param name="helper"></param> /// <param name="id"></param> /// <param name="ContractCode"></param> /// <param name="attribute"></param> /// <param name="include_idx0"></param> /// <returns></returns> public static MvcHtmlString InstallBillingOCCComboBox(this HtmlHelper helper, string id, string ContractCode = null, object attribute = null, bool include_idx0 = true) { List <tbt_BillingBasic> lst = new List <tbt_BillingBasic>(); try { IBillingHandler handle = ServiceContainer.GetService <IBillingHandler>() as IBillingHandler; lst = handle.GetTbt_BillingBasicListData(ContractCode); //var sortedList = from p in lst // orderby p.BillingOCC // select p; var sortedList = (from t in lst orderby t.BillingOCC group t by new { BillingOCC = t.BillingOCC } into g select g.FirstOrDefault()); lst = sortedList.ToList <tbt_BillingBasic>(); } catch { lst = new List <tbt_BillingBasic>(); } return(CommonUtil.CommonComboBox <tbt_BillingBasic>(id, lst, "BillingOCC", "BillingOCC", attribute)); }