/// <summary> /// CSVデータ取得 /// </summary> /// <returns>取得処理成否</returns> /// <remarks> /// 作成者 : sesaki /// 作成日 : 2019/11/06 /// </remarks> public bool GetCsvData() { // 出力条件が正しければCSVデータ取得 if (Condition.ValidateOutput() == false) { return(false); } DataSet dtSet = null; DataBase dataBase = null; try { dataBase = new DataBase(); List <object> paraList = new List <object>(); string queryStr = QueryBuild.GetJushihanCsv(Condition, ref paraList); dataBase.ConnectDB(); dtSet = dataBase.GetDataSet(queryStr, paraList.ToArray()); // クエリ実行 DataTable table = dtSet.Tables[0]; CsvData = Utilities.DataTableToCsv(table); dataBase.DisconnectDB(); CsvName = Utilities.GetCsvFileName(Resources.TextResource.ProgressJushihan); return(true); } catch (Exception ex) { CsvErrorMessage = Resources.TextResource.ErrorOutputCsv; return(false); } finally { if (dataBase != null) { dataBase.DisconnectDB(); } if (dtSet != null) { dtSet.Dispose(); } } }