public ActionResult InsertByExcel(object data)
        {
            var file = Request["file"];

            if (System.IO.File.Exists(Server.MapPath("~/UploadFile/Files/temLink.xlsx")))
            {
                System.IO.File.Delete(Server.MapPath("~/UploadFile/Files/temLink.xlsx"));
            }
            System.IO.File.Move(Server.MapPath(ConfigWeb.TempPath + file), Server.MapPath("~/UploadFile/Files/temLink.xlsx"));

            autoArticleRepository.HideAll();


            var       fileName     = Server.MapPath("~/UploadFile/Files/temLink.xlsx");
            const int startRow     = 1;
            var       existingFile = new FileInfo(fileName);

            // Open and read the XlSX file.
            using (var package = new ExcelPackage(existingFile))
            {
                // Get the work book in the file
                ExcelWorkbook workBook = package.Workbook;
                if (workBook != null)
                {
                    if (workBook.Worksheets.Count > 0)
                    {
                        ExcelWorksheet currentWorksheet = workBook.Worksheets.First();
                        for (int i = startRow + 1; i <= currentWorksheet.Dimension.End.Row; i++)
                        {
                            if (currentWorksheet.Cells[i, 2].Value != null)
                            {
                                var typeAuto = new tblArticleAuto
                                {
                                    Name         = currentWorksheet.Cells[i, 1].Value.ToString(),
                                    Link         = currentWorksheet.Cells[i, 2].Value.ToString(),
                                    Xpath        = currentWorksheet.Cells[i, 3].Value.ToString(),
                                    XpathTitle   = currentWorksheet.Cells[i, 4].Value.ToString(),
                                    XpathSummary = currentWorksheet.Cells[i, 5].Value != null ? currentWorksheet.Cells[i, 5].Value.ToString() : string.Empty,
                                    XpathDetail  = currentWorksheet.Cells[i, 6].Value != null ? currentWorksheet.Cells[i, 6].Value.ToString() : string.Empty,
                                    XpathImage   = currentWorksheet.Cells[i, 7].Value != null ? currentWorksheet.Cells[i, 7].Value.ToString() : string.Empty,
                                    XpathPaging  = currentWorksheet.Cells[i, 8].Value != null ? currentWorksheet.Cells[i, 8].Value.ToString() : string.Empty,
                                    TypeID       =
                                        Convert.ToInt32(currentWorksheet.Cells[i, 9].Value != null ? currentWorksheet.Cells[i, 9].Value.ToString() : "3329"),
                                    Xpage            = currentWorksheet.Cells[i, 10].Value != null ? currentWorksheet.Cells[i, 10].Value.ToString() : string.Empty,
                                    ListGroupArticle = currentWorksheet.Cells[i, 11].Value != null ? currentWorksheet.Cells[i, 11].Value.ToString() : string.Empty,
                                    IsDeleted        = false,
                                    IsShow           = true
                                };

                                typeArticleAutoRepository.Add(typeAuto);
                            }
                        }
                    }
                }
            }
            return(Content(string.Empty));
        }
        public ActionResult Action(tblArticleAuto objSubmit)
        {
            if (objSubmit.ID == 0)
            {
                objSubmit.IsDeleted = false;
                objSubmit.IsShow    = true;
                _articleAutoRepository.Add(objSubmit);
            }
            else
            {
                var obj = _articleAutoRepository.GetById <tblArticleAuto>(objSubmit.ID);

                UpdateModel(obj);

                _articleAutoRepository.Update(obj);
            }

            return(Json(new
            {
                Error = false
            }, JsonRequestBehavior.AllowGet));
        }