예제 #1
0
        public IHttpActionResult CreatePost(RentalViewModel model)
        {
            var response = new SimpleResponse <RentalViewModel>();

            response = iRentalBusiness.Create(model);
            return(Json(response));
        }
예제 #2
0
        public SimpleResponse <RentalDto> Create(RentalDto dto)
        {
            var response = new SimpleResponse <RentalDto>();

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

                response.Data = SimpleMapper.Map <RentalViewModel, RentalDto>(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 ActionResult CreatePost(RentalViewModel model)
        {
            var response = iRentalBusiness.Create(model);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(View("Create", model));
            }
        }
예제 #4
0
        public SimpleResponse <RentalViewModel> Create(RentalViewModel model)
        {
            var response = iRentalBusiness.Create(model);

            return(response);
        }