/// <summary> /// データインサート用SQL文を生成する /// </summary> /// <param name="designFileName"></param> /// <param name="layoutType"></param> private void DoInsertSqlScript(string dataSheetName, bool isTarget) { TestDataInitializer initializer = new TestDataInitializer(reportHandler); initializer.DoInitlize(dataSheetName, isTarget, ""); }
/// <summary> /// バッチ処理 /// </summary> /// <param name="args"></param> /// <returns></returns> private static bool RunBatch(string[] args) { try { Dictionary <string, string> argList = GetCommandArgs(args); if (argList.Count == 0) { return(false); } if (!argList.ContainsKey("mode")) { return(false); } if (argList.ContainsKey("help")) { return(false); } string mode = argList["mode"]; switch (mode) { case "0": if (argList.ContainsKey("path") && argList.ContainsKey("target")) { string path = argList["path"]; if (!System.IO.Directory.Exists(path)) { return(false); } bool isTarget = false; if (!bool.TryParse(argList["target"], out isTarget)) { return(false); } string pattern = "*.xlsm"; if (argList.ContainsKey("pattern")) { pattern = argList["pattern"]; } string batchFile = string.Empty; if (argList.ContainsKey("batch")) { batchFile = argList["batch"]; } string[] files = System.IO.Directory.GetFiles(path, pattern, System.IO.SearchOption.AllDirectories); foreach (string file in files) { //SQL作成 TestDataInitializer initializer = new TestDataInitializer(null); initializer.DoInitlize(file, isTarget, batchFile); } return(true); } break; case "1": if (argList.ContainsKey("exceptfile")) { string exceptfile = argList["exceptfile"]; if (!System.IO.File.Exists(exceptfile)) { return(false); } TestDataChecker checker = new TestDataChecker(null); string outputFolder = ""; if (argList.ContainsKey("output")) { outputFolder = argList["output"]; } checker.CheckDatas(exceptfile, outputFolder); return(true); } break; default: break; } return(false); } catch (Exception ex) { Logging.Exception("Batch", ex); return(false); } }