/// <summary> /// Invoked using $.get when the end-user selects an option from the drop down /// </summary> /// <param name="plantId">The value which the user selected (plantId)</param> /// <returns>Partial view which contains the treeview (TreeView.ascx)</returns> public ActionResult TreeView(int plantId) { // data source for the treeview. We are using dummy data here. var plants = new [] { new Plant() { ID = plantId, Name = "Plant " + plantId, ProductionLines = { new ProductionLine { ID = plantId + 1, Name = "First Production line (PlantID " + plantId + ", ProductionLineID " + (plantId + 1) + ")" }, new ProductionLine { ID = plantId + 2, Name = "Second Production line (PlantID " + plantId + ", ProductionLineID " + (plantId + 2) + ")" }, } } }; return PartialView(plants); }
public ActionResult ProductionRequests(int productionLineId) { // data source for the grid. We are using dummy data here. var productionRequests = new[] { new ProductionRequest { Name = "First production request (ProductionLineID " + productionLineId + ")" }, new ProductionRequest { Name = "Second production request (ProductionLineID " + productionLineId + ")" } }; return View(new GridModel(productionRequests)); }