public static List<ResultInfo> ImportByAmazon(AccountType account, string fileName, ISession NSession)
        {

            List<ResultInfo> results = new List<ResultInfo>();
            CsvReader csv = new CsvReader(fileName, Encoding.Default);

            List<Dictionary<string, string>> lsitss = csv.ReadAllData();
            Dictionary<string, int> listOrder = new Dictionary<string, int>();
            foreach (Dictionary<string, string> item in lsitss)
            {
                if (item.Count < 10)//判断列数
                    continue;
                string OrderExNo = item["order-id"];

                if (listOrder.ContainsKey(OrderExNo))
                {
                    CreateOrderPruduct(item["sku"], Utilities.ToInt(item["quantity-purchased"]), item["sku"], "", 0, "", listOrder[OrderExNo], OrderExNo, NSession);
                    continue;
                }
                bool isExist = IsExist(OrderExNo, NSession);
                if (!isExist)
                {
                    OrderType order = new OrderType { IsMerger = 0, Enabled = 1, IsOutOfStock = 0, IsRepeat = 0, IsSplit = 0, Status = OrderStatusEnum.待处理.ToString(), IsPrint = 0, CreateOn = DateTime.Now, ScanningOn = DateTime.Now };
                    order.OrderNo = Utilities.GetOrderNo(NSession);
                    try
                    {
                        order.CurrencyCode = item["currency"].ToUpper().Trim();
                    }
                    catch (Exception)
                    {
                        order.CurrencyCode = "USD";
                    }
                    order.OrderExNo = item["order-id"];
                    //order.Amount =Utilities.ToDouble(dr["订单金额"]);
                    //order.BuyerMemo = dr["订单备注"].ToString();
                    order.Country = item["ship-country"];
                    order.BuyerName = item["buyer-name"];
                    order.BuyerEmail = item["buyer-email"];
                    order.TId = "";
                    order.Account = account.AccountName;
                    order.GenerateOn = Convert.ToDateTime(item["payments-date"]);
                    order.Platform = PlatformEnum.Amazon.ToString();
                    order.AddressId = CreateAddress(item["recipient-name"], item["ship-address-1"] + item["ship-address-2"] + item["ship-address-3"], item["ship-city"], item["ship-state"], item["ship-country"], item["ship-country"], item["buyer-phone-number"], item["buyer-phone-number"], item["buyer-email"], item["ship-postal-code"], 0, NSession);
                    NSession.Save(order);
                    NSession.Flush();
                    CreateOrderPruduct(item["sku"], Utilities.ToInt(item["quantity-purchased"]), item["sku"], "", 0, "", order.Id, order.OrderNo, NSession);
                    results.Add(GetResult(OrderExNo, "", "导入成功"));
                    listOrder.Add(OrderExNo, order.Id);
                    LoggerUtil.GetOrderRecord(order, "订单导入", "导入成功", NSession);
                }
                else
                {
                    results.Add(GetResult(OrderExNo, "订单已存在", "导入失败"));
                }
            }
            return results;
        }
        public static List<ResultInfo> ImportByGmarket(AccountType account, string fileName, ISession NSession)
        {

            List<ResultInfo> results = new List<ResultInfo>();
            CsvReader csv = new CsvReader(fileName, Encoding.Default);

            List<Dictionary<string, string>> lsitss = csv.ReadAllData();
            Dictionary<string, int> listOrder = new Dictionary<string, int>();
            foreach (Dictionary<string, string> item in lsitss)
            {
                try
                {
                    if (item.Count < 10)//判断列数
                        continue;
                    string OrderExNo = item["Cart no."];
                    double price = Convert.ToDouble(item["Settle Price"].Replace(",", ""));
                    if (listOrder.ContainsKey(OrderExNo))
                    {
                        CreateOrderPruduct(item["Item code"], item["Option Code"], Utilities.ToInt(item["Qty."]), item["Item"], item["Options"], 0, "", listOrder[OrderExNo], OrderExNo, NSession);
                        NSession.CreateSQLQuery("update orders set Amount=Amount+" + price + " where Id=" +
                                                listOrder[OrderExNo]).UniqueResult();
                        continue;
                    }
                    bool isExist = IsExist(OrderExNo, NSession, account.AccountName);
                    if (!isExist)
                    {
                        OrderType order = new OrderType { IsMerger = 0, Enabled = 1, IsOutOfStock = 0, IsRepeat = 0, IsSplit = 0, Status = OrderStatusEnum.待处理.ToString(), IsPrint = 0, CreateOn = DateTime.Now, ScanningOn = DateTime.Now };
                        order.OrderNo = Utilities.GetOrderNo(NSession);
                        order.CurrencyCode = item["Currency"];
                        order.OrderExNo = OrderExNo;
                        order.Amount = Utilities.ToDouble(item["Settle Price"]);
                        order.BuyerMemo = item["Memo to Seller"];
                        order.Country = item["Nation"];
                        order.BuyerName = item["Customer"];
                        order.BuyerEmail = "";
                        order.TId = item["Order no."];
                        order.Account = account.AccountName;
                        order.GenerateOn = Convert.ToDateTime(item["Payment Complete"]);
                        order.Platform = PlatformEnum.Gmarket.ToString();
                        order.BuyerMemo = item["Memo to Seller"] + item["Options"];
                        order.AddressId = CreateAddress(item["Recipient"], item["Address"], "", "", item["Nation"], item["Nation"], item["Recipient Phone number"], item["Recipient mobile Phone number"], "", item["Postal code"], 0, NSession);
                        NSession.Save(order);
                        NSession.Flush();
                        CreateOrderPruduct(item["Item code"], item["Option Code"], Utilities.ToInt(item["Qty."]), item["Item"], item["Options"], 0, "", order.Id, order.OrderNo, NSession);
                        results.Add(GetResult(OrderExNo, "", "导入成功"));
                        listOrder.Add(OrderExNo, order.Id);
                        LoggerUtil.GetOrderRecord(order, "订单导入", "导入成功", NSession);
                    }
                    else
                    {
                        results.Add(GetResult(OrderExNo, "订单已存在", "导入失败"));
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    throw ex;
                }
            }
            return results;
        }
 public static Dictionary<string, string> GetDic(string fileName)
 {
     Dictionary<string, string> dic = new Dictionary<string, string>();
     CsvReader csv = new CsvReader(fileName);
     List<string[]> list = csv.ReadAllRow();
     foreach (var item in list)
     {
         if (item.Length == 2)
         {
             dic.Add(item[0].Trim(), item[1].Trim());
         }
     }
     return dic;
 }