I have a asp.net MVC4 web project it shows a list of production data for that day. I have added a datetime picker which allows the user to select a date that they want to show information for.
The problem i am having is i am not sure how to go about passing the information back to the view from the method i have inside the controller.
I have the date passing back to the controller. Inside the controller i am doing a LINQ statement that allows me to select only the production data for that day.
[HttpPost]
public ActionResult GetProductionDateInfo(string dp)
{
DateTime SelectedDate = Convert.ToDateTime(dp);
DateTime SelectedDateDayShiftStart = SelectedDate.AddHours(7);
DateTime SelectedDateDayShiftEnd = SelectedDate.AddHours(19);
var ProductionData =
from n in db.tbl_dppITHr
where n.ProductionHour >= SelectedDateDayShiftStart
where n.ProductionHour <= SelectedDateDayShiftEnd
select n;
return View();
I am looking to get the Var ProductionData passed back to the view so that display it inside a table.