コード例 #1
0
        public IHttpActionResult CreatePost(InventoryViewModel model)
        {
            var response = new SimpleResponse <InventoryViewModel>();

            response = iInventoryBusiness.Create(model);
            return(Json(response));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        public SimpleResponse <InventoryViewModel> Create(InventoryViewModel model)
        {
            var response = iInventoryBusiness.Create(model);

            return(response);
        }