コード例 #1
0
        public ActionResult EditCountry(int id)
        {
            var result = Sp.GetCountryList().Where(x => x.CountryId == id);

            foreach (var data in result)
            {
                EditCountryCityStateClass ec = new EditCountryCityStateClass()
                {
                    CountryId   = data.CountryId,
                    CountryName = data.CountryName
                };
                EditList.Add(ec);
            }
            return(RedirectToAction("CountryForm"));
        }
コード例 #2
0
        public ActionResult EditCity(int id)
        {
            var result = Sp.GetCityList().Where(x => x.CityId == id);

            foreach (var data in result)
            {
                int sid   = data.StateId;
                var state = Sp.GetStateByid(sid);
                EditCountryCityStateClass ec = new EditCountryCityStateClass()
                {
                    CityId    = data.CityId,
                    CityName  = data.CityName,
                    StateId   = data.StateId,
                    CountryId = state.CountryId
                };
                EditList.Add(ec);
            }
            return(RedirectToAction("CityForm"));
        }
コード例 #3
0
        public ActionResult EditState(int id)
        {
            var result = Sp.GetStateList().Where(x => x.StateId == id);

            foreach (var data in result)
            {
                int cid         = data.CountryId;
                var countryname = Sp.GetCountryByid(cid);
                EditCountryCityStateClass ec = new EditCountryCityStateClass()
                {
                    CountryId   = data.CountryId,
                    CountryName = countryname.CountryName,
                    StateId     = data.StateId,
                    StateName   = data.StateName
                };
                EditList.Add(ec);
            }
            return(RedirectToAction("StateForm"));
        }