public IHttpActionResult CreatePost(InventoryViewModel model) { var response = new SimpleResponse <InventoryViewModel>(); response = iInventoryBusiness.Create(model); return(Json(response)); }
public SimpleResponse <InventoryDto> Create(InventoryDto dto) { var response = new SimpleResponse <InventoryDto>(); try { var model = SimpleMapper.Map <InventoryDto, InventoryViewModel>(dto); var resp = iInventoryBusiness.Create(model); response = new SimpleResponse <InventoryDto>() { ResponseCode = resp.ResponseCode, ResponseMessage = resp.ResponseMessage, RCode = resp.RCode }; response.Data = SimpleMapper.Map <InventoryViewModel, InventoryDto>(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(InventoryViewModel model) { var response = iInventoryBusiness.Create(model); if (response.ResponseCode > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError(string.Empty, response.ResponseMessage); return(View("Create", model)); } }
public SimpleResponse <InventoryViewModel> Create(InventoryViewModel model) { var response = iInventoryBusiness.Create(model); return(response); }