Example #1
0
        private void UpdateAdFile(String path)
        {
            try
            {
                FTPConnectionManager connectionManager = CeateConnectionManager(PathConst.ADFILEZIP, PathConst.ADFILEZIP);
            }
            catch { }
            finally
            {
                List <String>        list       = TextToModelHelper.ToModel(PathConst.TXTFILEPATH + "/" + path);//change path
                IEnumerable <AdFile> adFileList = TextToModelHelper.ModelAdFile(list);

                foreach (var adFile in adFileList)
                {
                    uow.AdFileRepository.InsertOrUpdate(adFile);
                }

                //Parallel.ForEach(adFileList, adFile =>
                //{
                //    uow.AdFileRepository.InsertOrUpdate(adFile);
                //});

                uow.SaveChanges();
            }
        }
Example #2
0
        public Boolean ManualUpdateAdFile()
        {
            List <String>        list       = TextToModelHelper.ToModel(PathConst.TXTFILEPATH + "/" + PathConst.ADFILE);//change path
            IEnumerable <AdFile> adFileList = TextToModelHelper.ModelAdFile(list);

            foreach (var adFile in adFileList)
            {
                uow.AdFileRepository.InsertOrUpdate(adFile);
            }

            return(uow.SaveChanges() >= 0);
        }