public ActionResult Index() { AutoModel autoModel = new AutoModel() { AantalWielen = 4, Naam = "Bentley" }; return View(autoModel); }
public ActionResult Index(AutoModel model) { return View(model); }
public ActionResult Contact(AutoModel model) { return View(model); }
public ActionResult About(AutoModel model) { return View(model); }
public ActionResult CreateStandardReport(AutoModel model) { string filename = "testje.xlsx"; XLWorkbook workbook = new XLWorkbook(); IXLWorksheet worksheet = workbook.Worksheets.Add("Scheet"); worksheet.ActiveCell = worksheet.Cell(string.Format("A1")); worksheet.ActiveCell.Value = model.Naam; worksheet.ActiveCell = worksheet.Cell(string.Format("B1")); worksheet.ActiveCell.Value = model.AantalWielen; //worksheet.Columns().AdjustToContents(); worksheet.ActiveCell = worksheet.Cell("A1"); try { DownloadExcel(workbook, filename); model.Message = "Succes!"; return View(model); } catch (Exception ex) { model.Message = ex.Message; return View("About", model); } }