public ImportReportDocumentTemplate(UDT.ReportTemplate template = null, string templateName = "")
        {
            InitializeComponent();

            Access = new AccessHelper();
            Query = new QueryHelper();
            this.Template = template;
            this.TemplateName = templateName;

            this.Load += new System.EventHandler(this.ImportReceiptDocumentTemplate_Load);
        }
        private bool WriteTemplate(string base64string, int SurveyID)
        {
            try
            {
                if (this.Template != null)
                {
                    if (!string.IsNullOrEmpty(base64string))
                    {
                        if (MessageBox.Show("樣版檔已存在,是否覆蓋?", "提示", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                            return false;
                    }
                }
                else
                {
                    this.Template = new UDT.ReportTemplate();
                }

                if (!string.IsNullOrEmpty(base64string))
                {
                    this.Template.Template = base64string;
                    this.Template.SurveyID = SurveyID;
                }

                this.Template.Save();
                return true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }