コード例 #1
0
 public async Task <IActionResult> WechatChooseCustomer(ah.Models.ViewModel.WechatBindingModel model)
 {
     try
     {
         new ahWeb.Api.Customer(_db).WXBindingCustomer(model);
         return(await LoadMobileFrontPage(model.openid));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message);
         var finds = MainDbContext.vwCHIS_Code_Customer.AsNoTracking().Where(m => m.CustomerMobile == model.mobile);
         ViewBag.Customers = finds;
         return(View("WechatChooseCustomer", model));
     }
 }
コード例 #2
0
 public async Task <IActionResult> WechatRegister(ah.Models.ViewModel.WechatBindingModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //强制注册,并清空旧持有者的信息数据。
             new ahWeb.Api.Customer(_db).WXRegistCustomer(model);
             return(await LoadMobileFrontPage(model.openid));
         }
         else
         {
             return(View("WechatRegister", model));
         }
     }
     catch (Exception ex) { ModelState.AddModelError("", ex.Message); Global.WriteLog(ex); return(View("WechatRegister", model)); }
 }