/// <summary> /// 注册会员 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override string btnAdd_Click() { string error = ""; if (BLL.Configuration.Model.DFHXFCount == 1) { //string code = BLL.SMS.GetSKeyBuyTel(Request.Form["txtTel"].Trim(), Model.SMSType.ZCYZ); //if ((string.IsNullOrEmpty(code) || code != Request.Form["txtTelCode"].Trim())) //{ // error += "手机验证码错误!"; // return error; //} } //List<Model.Member> list = BllModel.GetMemberEntityList("NumID='" + Request.Form["txtNumID"].Trim() + "'"); //if (list.Count >= BLL.Configuration.Model.MaxBuyGCount) //{ // error += "该手机号注册的账号已达上限"; // return error; //} //if (Request.Form["txtBankNumber"].Trim() != null) //{ // List<Model.Member> list1 = BllModel.GetMemberEntityList("BankNumber='" + Request.Form["txtBankNumber"].Trim() + "'"); // if (list1.Count >= BLL.Configuration.Model.MaxBuyGCount) // { // error += "该银行卡已绑定,请更换其它帐号"; // return error; // } //} //if (Request.Form["txtAliPay"].Trim() != null) //{ // List<Model.Member> list2 = BllModel.GetMemberEntityList("Alipay='" + Request.Form["txtAliPay"].Trim() + "'"); // if (list2.Count >= BLL.Configuration.Model.MaxBuyGCount) // { // error += "该支付宝已绑定,请更换其它帐号"; // return error; // } //} int addcount = Convert.ToInt32(BLL.CommonBase.GetSingle("SELECT count(*) FROM Member WHERE DATEDIFF(DAY,MCreateDate,GETDATE())=0 AND RoleCode NOT IN('Manage');")); if (BLL.Configuration.Model.DayRegeditNumber <= addcount) { error += "每天注册人数超出上限,请明天再来"; return(error); } if (!BLL.Member.getCardNameCount(MemberMode)) { error += "每天注册人数超出上限,请明天再来"; return(error); } //if (Request.Form["txtNumID"].Trim() != null) //{ // List<Model.Member> list1 = BllModel.GetMemberEntityList("NumID='" + Request.Form["txtNumID"].Trim() + "'"); // if (list1.Count >= BLL.Configuration.Model.MaxBuyGCount) // { // error += "该身份证号码已绑定,请更换其它号码"; // return error; // } //} //查看会员是否激活,没激活的不能推荐会员 if (TModel.RoleCode == "Notactive") { error += "您的账号还未激活,不能注册新的会员!"; } if (string.IsNullOrEmpty(error)) { Model.Member model = BllModel.InsertAndReturnEntity(MemberMode, false, ref error); if (model != null) { //Model.Sys_SQ_Answer objAnswer = new Model.Sys_SQ_Answer(); //objAnswer.MID = model.ID; //objAnswer.QId = long.Parse(Request.Form["ddlQuestion"]); //objAnswer.Answer = Request.Form["txtAnswer"]; //objAnswer.CreatedBy = model.MID; //if (new BLL.Sys_SQ_Answer().Insert(objAnswer)) { return("注册成功"); } } else { return(error); } } return(error); }