public JsonResult OrderPeopleInfo_AddEdits(string str) { BLL.SubscriberBLL _SubscriberBLL = new SubscriberBLL(); JObject o = null; string content = string.Empty; retValue ret = new retValue(); PMS.Models.UserModel userModel = Session["UserModel"] as PMS.Models.UserModel; int userid = userModel._ID; if (!string.IsNullOrEmpty(str)) { o = JObject.Parse(str); string ID = o["ID"]._ToStrTrim(); string MGUID = o["MGUID"]._ToStrTrim(); string OrderNo = o["OrderNo"]._ToStrTrim(); string UnitName = o["UnitName"]._ToStrTrim(); string Address = o["Address"]._ToStrTrim(); string Name = o["Name"]._ToStrTrim(); string Phone = o["Phone"]._ToStrTrim(); string Roads = o["Roads"]._ToStrTrim(); string State = o["State"]._ToStrTrim(); //新增 if (string.IsNullOrEmpty(ID)) { ret = _SubscriberBLL.Insert(OrderNo, UnitName, Name, Phone, Address, Roads, userid); } //更新 else { ret = _SubscriberBLL.UpdateByPK(ID._ToInt32(), OrderNo, UnitName, Name, Phone, Address, "", MGUID); } } content = ret.toJson(); var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }