예제 #1
0
        public ActionResult Edit(DiscountVM discount)
        {
            if (ModelState.IsValid)
            {
                Mapper.Initialize(c => c.CreateMap <DiscountVM, DiscountDTO>());
                DiscountDTO dto = Mapper.Map <DiscountVM, DiscountDTO>(discount);

                OperationDetails op = _discountService.EditDiscount(dto);
                return(Json(new { Succedeed = op.Succedeed, message = op.Message, prop = op.Property }));
            }
            else
            {
                return(View(discount));
            }
        }