示例#1
0
        public IActionResult ChangePrice(int id)           //receive id and create a ChangePubDateDto and pass it to the View
        {
            var service = new ChangePriceService(_context);
            var dto     = service.GetOriginal(id);

            return(View(dto));
        }
示例#2
0
        public IActionResult ChangePrice(ChangePriceDto dto)  //the ChangePubDateDto is received from the above method
        {
            var service = new ChangePriceService(_context);

            service.UpdateProduct(dto);

            return(View("ProductUpdated", "Successfully changed publication date"));
        }