示例#1
0
        /// <summary>
        /// create report file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonReportFile_Click(object sender, EventArgs e)
        {
            int  parseValue = 0;
            bool rstReport;

            if (!int.TryParse(textBoxNumsRowCreate.Text, out parseValue))
            {
                MessageBox.Show("Invalid text input");
                return;
            }
            if (parseValue <= 0)
            {
                MessageBox.Show("Invalid text input");
                return;
            }

            Battery.gNumsRow = parseValue;
            if (File.Exists(textBoxGenReportFile.Text))
            {
                MessageBox.Show("File exsited!", "Warning!");
            }
            else
            {
                rstReport = Battery.CreateReportFile(textBoxGenReportFile.Text);
                //rstReport = Battery.CreateChartForFile(textBoxGenReportFile.Text);
                if (rstReport)
                {
                    MessageBox.Show("Reported file success");
                }
                else
                {
                    MessageBox.Show("Reported file fail");
                }
            }
        }