Esempio n. 1
0
        public ActionResult Index(LectorExcelModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.MyExcelFile.FileName.Contains("xls") || model.MyExcelFile.FileName.Contains("xlsx"))
            {
                DataTable dt         = GetDataTableFromSpreadsheet(model.MyExcelFile.InputStream, false);
                string    strContent = "<p>Thanks for uploading the file</p>" + ConvertDataTableToHTMLTable(dt);
                model.MSExcelTable = strContent;
            }
            else
            {
                model.MSExcelTable = "Extensión incorrecta.";
            }

            return(View(model));
        }
Esempio n. 2
0
        // GET: LectorExcel
        public ActionResult Index()
        {
            var model = new LectorExcelModel();

            return(View(model));
        }