public ActionResult Add() { Session[CacheKey.JOOSHOW_CUSADDRESS_CACHE] = null; string CusNum = WebUtil.GetQueryStringValue<string>("CusNum", string.Empty); if (CusNum.IsEmpty()) { ViewBag.Customer = new CustomerEntity(); ViewBag.DdlCusType = EnumHelper.GetOptions<ECusType>("","请选择客户类别"); return View(); } else { CustomerProvider provider = new CustomerProvider(); CustomerEntity entity = provider.GetSingleCustomer(CusNum); entity = entity == null ? new CustomerEntity() : entity; ViewBag.DdlCusType = EnumHelper.GetOptions<ECusType>(entity.CusType, "请选择客户类别"); ViewBag.Customer = entity; List<CusAddressEntity> listResult = provider.GetAddressList(entity.CusNum); if (!listResult.IsNullOrEmpty()) { Session[CacheKey.JOOSHOW_CUSADDRESS_CACHE] = listResult; } return View(); } }
public ActionResult GetSelectAddress() { string CusNum = WebUtil.GetFormValue<string>("CusNum", string.Empty); List<CusAddressEntity> list = null; if (!CusNum.IsEmpty()) { CustomerProvider provider = new CustomerProvider(); list = provider.GetAddressList(CusNum); } list = list == null ? new List<CusAddressEntity>() : list; string json = ConvertJson.ListToJson<CusAddressEntity>(list, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); return Content(this.ReturnJson.ToString()); }