public ActionResult Edit(FormCollection formCollection) { CityModel objCityModel = new CityModel(); objCityModel.CityID = Convert.ToInt32(formCollection["CityID"]); objCityModel.CityName = formCollection["CityName"]; objCityModel.RefStateID = Convert.ToInt32(formCollection["RefStateID"]); objCityModel.RefCountryID = Convert.ToInt32(formCollection["RefCountryID"]); objCityModel.AddEditCity(objCityModel, clsCommon.Update); return(RedirectToAction("Index", "City")); }
public ActionResult Create_Post() { CityModel objCityModel = new CityModel(); if (ModelState.IsValid) { TryUpdateModel <CityModel>(objCityModel); objCityModel.AddEditCity(objCityModel, clsCommon.Insert); return(RedirectToAction("Index")); } else { CountryModel objCountry = new CountryModel(); objCityModel.countryList = objCountry.GetCountryList().ToList(); StateModel objStateModel = new StateModel(); objCityModel.stateList = objStateModel.GetStateList().ToList(); return(View(objCityModel)); } }