Пример #1
0
 public ActionResult Address()
 {
     string SnNum = WebUtil.GetQueryStringValue<string>("SnNum", string.Empty);
     if (SnNum.IsEmpty())
     {
         ViewBag.CusAddress = new CusAddressEntity();
         return View();
     }
     else
     {
         List<CusAddressEntity> list = Session[CacheKey.JOOSHOW_CUSADDRESS_CACHE] as List<CusAddressEntity>;
         if (!list.IsNullOrEmpty())
         {
             CusAddressEntity entity = list.FirstOrDefault(a => a.SnNum == SnNum);
             entity = entity.IsNull() ? new CusAddressEntity() : entity;
             ViewBag.CusAddress = entity;
         }
         else
         {
             CustomerProvider provider = new CustomerProvider();
             CusAddressEntity entity = provider.GetSingleAddress(SnNum);
             entity = entity == null ? new CusAddressEntity() : entity;
             ViewBag.CusAddress = entity;
         }
         return View();
     }
 }
Пример #2
0
 public ActionResult GetContact()
 {
     string snNum = WebUtil.GetFormValue<string>("SnNum",string.Empty);
     CustomerProvider provider = new CustomerProvider();
     CusAddressEntity  entity= new CusAddressEntity();
     entity = provider.GetSingleAddress(snNum);
     if (entity.IsNotNull())
     {
         StringBuilder sb = new StringBuilder();
         List<CusAddressEntity> listResult = new List<CusAddressEntity>();
         listResult.Add(entity);
         string json = ConvertJson.ListToJson(listResult, "List");
         this.ReturnJson.AddProperty("Data", new JsonObject(json));
     }
     return Content(this.ReturnJson.ToString());
 }