public IActionResult Detailes(long id, ProductDeletionModel model = null)
        {
            long itemCount = _workshopRepository.GetTotalMaterialsCountInProduct(id);

            if (model == null)
            {
                model = new ProductDeletionModel();
            }
            model.Pages = (itemCount / model.Items) + 1;
            if (model.Page > model.Pages)
            {
                model.Page = model.Pages;
            }
            model.Materials = _workshopRepository.GetMaterialsUsedInProductPaged(id, (int)model.Page, (int)model.Items);
            model.Product   = _workshopRepository.GetProduct(id);

            return(View(model));
        }
 public IActionResult DetailesPageProcess(ProductDeletionModel viewModel = null)
 {
     return(RedirectToAction(nameof(Detailes), new { id = viewModel.Product.Id, page = viewModel.Page }));
 }