public IHttpActionResult CreatePost(RentalViewModel model) { var response = new SimpleResponse <RentalViewModel>(); response = iRentalBusiness.Create(model); return(Json(response)); }
public SimpleResponse <RentalDto> Create(RentalDto dto) { var response = new SimpleResponse <RentalDto>(); try { var model = SimpleMapper.Map <RentalDto, RentalViewModel>(dto); var resp = iRentalBusiness.Create(model); response = new SimpleResponse <RentalDto>() { ResponseCode = resp.ResponseCode, ResponseMessage = resp.ResponseMessage, RCode = resp.RCode }; response.Data = SimpleMapper.Map <RentalViewModel, RentalDto>(resp.Data); } catch (Exception ex) { response.ResponseCode = BusinessResponseValues.InternalError; response.ResponseMessage = "Okuma iþleminde hata oluþtu."; SimpleFileLogger.Instance.Error(ex); } return(response); }
public ActionResult CreatePost(RentalViewModel model) { var response = iRentalBusiness.Create(model); if (response.ResponseCode > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError(string.Empty, response.ResponseMessage); return(View("Create", model)); } }
public SimpleResponse <RentalViewModel> Create(RentalViewModel model) { var response = iRentalBusiness.Create(model); return(response); }