Example #1
0
        public ActionResult UploadExcel(HttpPostedFileBase fileUpload)
        {
            if (fileUpload != null)
            {
                bool     valid;
                string   directorFile = "~/ DetailFormatInExcel / ";
                string[] cols         = new string[1];
                cols[0] = "SerialNo";
                DataTable data_table = Extentions.ExcelFileToDataTable(fileUpload, cols, out valid, directorFile);

                return(new JsonNetResult()
                {
                    Data = data_table, JsonRequestBehavior = JsonRequestBehavior.AllowGet
                });
            }
            else
            {
                return(RedirectToAction("CreateEdit"));
            }
        }