Esempio n. 1
0
        /// <summary>
        /// 验证电话是否注册
        /// </summary>
        void validatephone()
        {
            string valphone = string.Empty;

            if (Request["inputphone"] != null && Request["inputphone"] != "")
            {
                valphone = Common.Common.NoHtml(Request["inputphone"]);
            }
            if (valphone != null && valphone != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                if (action != null && action != "" && action == "wxphone")
                {
                    if (strOpenID != null && strOpenID != "")
                    {
                        if (customerDal.ExistCustomer(strOpenID, "", "", ""))
                        {
                            Response.Write("{\"error\":true,\"msg\":\"该微信已被注册\"}");
                        }
                        else
                        {
                            Response.Write("{\"success\":true}");
                        }
                    }
                    else
                    {
                        Response.Write("{\"success\":true}");
                    }
                }
                else
                {
                    if (customerDal.ExistCustomer("", valphone, "", ""))
                    {
                        Response.Write("{\"error\":true,\"msg\":\"该号码已被注册\"}");
                    }
                    else
                    {
                        Response.Write("{\"success\":true}");
                    }
                }
            }
            else
            {
                Response.Write("{\"success\":true}");
            }
            Response.End();
        }
Esempio n. 2
0
        /// <summary>
        /// 验证电话是否正确
        /// </summary>
        void validatephone()
        {
            string valphone = string.Empty;

            if (Request["phone"] != null && Request["phone"] != "")
            {
                valphone = Common.Common.NoHtml(Request["phone"]);
            }
            if (valphone != null && valphone != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                if (customerDal.ExistCustomer("", valphone, "", ""))
                {
                    if (strOpenID != null && strOpenID != "")
                    {
                        if (customerDal.ExistCustomer(strOpenID, "", "", ""))
                        {
                            if (customerDal.ExistCustomer(strOpenID, valphone, "", ""))
                            {
                                Response.Write("{\"success\":true}");
                            }
                            else
                            {
                                Response.Write("{\"error\":true,\"msg\":\"该微信号与注册电话不一致\"}");
                            }
                        }
                        else
                        {
                            Response.Write("{\"error\":true,\"msg\":\"该微信还未注册\"}");
                        }
                    }
                    else
                    {
                        Response.Write("{\"success\":true}");
                    }
                }
                else
                {
                    Response.Write("{\"error\":true,\"msg\":\"未找到该用户资料\"}");
                }
            }
            else
            {
                Response.Write("{\"success\":true}");
            }
            Response.End();
        }
Esempio n. 3
0
        /// <summary>
        /// 用户注册
        /// </summary>
        void ToSaveUserInfo()
        {
            string inputphone = string.Empty; string logpwd = string.Empty;

            if (Request["inputphone"] != null && Request["inputphone"] != "")
            {
                inputphone = Common.Common.NoHtml(Request["inputphone"]);
            }
            if (Request["logpwd"] != null && Request["logpwd"] != "")
            {
                logpwd = Common.Common.NoHtml(Request["logpwd"]);
            }
            if (inputphone.Trim() != null && inputphone.Trim() != "" && logpwd.Trim() != null && logpwd.Trim() != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                if (customerDal.ExistCustomer(strOpenID, inputphone, "", ""))
                {
                    Response.Write("{\"error\":true,\"msg\":\"该用户已经存在\"}");
                }
                else
                {
                    MSCustomers customerModel = new MSCustomers();
                    string      strID         = string.Empty;
                    strID                  = Guid.NewGuid().ToString("N").ToUpper();
                    customerModel.ID       = strID;
                    customerModel.Phone    = inputphone;
                    customerModel.OpenID   = strOpenID;
                    customerModel.NickName = regNickName;
                    customerModel.Sex      = regSex;
                    customerModel.HeadImg  = regHeadImg;
                    customerModel.UserPwd  = Common.Common.MD5(logpwd);
                    customerModel.IsDel    = 0;

                    MSVAcctDetailDAL vacctdetailDal = new MSVAcctDetailDAL();
                    MSVAcctDAL       vacctDal       = new MSVAcctDAL();

                    if (customerDal.AddCustomers(customerModel))
                    {
                        int vcount = 2;
                        if (!vacctDal.ExistMSVAcct(strID, ""))
                        {
                            MSVAcct vaccModel = new MSVAcct();
                            vaccModel.CustID   = strID;
                            vaccModel.SiteCode = "VYIGO";
                            vaccModel.V_Amont  = vcount;
                            MSVAcctDetail vaccDetailModel = new MSVAcctDetail();
                            vaccDetailModel.Amount     = vcount;
                            vaccDetailModel.ChargeType = "注册";
                            vaccDetailModel.CustID     = strID;
                            vaccDetailModel.Ext_Fld1   = "";
                            vaccDetailModel.IsReceive  = 1;
                            vaccDetailModel.SiteCode   = "VYIGO";
                            //vacctDal.AddMSVAcct(vaccModel);
                            //vacctdetailDal.AddMSVAcctDetail(vaccDetailModel);
                        }
                        Response.Write("{\"success\":true,\"msg\":\"操作成功\"}");
                    }
                    else
                    {
                        Response.Write("{\"error\":true,\"msg\":\"操作失败,请核对后再操作\"}");
                    }
                }
            }
            Response.End();
        }