public IHttpActionResult CreatePost(CountryViewModel model) { var response = new SimpleResponse <CountryViewModel>(); response = iCountryBusiness.Create(model); return(Json(response)); }
public SimpleResponse <CountryDto> Create(CountryDto dto) { var response = new SimpleResponse <CountryDto>(); try { var model = SimpleMapper.Map <CountryDto, CountryViewModel>(dto); var resp = iCountryBusiness.Create(model); response = new SimpleResponse <CountryDto>() { ResponseCode = resp.ResponseCode, ResponseMessage = resp.ResponseMessage, RCode = resp.RCode }; response.Data = SimpleMapper.Map <CountryViewModel, CountryDto>(resp.Data); } catch (Exception ex) { response.ResponseCode = BusinessResponseValues.InternalError; response.ResponseMessage = "Okuma iþleminde hata oluþtu."; SimpleFileLogger.Instance.Error(ex); } return(response); }
public IActionResult CreatePost(CountryViewModel model) { var response = iCountryBusiness.Create(model); if (response.ResponseCode > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError(string.Empty, response.ResponseMessage); return(View("Create", model)); } }
public IActionResult Post([FromBody] Country input) { try { _Business.Create(input); return(Ok(input)); } catch (EqualUniqueRowException ex) { AppLogger.Error(ex.Message, ex); return(StatusCode(Microsoft.AspNetCore.Http.StatusCodes.Status206PartialContent, ex.Message)); } catch (Exception ex) { AppLogger.Error(ex.Message, ex); return(StatusCode(Microsoft.AspNetCore.Http.StatusCodes.Status500InternalServerError, ex.Message)); } }
public SimpleResponse <CountryViewModel> Create(CountryViewModel model) { var response = iCountryBusiness.Create(model); return(response); }