using Newtonsoft.Json; using System.Collections.Generic; using System.IO; namespace Server.Git { public class XlsxToJson : AbstractGit { public override void ChangeScript() { //저장경로 : repositoryPath //작업할것 //데이터 db에 업로드 List fileList = GetFiles(repositoryPath, ".xlsx"); Dictionary>> sheetList = new Dictionary>>(); List sheets = null; for (int n = 0; n < fileList.Count; n++) { ExcelManager em = new ExcelManager(fileList[n]); if (em.Play()) { sheets = em.sheets; for (int m = 0; m < sheets.Count; m++) { sheetList.Add(sheets[m].name, sheets[m].dicViewer); } } else { Console.WriteLine("-1 : NotUpdate"); return; } } excel = JsonConvert.SerializeObject(sheetList); //현재 서버는 PostgreSQL기준으로 쿼리를 생성하는 코드와 패키지가 세팅되어 있습니다 이점 참고바랍니다 //추가로 해당 기능을 사용하려면 서버에 excel이라는 스키마가 존재하여야 합니다. if (sheets != null) { ExcelSQL sql = new ExcelSQL(sheets); sql.DataUpdate(); } } } }