Beispiel #1
0
 public ActionResult Index()
 {
     AutoModel autoModel = new AutoModel()
     {
         AantalWielen = 4,
         Naam = "Bentley"
     };
     return View(autoModel);
 }
Beispiel #2
0
 public ActionResult Index(AutoModel model)
 {
     return View(model);
 }
Beispiel #3
0
 public ActionResult Contact(AutoModel model)
 {
     return View(model);
 }
Beispiel #4
0
 public ActionResult About(AutoModel model)
 {
     return View(model);
 }
Beispiel #5
-1
        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);
            }
        }