Ejemplo n.º 1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            var startTime = DateTime.Parse(hidStartTime.Value);
            var endTime   = DateTime.Parse(hidEndTime.Value);

            if (!base.CheckDateInput(startTime, endTime, ltCheckInfo))
            {
                ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true);
                return;
            }
            // 车架号VIN
            string vin = string.Empty;

            if (!string.IsNullOrEmpty(this.hidVIN.Value))
            {
                vin = hidVIN.Value;
            }
            var rptName = base.CurrentRptName;

            try
            {
                ACCONStatisticSearchModel model = new ACCONStatisticSearchModel();
                model.SartTime = startTime;
                model.EndTime  = endTime;
                model.VIN      = vin;
                model.PlateNum = this.hidPlateNum.Value;
                List <ACCONStatisticDataModel> list;

                // 默认模式
                if (base.VehicleViewMode)
                {
                    list = ReportBLL.GetDefaultACCONStatisticData(model, base.CurrentStrucID);
                }
                // 自由模式
                else
                {
                    list = ReportBLL.GetACCONStatisticData(model, base.CurrentUserID);
                }

                if (!base.CheckResult <ACCONStatisticDataModel>(list, ltCheckInfo))
                {
                    ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true);
                    return;
                }
                this.ShowReport(list);
                ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true);
                base.DoReportLog(ex.Message, ltCheckInfo);
            }
        }