コード例 #1
0
        public SimpleResponse <FilmActorDto> Create(FilmActorDto dto)
        {
            var response = new SimpleResponse <FilmActorDto>();

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

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

            return(response);
        }
コード例 #2
0
        public IHttpActionResult CreatePost(FilmActorViewModel model)
        {
            var response = new SimpleResponse <FilmActorViewModel>();

            response = iFilmActorBusiness.Create(model);
            return(Json(response));
        }
コード例 #3
0
        public ActionResult CreatePost(FilmActorViewModel model)
        {
            var response = iFilmActorBusiness.Create(model);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(View("Create", model));
            }
        }
コード例 #4
0
        public SimpleResponse <FilmActorViewModel> Create(FilmActorViewModel model)
        {
            var response = iFilmActorBusiness.Create(model);

            return(response);
        }