public ActionResult Edit(FormCollection formCollection) { //clsState objState = new clsState(); StateModel objStateModel = new StateModel(); objStateModel.StateID = Convert.ToInt32(formCollection["StateID"]); objStateModel.StateName = formCollection["StateName"]; objStateModel.RefCountryID = Convert.ToInt32(formCollection["RefCountryID"]); objStateModel.AddEditState(objStateModel, clsCommon.Update); return(RedirectToAction("Index", "State")); }
public ActionResult Create(StateModel objStateModel) { if (ModelState.IsValid) { //clsState objState = new clsState(); TryUpdateModel <StateModel>(objStateModel); objStateModel.AddEditState(objStateModel, clsCommon.Insert); return(RedirectToAction("Index")); } else { CountryModel objCountry = new CountryModel(); objStateModel.countryList = objCountry.GetCountryList().ToList(); objStateModel.stateList = objStateModel.GetStateList().ToList(); return(View(objStateModel)); } }