//通過訂單判斷在表中是否存在 public HttpResponseBase GetAseldOrdCount() { string json = string.Empty; Aseld ase = new Aseld(); int count = 0; try { _iasdMgr = new AseldMgr(mySqlConnectionString); if (!String.IsNullOrEmpty(Request.Params["number"]))//如果是新增 { ase.ord_id = Convert.ToInt32(Request.Params["number"]); } ase.change_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id; ase.change_dtim = DateTime.Now; count = _iasdMgr.SelectCount(ase); if (count > 0) { _iasdMgr.UpdateScnd(ase); } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,data:" + count + "}";//返回json數據 } 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; }