public HttpResponseBase InspectionReportList() { string json = string.Empty; try { InspectionReportQuery query = new InspectionReportQuery(); List<InspectionReportQuery> store = new List<InspectionReportQuery>(); query.Start = Convert.ToInt32(Request.Params["start"] ?? "0"); query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25"); int totalCount = 0; if (!string.IsNullOrEmpty(Request.Params["brand"])) { query.brand_id = Convert.ToUInt32(Request.Params["brand"]); } if (!string.IsNullOrEmpty(Request.Params["name_code"])) { query.name_code = Request.Params["name_code"].ToString().Trim(); } if (!string.IsNullOrEmpty(Request.Params["certificate_type1"])) { query.certificate_type1 = (Request.Params["certificate_type1"]); } if (!string.IsNullOrEmpty(Request.Params["certificate_type2"])) { query.certificate_type2 = (Request.Params["certificate_type2"]); } if (!string.IsNullOrEmpty(Request.Params["start_time"])) { query.start_time =Convert.ToDateTime(Convert.ToDateTime(Request.Params["start_time"]).ToString("yyyy-MM-dd HH:mm:ss")); } if (!string.IsNullOrEmpty(Request.Params["end_time"])) { query.end_time = Convert.ToDateTime(Convert.ToDateTime(Request.Params["end_time"]).ToString("yyyy-MM-dd HH:mm:ss")); } if (!string.IsNullOrEmpty(Request.Params["last_day"])) { query.last_day = Convert.ToInt32(Request.Params["last_day"]); } if (!string.IsNullOrEmpty(Request.Params["search_date"])) { query.search_date = Convert.ToInt32(Request.Params["search_date"]); } _inspectionReport = new InspectionReportMgr(mySqlConnectionString); store = _inspectionReport.InspectionReportList(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }