The controller display the data from the excel sheet. I need that the controller check the excel sheet every 1 hour, also the views should be updated. This is my controller code:
string path3 = "D:/Project/Sesame Incident Dump_20160317.xls";
Excel.Application application3 = new Excel.Application();
Excel.Workbook workbook3 = application3.Workbooks.Open(path3);
Excel.Worksheet worksheet3 = workbook3.ActiveSheet;
Excel.Range range3 = worksheet3.UsedRange;
List<SesameIncident> ListSesameIncident = new List<SesameIncident>();
for (int row = 2; row <= range3.Rows.Count; row++)
{
SesameIncident S = new SesameIncident();
S.Number = (((Excel.Range)range3.Cells[row, 1]).Text);
S.AssignedTo = (((Excel.Range)range3.Cells[row, 5]).Text);
S.Opened = (((Excel.Range)range3.Cells[row, 6]).Text);
S.Status = (((Excel.Range)range3.Cells[row, 7]).Text);
S.Priority = (((Excel.Range)range3.Cells[row, 10]).Text);
S.AssignedGroup = (((Excel.Range)range3.Cells[row, 12]).Text);
ListSesameIncident.Add(S);
}
ViewBag.ListSesameIncidents = ListSesameIncident
.Where(x => x.Status == "Pending Customer").Take(13);