//处理统计事件 void SelectTime1_StaticEvent(object sender, EventArgs e) { DateTime dt1 = default(DateTime); DateTime dt2 = default(DateTime); if (this.SelectTime1.BeginTime != "") { dt1 = DateTime.Parse(this.SelectTime1.BeginTime); } if (this.SelectTime1.EndTime != "") { dt2 = DateTime.Parse(this.SelectTime1.EndTime); } U_ZCTCBU zctc1 = new U_ZCTCBU(); DataSet ds = zctc1.GetZcTJData(dt1, dt2); zctc1.Close(); string tableTitle = ""; switch (this.SelectTime1.StaticType) { case SearchStaticType.年统计: tableTitle = this.SelectTime1.StaticYear + "年度方案执行统计表"; break; case SearchStaticType.月统计: tableTitle = this.SelectTime1.StaticYear + "年" + this.SelectTime1.StaticMonth + "月方案执行统计表"; break; case SearchStaticType.季度统计: tableTitle = this.SelectTime1.StaticYear + "年" + this.SelectTime1.StaticJidu + "季度方案执行统计表"; break; default: string begtime = this.SelectTime1.BeginTime; if (begtime == "") { begtime = "过去"; } string endtime = this.SelectTime1.EndTime; if (endtime == "") { endtime = "现在"; } tableTitle = begtime + "~" + endtime + "方案执行统计表"; break; } this.SetTableData(tableTitle, ds); }