Example #1
0
    public string BindTelSaveInfo(string pis_yzm, string pis_tel, string pis_name, string pis_code)
    {
        string pos_json = "";
        string ls_yzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
        if (pis_tel != "" && pis_name != "" && pis_code != "" && pis_yzm == ls_yzm)
        {
            try
            {
                TPortalClass.JpVerifyCode JpVerifyCode = new TPortalClass.JpVerifyCode();
                DataTable dt = JpVerifyCode.GetCodesByTel(pis_tel);
                if (dt.Rows.Count > 0)
                {
                    if (pis_code == dt.Rows[0]["hy_code"].ToString())
                    {
                        TPortalClass.JpUserVip JpUserVip = new TPortalClass.JpUserVip();

                        JpUserVip.UpdateTel(pis_tel, pis_name);
                        //绑定成功
                        pos_json = "{\"code\":\"0\"}";
                    }
                    else
                    {
                        //验证码错误
                        pos_json = "{\"code\":\"1\"}";
                    }
                }
            }
            catch
            {
                //系统错误
                pos_json = "{\"code\":\"2\"}";
            }
            finally
            {
            }
        }
        else
        {
            //非法调用
            pos_json = "{\"code\":\"3\"}";
        }
        return pos_json;
    }
Example #2
0
 public string SignUpValidate(string pis_yzm, string pis_tel, string pis_name, string pis_activityid, string pis_code)
 {
     string pos_json = "";
     string ls_yzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
     if (pis_tel != "" && pis_name != "" && pis_activityid != "" && pis_code != "" && pis_yzm == ls_yzm)
     {
         try
         {
             TPortalClass.JpVerifyCode JpVerifyCode = new TPortalClass.JpVerifyCode();
             DataTable dt = JpVerifyCode.GetCodesByTel(pis_tel);
             if (dt.Rows.Count > 0)
             {
                 if (pis_code == dt.Rows[0]["hy_code"].ToString())
                 {
                     JpActivityusers JpActivityusers = new JpActivityusers();
                     DataTable dt_user = JpActivityusers.GetDocbyhyidAndactivityid(Convert.ToInt32(pis_activityid), pis_tel);
                     if (dt_user.Rows.Count > 0)
                     {
                         //该用户已注册
                         pos_json = "{\"code\":\"2\"}";
                     }
                     else
                     {
                         JpActivityusers.hy_addtime = System.DateTime.Now.ToString();
                         JpActivityusers.hy_id = Convert.ToInt32(pis_activityid);
                         JpActivityusers.hy_name = pis_name;
                         JpActivityusers.hy_tel = pis_tel;
                         JpActivityusers.InsertSignUp();
                         //报名成功
                         pos_json = "{\"code\":\"0\"}";
                     }
                 }
                 else
                 {
                     //验证码错误
                     pos_json = "{\"code\":\"1\"}";
                 }
             }
         }
         catch
         {
             //系统错误
             pos_json = "{\"code\":\"3\"}";
         }
         finally
         {
         }
     }
     else
     {
         //非法调用
         pos_json = "{\"code\":\"4\"}";
     }
     return pos_json;
 }
Example #3
0
 public string RegistValidate(string pis_yzm, string pis_tel, string pis_code)
 {
     string pos_json = "";
     string ls_yzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
     if (pis_tel != "" && pis_code != "" && pis_yzm == ls_yzm)
     {
         try
         {
             TPortalClass.JpVerifyCode JpVerifyCode = new TPortalClass.JpVerifyCode();
             DataTable dt = JpVerifyCode.GetCodesByTel(pis_tel);
             if (dt.Rows.Count > 0)
             {
                 if (pis_code == dt.Rows[0]["hy_code"].ToString())
                 {
                     JpUserVip JpUserVip = new JpUserVip();
                     DataTable dt_user = JpUserVip.GetDocbyhyid(pis_tel);
                     if (dt_user.Rows.Count > 0)
                     {
                         //该用户已注册
                         pos_json = "{\"code\":\"1\"}";
                     }
                     else
                     {
                         //未注册验证码验证成功
                         pos_json = "{\"code\":\"0\"}";
                     }
                 }
                 else
                 {
                     //验证码错误
                     pos_json = "{\"code\":\"2\"}";
                 }
             }
         }
         catch
         {
             //系统错误
             pos_json = "{\"code\":\"3\"}";
         }
         finally
         {
         }
     }
     else
     {
         //非法调用
         pos_json = "{\"code\":\"4\"}";
     }
     return pos_json;
 }
Example #4
0
 public string GetVerifycodeByTel(string pis_yzm, string pis_tel)
 {
     string verifycode_josn = "";
     string ls_code = "";
     string ls_yzm = ConfigurationManager.AppSettings["Yanzm"].ToString();
     if (pis_tel != "" && pis_yzm == ls_yzm)
     {
         try
         {
             ls_code = ProduceVerifyCode();
             TPortalClass.JpVerifyCode JpVerifyCode = new TPortalClass.JpVerifyCode();
             JpVerifyCode.hy_tel = pis_tel;
             JpVerifyCode.hy_code = ls_code;
             JpVerifyCode.hy_addtime = System.DateTime.Now;
             JpVerifyCode.Insert();
             string message = "" + ls_code + "。请勿向他人泄露您的验证码。";
             string[] telphonenumber = new string[] { "" + pis_tel + "" };
             SendSms(message, telphonenumber);
             //表示发送成功
             verifycode_josn = "{\"code\":\"0\"}";
             TPortalClass.JpCommon JpCommon = new JpCommon();
             JpCommon.WriteLog(pis_tel, "生成手机验证码", "验证码发送给手机" + pis_tel + "", pis_tel, pis_tel);
         }
         catch (Exception ex)
         {
             throw ex;
             //系统错误
             // verifycode_josn = "{\"code\":\"1\"}";
         }
         finally
         {
         }
     }
     else
     {
         //非法调用
         verifycode_josn = "{\"code\":\"2\"}";
     }
     return verifycode_josn;
 }