Ejemplo n.º 1
0
 void CopyDictionaryToModule(List <int> dictionaryIds, string modulePath)
 {
     using (var db = new DictServiceEntities())
     {
         foreach (var id in dictionaryIds)
         {
             var    dict    = db.Dictionaries.Single(x => x.Dictionary_id == id);
             string dstPath = Path.Combine(modulePath, "Apex.zip");
             if (!Directory.Exists(Path.GetDirectoryName(dstPath)))
             {
                 Directory.CreateDirectory(Path.GetDirectoryName(dstPath));
             }
             if (File.Exists(dstPath))
             {
                 //Игнорировать
             }
             var tmpFolder = FileHelper.GetTemporaryDirectory();
             ZipHelper.UnZip(dict.PathToDict, tmpFolder);
             var file = Directory.GetFiles(tmpFolder, "*.mdb").Single();
             ZipHelper.AddDictionaryToZip(dstPath, file);
         }
     }
 }