示例#1
0
        public static void ProcessFile()
        {
            try
            {
                IFileParser fileParser           = new DefaultFileParser();
                string      destinationTableName = "MultiNationalEntityList";

                string sourceFileFullName          = GetFileFullName();
                IEnumerable <DataTable> dataTables = fileParser.GetFileData(sourceFileFullName);
                foreach (DataTable tbl in dataTables)
                {
                    if (tbl == null)
                    {
                        message = "Error: File does not Exists";
                        break;
                    }
                    fileParser.WriteChunkData(tbl, destinationTableName, Map());
                }
                if (message == string.Empty)
                {
                    message = "File uploaded Successfully";
                }
            }
            catch (Exception x)
            {
                message = "Error Msg : " + x.Message;
            }
        }
示例#2
0
        public static void ProcessFile()
        {
            try
            {
                IFileParser fileParser           = new DefaultFileParser();
                string      destinationTableName = "MultiNationalEntityListTemp";

                string sourceFileFullName          = GetFileFullName();
                IEnumerable <DataTable> dataTables = fileParser.GetFileData(sourceFileFullName);
                List <DataTable>        tables     = new List <DataTable>();
                //int count = 0;
                foreach (DataTable tbl in dataTables)
                {
                    /*tbl.TableName = tbl.TableName + count;
                     * tables.Add(tbl);*/
                    fileParser.WriteChunkData(tbl, destinationTableName, Map());
                    //count++;
                }

                /* foreach (var table in tables)
                 * {
                 *   fileParser.WriteChunkData(table, destinationTableName, Map());
                 * }*/

                EventLogging.LogInformation("Files uploaded Successfully");
            }
            catch (Exception x)
            {
                EventLogging.LogError("Error Msg : " + x.Message + "\n" +
                                      "Source : " + x.Source + "\n" +
                                      "Event : CreateEmptyDataTable");
            }
        }