Ejemplo n.º 1
0
        // *************************************
        // 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
        }
Ejemplo n.º 2
0
 // *************************************
 // URL: /Member/Profile
 // *************************************
 private void GetRegions1()
 {
     LocationAction objLocation = new LocationAction();
     IEnumerable<SelectListItem> lstRegionItem = objLocation.GetAllRegions().Select(r => new SelectListItem { Value = r.id.ToString(), Text = r.name });
     ViewData["RegionItem"] = lstRegionItem;
 }
Ejemplo n.º 3
0
 public void RegionCode()
 {
     LocationAction objLocation = new LocationAction();
     MemberAction objMember = new MemberAction();
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     IList<Model.Region> lstRegion = objLocation.GetAllRegions();
     ViewData["RegionList"] = new SelectList(lstRegion, "code", "code");
 }