Пример #1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, TelphoneCertificationEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        public ActionResult Audit(string queryJson)
        {
            var queryParam = queryJson.ToJObject();
            TelphoneCertificationEntity entity = new TelphoneCertificationEntity();
            TelphoneCertificationBLL    telphonecertificationbll = new TelphoneCertificationBLL();

            entity.mobileNumber    = queryParam["mobileNumber"].ToString();
            entity.custName        = queryParam["custName"].ToString();
            entity.custCertCode    = queryParam["custCertCode"].ToString();
            entity.custCertAddress = queryParam["custCertAddress"].ToString();
            entity.photo_z         = queryParam["photo_z"].ToString();
            entity.photo_b         = queryParam["photo_b"].ToString();
            entity.photo_s         = queryParam["photo_s"].ToString();
            entity.loadMark        = 0;
            entity.createTime      = DateTime.Now;
            //插入实名认证表
            telphonecertificationbll.SaveForm("", entity);
            //通知指定的微信客服
            #region 获取access_token
            string     apiurl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx24e47efa56c2e554&secret=1f8de99c6304d13e5a65efa418638ee4";
            WebRequest req    = WebRequest.Create(@apiurl);
            req.Method = "POST";
            WebResponse  response = req.GetResponse();
            Stream       stream   = response.GetResponseStream();
            Encoding     encode   = Encoding.UTF8;
            StreamReader reader   = new StreamReader(stream, encode);
            string       detail   = reader.ReadToEnd();
            var          jd       = JsonConvert.DeserializeObject <WXApi>(detail);
            string       token    = (String)jd.access_token;
            #endregion

            //string url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + token;

            //string touser = ConfigurationManager.AppSettings["touser"];
            //string message = "{\"touser\":\"" + touser + "\"," +
            //    "\"msgtype\":\"text\"," +
            //    "\"text\": " +
            //    "{\"content\":\"有客户提交了实名认证资料" +
            //    "\n手机号:" + entity.mobileNumber +
            //    "\n客户名称:" + entity.custName +
            //    "\n身份证:" + entity.custCertCode +
            //    "\n地址:" + entity.custCertAddress +
            //    " \"} }";
            //string str = GetResponseData(message, @url);
            return(Content("true"));
        }
Пример #3
0
        public ActionResult Audit(TelphoneCertificationEntity entity)
        {
            entity.createId   = CurrentWxUser.OpenId;
            entity.createName = CurrentWxUser.NickName;
            //插入实名认证表
            string responseText = telphonecertificationbll.SaveForm("", entity);

            if (responseText.IndexOf("OK") >= 0)
            {
                //微信提醒
                WechatHelper.SendWX(entity.mobileNumber, entity.custName, entity.custCertCode, entity.custCertAddress);
                //订单提醒
                WechatHelper.SendToTemplate(entity.createId);
            }

            return(Content(responseText));
        }
 public ActionResult SaveForm(string keyValue, TelphoneCertificationEntity entity)
 {
     telphonecertificationbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }