public IndStepResult(IndicatorUpdateResult r, IWizardStep p) : base() { result = r; prev = p; showFinish = result.WasSuccess; InitializeComponent(); }
public void CreateUpdateZip(IndicatorUpdateResult indicatorUpdateResult, string filename) { // create directory string path = Path.GetDirectoryName(filename); string tmpDir = path + @"\tmpUpdateZip"; Directory.CreateDirectory(tmpDir); // sql file var sb = new StringBuilder(); foreach (var s in indicatorUpdateResult.SqlStatements) { sb.AppendLine(s); } File.WriteAllText(tmpDir + @"\sql.txt", sb.ToString()); // move original file to zip System.IO.File.Copy(indicatorUpdateResult.OriginalFile, tmpDir + @"\source.xlsx", true); // create translation update file CreateTranslationsFile(indicatorUpdateResult.IndicatorTranslations, tmpDir + @"\translations.xlsx"); // zip FastZip fastZip = new FastZip(); fastZip.CreateZip(filename, tmpDir, true, null); // delete old directory System.IO.Directory.Delete(tmpDir, true); }