public HttpResponseBase PaperClassDelete() { string json = string.Empty; PaperClass pc = new PaperClass(); _paperClassMgr = new PaperClassMgr(mySqlConnectionString); try { if (!string.IsNullOrEmpty(Request.Params["id"])) { pc.id = int.Parse(Request.Params["id"]); } if (_paperClassMgr.Delete(pc) > 0) { json = "{success:true}"; } } catch (Exception ex) { json = "{success:false,msg:\"" + "異常" + "\"}"; 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); } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }