Exemplo n.º 1
0
        public SimpleResponse <StoreDto> Create(StoreDto dto)
        {
            var response = new SimpleResponse <StoreDto>();

            try
            {
                var model = SimpleMapper.Map <StoreDto, StoreViewModel>(dto);
                var resp  = iStoreBusiness.Create(model);
                response = new SimpleResponse <StoreDto>()
                {
                    ResponseCode    = resp.ResponseCode,
                    ResponseMessage = resp.ResponseMessage,
                    RCode           = resp.RCode
                };

                response.Data = SimpleMapper.Map <StoreViewModel, StoreDto>(resp.Data);
            }
            catch (Exception ex)
            {
                response.ResponseCode    = BusinessResponseValues.InternalError;
                response.ResponseMessage = "Okuma iþleminde hata oluþtu.";
                SimpleFileLogger.Instance.Error(ex);
            }

            return(response);
        }
Exemplo n.º 2
0
        public IHttpActionResult CreatePost(StoreViewModel model)
        {
            var response = new SimpleResponse <StoreViewModel>();

            response = iStoreBusiness.Create(model);
            return(Json(response));
        }
Exemplo n.º 3
0
 public IActionResult Post([FromBody] Store store)
 {
     if (store == null)
     {
         return(BadRequest());
     }
     return(new ObjectResult(_storeBusiness.Create(store)));
 }
Exemplo n.º 4
0
        public IActionResult CreatePost(StoreViewModel model)
        {
            var response = iStoreBusiness.Create(model);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(View("Create", model));
            }
        }
Exemplo n.º 5
0
        public SimpleResponse <StoreViewModel> Create(StoreViewModel model)
        {
            var response = iStoreBusiness.Create(model);

            return(response);
        }