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

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

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

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

            response = iActorBusiness.Create(model);
            return(Json(response));
        }
Ejemplo n.º 3
0
        public IActionResult Post([FromBody] ActorVO item)
        {
            if (item == null)
            {
                return(BadRequest());
            }
            var createdItem = _business.Create(item);

            if (createdItem == null)
            {
                return(BadRequest());
            }
            return(new OkObjectResult(createdItem));
        }
Ejemplo n.º 4
0
        public IActionResult CreatePost(ActorViewModel model)
        {
            var response = iActorBusiness.Create(model);

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

            return(response);
        }