/// <summary> /// 保存物流設定 /// </summary> /// <returns></returns> /*[HttpPost]*/ public HttpResponseBase SaveShippingCarrior(ShippingCarrior sc) { string json = string.Empty; try { _shippingCarriorMgr = new ShippingCarriorMgr(connectionString); int rowCount = 0; if (sc.Rid > 0)//修改 { rowCount = _shippingCarriorMgr.Update(sc); } else//新增 { rowCount = _shippingCarriorMgr.Save(sc); } if (rowCount > 0) json = "{success:true}"; } 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}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase DeleteShippingCarrior(string rids) { string json = string.Empty; try { _shippingCarriorMgr = new ShippingCarriorMgr(connectionString); _shippingCarriorMgr.Delete(rids); json = "{success:true}"; } 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}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public string QueryShippingCarriorAll() { string json = string.Empty; _shippingCarriorMgr = new ShippingCarriorMgr(connectionString); int totalCount = 0; List<ShippingCarriorCustom> shippingcariors = _shippingCarriorMgr.QueryAll(new ShippingCarriorCustom(), out totalCount); json = "{success:true,totalCount:" + totalCount + ",items:" + JsonConvert.SerializeObject(shippingcariors) + "}"; return json; }