예제 #1
0
        public void GetExcel()
        {
            FromExcel e = new FromExcel();
            //var dt = e.OpenExcel(@"C:\Users\ronal\Desktop\excel\GoodsCode_2018_04_26_033012.xlsx");
            //var dt = e.OpenExcel(@"C:\Users\ronal\Desktop\test상품명수집_2018_05_10_155618.xlsx");

            string err = string.Empty;
            //var dt = e.OpenExcel(@"C:\Users\ronal\Desktop\test상품명수집_2018_05_10_155618.xlsx", ref err);
            //var dt = e.OpenExcel(@"C:\Users\ronal\Desktop\미동의테스트.xlsx");
            var dt = e.OpenExcel(@"C:\Users\ronal\Desktop\공백테스트 - 복사본.xlsx", ref err);


            ;
            List <TestDataModel> model = new List <TestDataModel>();

            foreach (DataRow row in dt.Rows)
            {
                TestDataModel t = new TestDataModel()
                {
                    GooodsCode = row[0].ToString(),
                    NameCN     = row[1].ToString(),
                    NameEN     = row[2].ToString(),
                    NameJP     = row[3].ToString(),
                    NameKOR    = row[4].ToString()
                };
                model.Add(t);
            }

            ;
        }
예제 #2
0
 public DataImportController(ILocaleRepository localeRepository, FromExcel fromExcel, IHubContext <DataImportHub> hubContext)
 {
     this._localeRepository = localeRepository;
     this._fromExcel        = fromExcel;
     this._hubContext       = hubContext;
 }