Exemple #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            //1.得到统计指标
            //2.得到统计根据
            //3.得到统计表
            //4.得到过滤条件
            string sql;

            switch (this.lib_Name.Text)
            {
            case "专利趋势分析":
                //
                sql = QSSTSQLHelper.GetStatSQL(zid.ToString(), cklist_zhibiao, cmbYear, dataGridView4, cmbStartYear, cmbEndYear);
                dt  = DBA.MySqlDbAccess.GetDataTable(CommandType.Text, sql);
                dt  = DataTableHelper.ReadDateTable(dt);
                this.showdata.DataSource = dt;
                showdata.Columns[showdata.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                showLine(dt);
                break;

            case "技术生命周期分析":
                sql = ST_QS_02.GetStatSQL(zid.ToString(), stconfg, cklist_zhibiao, cmbYear);
                dt  = DBA.MySqlDbAccess.GetDataTable(CommandType.Text, sql);
                dt  = DataTableHelper.ReadDateTable(dt);
                this.showdata.DataSource = dt;
                showdata.Columns[showdata.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                showLine1(dt);
                break;

            case "发明人增速趋势分析":
                //
                sql = ST_QS_03.GetStatSQL(zid.ToString(), stconfg, cklist_zhibiao, cmbYear);
                dt  = DBA.MySqlDbAccess.GetDataTable(CommandType.Text, sql);
                dt  = DataTableHelper.ReadDateTable(dt);
                showLine(dt);
                dt = DataTableHelper.AddZengSu(dt, 1);
                this.showdata.DataSource = dt;
                showdata.Columns[showdata.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                break;

            case "专利类型分布趋势分析":
                //
                sql = ST_QS_04.GetStatSQL(zid.ToString(), stconfg, cklist_zhibiao, cmbYear);
                dt  = DBA.MySqlDbAccess.GetDataTable(CommandType.Text, sql);
                dt  = DataTableHelper.ExchangeRowColumn(dt, new List <string>()
                {
                    "发明专利", "外观专利", "使用新型"
                });
                dt = DataTableHelper.ReadDateTable(dt);
                showLine(dt);
                dt = DataTableHelper.AddZengSu(dt, new List <int>()
                {
                    1, 2, 3
                });
                this.showdata.DataSource = dt;
                showdata.Columns[showdata.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                break;
            }
        }