コード例 #1
0
        public SimpleResponse Delete(RentalDto dto)
        {
            var response = new SimpleResponse();

            try
            {
                var model = SimpleMapper.Map <RentalDto, RentalViewModel>(dto);
                response = iRentalBusiness.Delete(model);
            }
            catch (Exception ex)
            {
                response.ResponseCode    = BusinessResponseValues.InternalError;
                response.ResponseMessage = "Silme iþleminde hata oluþtu.";
                SimpleFileLogger.Instance.Error(ex);
            }

            return(response);
        }
コード例 #2
0
        public ActionResult DeletePost(int rentalId)
        {
            var response = iRentalBusiness.Delete(rentalId);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(RedirectToAction("Delete", new { rentalId }));
            }
        }
コード例 #3
0
        public IHttpActionResult Delete(int rentalId)
        {
            var result = iRentalBusiness.Delete(rentalId);

            return(Json(result));
        }
コード例 #4
0
        public SimpleResponse Delete(int rentalId)
        {
            var result = iRentalBusiness.Delete(rentalId);

            return(result);
        }