Exemple #1
0
        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;
                model.DealUserName    = hidDealUser.Value;
                List <ExceptionsAndDealInfoModel> list;
                if (base.VehicleViewMode)
                {
                    list = ReportBLL.GetDefaultExceptionsAndDealInfo(model, base.CurrentStrucID);
                }
                else
                {
                    list = ReportBLL.GetExceptionsAndDealInfo(model);
                }
                if (!base.CheckResult <ExceptionsAndDealInfoModel>(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);
            }
        }