Beispiel #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sources"></param>
    /// <returns></returns>
    IList IImportData.AnalyzeFile(Dictionary <int, string> sources)
    {
        List <dynamic> result        = new List <dynamic>();
        DateTime       now           = DateTime.Now;
        string         importBatchNo = $"MART{now.ToString("yyyyMMddhhmmss")}";

        foreach (int line in sources.Keys)
        {
            if (LibData.ByteSubString(sources[line], 9, 3) == "I0O")
            {
                result.Add(new ReceiptInfoBillMarketSPIModel()
                    {
                        Id = line, Source = sources[line], ImportBatchNo = importBatchNo
                    });
            }
            else
            {
                result.Add(new ReceiptInfoBillMarketModel()
                    {
                        Id = line, Source = sources[line], ImportBatchNo = importBatchNo
                    });
            }
        }
        return(result);
    }