public JsonResult Create(OrderAddressType obj) { try { NSession.SaveOrUpdate(obj); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }
/// <summary> /// 创建订单发货地址 /// </summary> /// <param name="addressee"></param> /// <param name="street"></param> /// <param name="city"></param> /// <param name="province"></param> /// <param name="country"></param> /// <param name="countryCode"></param> /// <param name="tel"></param> /// <param name="phone"></param> /// <param name="email"></param> /// <param name="postcode"></param> /// <param name="buyerID"></param> /// <returns></returns> public static int CreateAddress(string addressee, string street, string city, string province, string country, string countryCode, string tel, string phone, string email, string postcode, int buyerID, ISession NSession) { try { OrderAddressType address = new OrderAddressType(); address.Street = street; address.Tel = tel; address.City = city; address.Province = province; address.PostCode = postcode; address.Email = email; address.Country = country; address.CountryCode = countryCode; address.Phone = phone; address.Addressee = addressee; address.BId = buyerID; NSession.Save(address); NSession.Flush(); return address.Id; } catch (Exception) { throw; } }