protected void btnSearch_Click(object sender, EventArgs e) { var startTime = DateTime.Parse(hidStartTime.Value); var endTime = DateTime.Parse(hidEndTime.Value); if (!base.CheckInput(startTime, endTime, ltCheckInfo)) { ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true); return; } int exceptionTypeID = -1; try { exceptionTypeID = (int)Enum.Parse(typeof(ExceptionTypeEnum), base.CurrentRptName); } catch { exceptionTypeID = -1; } // 车辆ID long vehiclesID = 0; if (!string.IsNullOrWhiteSpace(this.hidVehicleID.Value)) { vehiclesID = Convert.ToInt64(hidVehicleID.Value); } try { ExceptionSearchModel model = new ExceptionSearchModel(); model.UserID = base.CurrentUserID; model.SartTime = startTime; model.EndTime = endTime; model.VehiclesID = vehiclesID; model.ExceptionTypeID = exceptionTypeID; List <ExceptionModel> list; // 默认模式 if (base.VehicleViewMode) { list = ReportBLL.GetDefaultExceptions(model, base.CurrentStrucID); } // 自由模式 else { list = ReportBLL.GetExceptions(model); } if (!base.CheckResult <ExceptionModel>(list, ltCheckInfo)) { ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true); return; } this.ShowReport(list, exceptionTypeID); ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true); } catch (Exception ex) { ScriptManager.RegisterStartupScript(upRpt, this.Page.GetType(), "", "canClick()", true); base.DoReportLog(ex.Message, ltCheckInfo); } }