コード例 #1
0
        /// <summary>
        /// ボタン〔エクスポート〕押下処理
        /// </summary>
        private void ExportCommandExecute()
        {
            SqlBuilder.FileViewExportSearchConditions sc = new SqlBuilder.FileViewExportSearchConditions();
            sc.ExportStatusExceptFinished = this.ExportStatusExceptFinished.Value;
            sc.ExportDueDateFrom          = this.ExportDueDateFrom.Value;
            sc.ExportDueDateTo            = this.ExportDueDateTo.Value;

            SqlBuilder      sql   = new SqlBuilder(sc);
            List <TodoTask> tasks = _dbAccessor_.TodoTaskSelect(sql);

            string exportPathAndFileName = this.ExportPathAndFileName.Value;

            XlsxWriter.FileViewExport(exportPathAndFileName, tasks);

            this.MainWindow.ShowMessageAsync("データのエクスポート", Path.GetFileName(exportPathAndFileName) + " にデータを出力しました。");
            this.ExportPathAndFileName.Value = string.Empty;
        }