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

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

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

            return(response);
        }
        public IHttpActionResult CreatePost(FilmCategoryViewModel model)
        {
            var response = new SimpleResponse <FilmCategoryViewModel>();

            response = iFilmCategoryBusiness.Create(model);
            return(Json(response));
        }
Ejemplo n.º 3
0
        public IActionResult CreatePost(FilmCategoryViewModel model)
        {
            var response = iFilmCategoryBusiness.Create(model);

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

            return(response);
        }