//修改绑定手机号码 public UserLogin changeTelHandler(ChangeTel info) { if (!String.IsNullOrWhiteSpace(info.LoginID) && !String.IsNullOrWhiteSpace(info.UserID)) { UserLogin user = null; string subSMS = SMSUtil.ConnectSSL(info.appkey, info.phone, info.zone, info.code).Substring(10, 3); int SMS_RESULT = int.Parse(subSMS); bool SMS_VERIFY = false; switch (SMS_RESULT) { case Commons.SUCCESS: SMS_VERIFY = true; break; case Commons.REFUSE_TO_OPERATE: break; case Commons.APPKEY_NOT_EXIST: break; case Commons.INSUFFICIENT_PERMISSIONS: break; case Commons.INTERNAL_SERVER_ERROR: break; case Commons.MISSING_PARAMETER: break; case Commons.PHONENUMBER_INCORRECT_FORMAT: break; case Commons.SEND_NUMBER_EXCEEDS_LIMIT: break; case Commons.INVALID_VERIFYNO: break; case Commons.NO_SUFFICIENT_FUND: break; } if (db_manager.findUserId(info.UserID) != null && SMS_VERIFY) { user = new UserLogin() { LoginID = info.LoginID, UserId = info.UserID }; changeUserTel.Send(user); } return(user); } return(null); }
/// <summary> /// This method serializes the order object and send it to the queue for asynchronous processing /// </summary> /// <param name="order">All information about the order</param> public UserLogin UserRegHandler(UserReg logins) { //判断是否已经存在 if (logins != null) { //验证用户是否重复注册,只要有身份证或者登陆账号有任意一个存在,视为重复 bool o = db_manager.veriryUserExistOrNot(logins.CardId, logins.LoginID); //验证验证码是否发送且和用户输入验证码一致 string subSMS = SMSUtil.ConnectSSL(logins.appkey, logins.phone, logins.zone, logins.code).Substring(10, 3); int SMS_RESULT = int.Parse(subSMS); bool SMS_VERIFY = false; switch (SMS_RESULT) { case Commons.SUCCESS: SMS_VERIFY = true; break; case Commons.REFUSE_TO_OPERATE: break; case Commons.APPKEY_NOT_EXIST: break; case Commons.INSUFFICIENT_PERMISSIONS: break; case Commons.INTERNAL_SERVER_ERROR: break; case Commons.MISSING_PARAMETER: break; case Commons.PHONENUMBER_INCORRECT_FORMAT: break; case Commons.SEND_NUMBER_EXCEEDS_LIMIT: break; case Commons.INVALID_VERIFYNO: break; case Commons.NO_SUFFICIENT_FUND: break; } //没有注册 if (!o && SMS_VERIFY) //if (!o) { UserGroup userbase = new UserGroup(); User user = new User(); UserRegister userregister = new UserRegister(); UserLogin login = new UserLogin(); //UserGroup userbase.Name = "Normal"; //User user.UserGroupID = (int)Commons.UserGroupType.NORMAL_USER; user.UserId = Guid.NewGuid().ToString().Replace("-", ""); user.PhoneNumber = logins.LoginID; user.Password = login.LoginPwd; user.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); user.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); user.CardID = logins.CardId; user.UserDriverLicense = logins.UserDriveLicense; user.UserRegDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //测试阶段,审核默认已经通过 user.UserStatus = ((int)Commons.Authentication.APPLY).ToString(); //userregister userregister.Type = (int)Commons.UserType.app; userregister.UserId = user.UserId; userregister.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //login login.type = (int)Commons.UserType.app; login.UserId = user.UserId; login.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); login.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); login.LoginID = logins.LoginID; login.LoginPwd = logins.LoginPwd; //加入缓存 //cache_manager.Create(userbase, login, user, userregister); orderQueue.Send(userbase); orderQueue.Send(login); orderQueue.Send(user); orderQueue.Send(userregister); //加入消息 // asynchUser.Send(userbase, login, user, userregister); return(login); } /* * //如果身份证已存在,手机不存在 * //如果手机存在,身份证不存在 * //如果手机存在,身份证存在 * 注册失败! * */ //注册失败 // UserLogin log = null; // //T_UserLogin增加相同userId对应的app账号 //string id=db_manager.selectUserIdByCardId(logins.CardId); // if(id!=null){ // log = new UserLogin() { // UserId=id, // LoginID=logins.LoginID, // LoginPwd=logins.LoginPwd, // CreateTime=DateTime.Now.ToString(), // UpdateTime = DateTime.Now.ToString(), // type=(int)Commons.UserType.app // }; // //将userLogin放入消息 // exist.Send(log); // } } return(null); }
protected void btnSave_Click(object sender, EventArgs e) { strtels = ""; if (this.ddlRule.SelectedValue == "1")//指定会员 { strtels = this.txtMobiles.Text; } else if (this.ddlRule.SelectedValue == "2")//注册日期 { DataSet dsClub = ClubBll.GetList(0, "regDate>='" + Convert.ToDateTime(this.txtStartDate.Text) + "' and regDate<='" + Convert.ToDateTime(this.txtEndDate.Text) + "'", "regDate desc"); foreach (DataRow r in dsClub.Tables[0].Rows) { if (!string.IsNullOrEmpty(r["clubMobile"].ToString())) { strtels = strtels + r["clubMobile"] + ","; } } if (!string.IsNullOrEmpty(strtels)) { strtels = strtels.Substring(0, strtels.Length - 1); } } else if (this.ddlRule.SelectedValue == "3")//所有会员 { string strclass = ""; foreach (ListItem item in this.chkClubClass.Items) { if (item.Selected) { strclass = strclass + item.Value + ","; } } if (!string.IsNullOrEmpty(strclass)) { strclass = strclass.Substring(0, strclass.Length - 1); } DataSet dsclub = ClubBll.GetList(0, "classId in (" + strclass + ")", "regDate desc"); foreach (DataRow r in dsclub.Tables[0].Rows) { if (!string.IsNullOrEmpty(r["clubMobile"].ToString())) { strtels = strtels + r["clubMobile"] + ","; } } if (!string.IsNullOrEmpty(strtels)) { strtels = strtels.Substring(0, strtels.Length - 1); } } if (strtels.Equals("")) { TravelAgent.Tool.Javascript.JsAlert("经检测,没有合适的会员!"); } else { //int tellength = strtels.Split(',').Length; //int sendtextReuslt = CSMS.SendText(Convert.ToInt32(ViewState["pHandle"]), this.txtSMSContent.Value, "", tellength); bool r = SMSUtil.Send(strtels, this.txtSMSContent.Value); //write by jjh if (/*sendtextReuslt > 0*/ r) { //int result = CSMS.SendPhones(pHandle, sendtextReuslt, strNumTemp); //if (result == 0) //{ // Club.Common.Javascript.JsAlert("发送成功"); //} //else //{ // Club.Common.Javascript.JsAlert("发送号码错误:" + result.ToString()); //} //循环发送 //SendTelphone(strtels.Split(','), sendtextReuslt); //TravelAgent.Tool.Javascript.JsAlert("发送成功"); TravelAgent.Tool.Javascript.JsAlert("发送成功"); //modify by jjh } else { TravelAgent.Tool.Javascript.JsAlert("发送失败"); //modify by jjh } } }
public void TestS() { Console.WriteLine(SMSUtil.Send("18817676235", "hello,回复【TD】退订")); }