// ************************************* // URL: /Member/ManageProfile // ************************************* private void GetRegions() { #region LocationAction objLocation = new LocationAction(); MemberAction objMember = new MemberAction(); Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject); Location locData = objLocation.GetLocationDetailByMemberId(memberData.id.ToString()); string cityId = ""; string regionId = ""; if (locData != null) { if (locData.City != null) { cityId = locData.City.id.ToString(); if (locData.City.Region != null) { regionId = locData.City.Region.id.ToString(); } } } IList<Model.Region> lstRegionItem = objLocation.GetAllRegions(); ViewData["CityId"] = cityId; if (regionId.Length > 0) { Model.Region selLstRegionItem = objLocation.GetRegionById(regionId); ViewData["RegionItem"] = new SelectList(lstRegionItem, "id", "name", selLstRegionItem.id); } else { ViewData["RegionItem"] = new SelectList(lstRegionItem, "id", "name"); } #endregion }