public ActionResult ShowTechnicalReports(string targetControllerName, string targetActionName) { ViewBag.Locations = db.Locations.ToList(); ChooseFactoryVM factoryvm = new ChooseFactoryVM(); factoryvm.TargetControllerName = targetControllerName; factoryvm.TargetActionName = targetActionName; return(View(factoryvm)); }
public ActionResult Details(ChooseFactoryVM chooseFactoryVM) { try { var factory = db.Factory11.FirstOrDefault(p => p.Id == chooseFactoryVM.FactoryId); if (factory != null) { return(RedirectToAction(chooseFactoryVM.TargetActionName, chooseFactoryVM.TargetControllerName, new { Id = factory.Id })); } else { return(View()); } } catch { return(View()); } }