コード例 #1
0
ファイル: CountriesController.cs プロジェクト: MarlinaJuju/TA
 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));
 }
コード例 #2
0
        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 }));
        }