public ActionResult Edit([Bind(Include = "Id,Name,IsDeleted,ModifiedDate,ModifiedUserId,DeletionDate,DeletionUserId")] CountryViewModel countryViewModel) { if (ModelState.IsValid) { UpdateListCountry(); country.UpdateCountry(countryViewModel); return(RedirectToAction("Index")); } return(View(countryViewModel)); }
public IHttpActionResult UpdateCountry(ACRF_CountryModel objModel) { string result = ""; if (ModelState.IsValid) { try { objModel.UpdatedBy = GlobalFunction.getLoggedInUser(Request.Headers.GetValues("Token").First()); result = objCountryVM.UpdateCountry(objModel); } catch (Exception ex) { ErrorHandlerClass.LogError(ex); result = ex.Message; } } else { result = "Enter Valid Mandatory Fields"; } return(Ok(new { results = result })); }