I have two controllers.
one is
public partial class CatalogController : BaseNopController
{
[NonAction]
protected IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(IEnumerable<Product> products,
bool preparePriceModel = true, bool preparePictureModel = true,
int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
bool forceRedirectionAfterAddingToCart = false)
{
var models = new List<ProductOverviewModel>();
foreach (var product in products)
{
var model = new ProductOverviewModel()
{
Id = product.Id,
Name = product.GetLocalized(x => x.Name),
ShortDescription = product.GetLocalized(x => x.ShortDescription),
FullDescription = product.GetLocalized(x => x.FullDescription),
SeName = product.GetSeName(),
};
}
}
another one is
public class HireController : BaseNopController
{
[HttpPost]
public ActionResult CheckData(string submitButton)
{
switch (submitButton)
{
case "Yes":
// I want to call CatalogController --> PrepareProductOverviewModels
case "No":
return RedirectToRoute("detailform");
default:
return RedirectToRoute("detailform");
}
}
}
Inside Hire controller --> CheckData function , I want to call CatalogController -->PrepareProductOverviewModels(...) How can I do it??