//按用户自定义时间统计 protected void butSt1_Click(object sender, EventArgs e) { this.dt1 = this.time1.Text; this.dt2 = this.time2.Text; this.statictype = SearchStaticType.用户自定义时间统计; this.onStaticEvent(); }
//按季统计 protected void butSt3_Click(object sender, EventArgs e) { int y1 = int.Parse(this.byear2.SelectedValue); this.byear = y1; int jd1 = int.Parse(this.jidu.SelectedValue); this.bjidu = jd1; int m1 = (jd1 - 1) * 3 + 1; this.dt1 = y1 + "-" + m1 + "-1"; int m2 = m1 + 2; if (m2 == 12) { y1++; } else { m2++; } this.dt2 = DateTime.Parse(y1 + "-" + m2 + "-1").AddDays(-1).ToString("yyyy-MM-dd"); this.statictype = SearchStaticType.季度统计; this.onStaticEvent(); }
//按年统计 protected void butSt4_Click(object sender, EventArgs e) { this.byear = int.Parse(this.byear3.SelectedValue); this.dt1 = this.byear + "-1-1"; this.dt2 = this.byear + "-12-31"; this.statictype = SearchStaticType.年统计; this.onStaticEvent(); }
//按月统计 protected void butSt2_Click(object sender, EventArgs e) { this.byear = int.Parse(this.byear1.SelectedValue); this.bmonth = int.Parse(this.bmonth1.SelectedValue); this.dt1 = this.byear + "-" + this.bmonth + "-1"; int y1 = this.byear; int m1 = this.bmonth; if (m1 == 12) { y1++; } else { m1++; } this.dt2 = DateTime.Parse(y1 + "-" + m1 + "-1").AddDays(-1).ToString("yyyy-MM-dd"); this.statictype = SearchStaticType.月统计; this.onStaticEvent(); }