public string GetRayonName(long?idfsRayon) { if (m_CurrentRayon != null && m_CurrentRayon.idfsRayon == idfsRayon) { return(m_CurrentRayon.strRayonName); } if (idfsRayon == null) { m_CurrentRayon = null; return(string.Empty); } m_CurrentRayon = m_Rayons.Find(c => c.idfsRayon == idfsRayon); return((m_CurrentRayon == null) ? string.Empty : m_CurrentRayon.strRayonName); }
public static string FilterThaiDistricts(DbManagerProxy manager, Int64 regionID, Int64 rayonID) { manager.SetSpCommand("spRayon_SelectLookup" , manager.Parameter("@RegionID", regionID) , manager.Parameter("@ID", null) , manager.Parameter("@LangID", ModelUserContext.CurrentLanguage)); List <RayonLookup> list = new List <RayonLookup>(); List <RayonLookup> filterList = manager.ExecuteList <RayonLookup>(); RayonLookup district = filterList.FirstOrDefault(c => c.idfsRayon == rayonID); List <string> districtID = new List <string>(); list.AddRange(filterList.Where(c => (c.intRowStatus == 0 && c.idfsParent == rayonID) || (c.idfsRayon == district.idfsRayon) || (c.idfsRayon == -101L /*LookupCache.EmptyLineKey*/)).ToList()); list.ForEach(c => { districtID.Add(c.idfsRayon.ToString()); }); string results = string.Join(",", districtID); return(results); }