예제 #1
0
    //处理统计事件
    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_ZCSPBU sp1 = new U_ZCSPBU();
        DataSet  ds  = sp1.GetZcSpStatic(dt1, dt2);

        sp1.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);
    }