Exemple #1
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            string text = Sys_Para.GetBillPath();

            if (text.Length == 0)
            {
                text = System.IO.Directory.GetCurrentDirectory() + "\\BillReportFile\\";
            }
            System.DateTime now = System.DateTime.Now;
            int             num = this.SaveToFile(text + now.ToString("yyyy-MM-dd HH-mm-ss"), this.m_pParaClass.Txttitle);

            if (num == -1)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_saveErr1, new string[0]));
                return;
            }
            if (num == -2)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                return;
            }
            string str = text + now.ToString("yyyy-MM-dd HH-mm-ss") + "\\" + this.m_pParaClass.Txttitle.Replace("'", "''");

            if (ReportInfo.InsertBillReport(this.m_pParaClass.Txttitle, this.m_pParaClass.Txtwriter, now, str + ".html") == 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                return;
            }
            this.m_isRPTSaved = true;
            EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
        }