Example #1
0
        protected List <OrderPandianWithMonth> FetchOrders()
        {
            var ordersList = new List <OrderPandianWithMonth>();

            foreach (var file in this.GetExcelFiles())
            {
                using (var excel = new NPOIExcel(file.FullName))
                {
                    var table      = excel.ExcelToDataTable(null, true);
                    var orderItems = this.ResolveOrders(table, file.FullName);
                    if (orderItems != null && orderItems.Any())
                    {
                        ordersList.AddRange(orderItems);
                    }
                }
            }
            return(ordersList);
        }
Example #2
0
        protected override List <OrderEntity> FetchOrders()
        {
            var ordersList = new List <OrderEntity>();

            foreach (var file in this.GetExcelFiles())
            {
                using (var excel = new NPOIExcel(file.FullName))
                {
                    var table = excel.ExcelToDataTable(null, true);
                    if (table != null)
                    {
                        this.ResolveOrders(table, file.FullName, ordersList);
                    }
                    else
                    {
                        OnUIMessageEventHandle($"电商-尖叫严选导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
                        continue;
                    }
                }
                OnUIMessageEventHandle($"电商-尖叫严选导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
            }
            return(ordersList);
        }
Example #3
0
        protected override List <OrderEntity> FetchOrders()
        {
            var ordersList = new List <OrderEntity>();

            foreach (var file in this.GetExcelFiles())
            {
                switch (file.BankName)
                {
                case "ABC":
                    using (var excel = new NPOIExcel(file.FullName))
                    {
                        var table = excel.ExcelToDataTable(null, true);
                        if (table != null)
                        {
                            this.ResolveOrders_ABC(table, file, ordersList);
                        }
                        else
                        {
                            OnUIMessageEventHandle($"{NameDesc}导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
                            continue;
                        }
                    }
                    break;

                case "CITIC":    //中信
                    using (var excel = new NPOIExcel(file.FullName))
                    {
                        var table = excel.ExcelToDataTable(null, true);
                        if (table != null)
                        {
                            this.ResolveOrders_CITIC(table, file, ordersList);
                        }
                        else
                        {
                            OnUIMessageEventHandle($"{NameDesc}导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
                            continue;
                        }
                    }
                    break;

                case "NANJING":
                    using (var excel = new NPOIExcel(file.FullName))
                    {
                        var table = excel.ExcelToDataTable(null, true);
                        if (table != null)
                        {
                            this.ResolveOrders_NANJING(table, file, ordersList);
                        }
                        else
                        {
                            OnUIMessageEventHandle($"{NameDesc}导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
                            continue;
                        }
                    }
                    break;
                }
                //using (var excel = new NPOIExcel(file.FullName))
                //{
                //    var table = excel.ExcelToDataTable(null, true);
                //    if (table != null)
                //        this.ResolveOrders(table, file, ordersList);
                //    else
                //    {
                //        OnUIMessageEventHandle($"{NameDesc}导入文件:{file.FileName}解析完毕,当前订单数{ordersList.Count}");
                //        continue;
                //    }

                //}
                //   file.FileName = file.
            }

            return(ordersList);
        }