Пример #1
0
        public IActionResult Detail(int rentalId)
        {
            var response = iRentalBusiness.Read(rentalId);

            if (response.Data == null || response.ResponseCode < 1)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            return(View(response.Data, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult Detail(int rentalId)
        {
            var response = iRentalBusiness.Read(rentalId);

            if (response.Data == null || response.ResponseCode < 1)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            return(View(response.Data));
        }
Пример #3
0
        public SimpleResponse <RentalDto> Read(int rentalId)
        {
            var response = new SimpleResponse <RentalDto>();

            try
            {
                var resp        = iRentalBusiness.Read(rentalId);
                var isNullOrDef = resp.Data == null || resp.Data == default(RentalViewModel);
                response.ResponseCode    = isNullOrDef ? BusinessResponseValues.NullEntityValue : 1;
                response.RCode           = resp.RCode;
                response.ResponseMessage = resp.ResponseMessage;
                if (!isNullOrDef)
                {
                    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);
        }
Пример #4
0
        public IHttpActionResult Detail(int rentalId)
        {
            var modelResult = iRentalBusiness.Read(rentalId);

            return(Json(modelResult));
        }
Пример #5
0
        public SimpleResponse <RentalViewModel> Detail(int rentalId)
        {
            var response = iRentalBusiness.Read(rentalId);

            return(response);
        }