Exemple #1
0
        public void Export_Click(object obj)
        {
            var pack = CardQueryModel.Pack;

            if (pack.Equals(StringConst.NotApplicable) || pack.Contains(StringConst.Series))
            {
                BaseDialogUtils.ShowDialogOk(StringConst.PackChoiceNone);
                return;
            }
            var exportPath = DialogUtils.ShowExport(pack);

            if (exportPath.Equals(string.Empty))
            {
                return;
            }

            var sql     = SqlUtils.GetExportSql(pack);
            var dataSet = new DataSet();

            if (!DataManager.FillDataToDataSet(dataSet, sql))
            {
                return;
            }

            var isExport = ExcelHelper.ExportPackToExcel(exportPath, dataSet);

            BaseDialogUtils.ShowDialogAuto(isExport ? StringConst.ExportSucceed : StringConst.ExportFailed);
        }