protected void btnSubmit_Click(object sender, EventArgs e) { if (validate()) { var ids = new List <Guid>(); var transferIds = this.hfdTransferIds.Value.Split(','); foreach (var item in transferIds) { ids.Add(Guid.Parse(item)); } try { if (this.radioMessage.Checked) { QSService.MessageInformPurchaser(Guid.Parse(Request.QueryString["purchaserId"]), ids, this.txtMessage.InnerText.Trim(), CurrentUser.UserName, CurrentUser.Name); var contactPhone = new List <string>(); contactPhone.Add(Request.QueryString["contractPhone"]); SMSSendService.SendCustomMessage(new SMS.Service.Domain.Account(Guid.Empty, CurrentUser.UserName), contactPhone, this.txtMessage.InnerText.Trim(), true); } if (this.radioHandler.Checked) { QSService.InformPurchaser(Guid.Parse(Request.QueryString["purchaserId"]), ids, (InformType)int.Parse(this.ddlNoticeWay.SelectedValue), (InformResult)int.Parse(this.ddlNoticeResult.SelectedValue), this.txtNoticeRemark.Text.Trim(), CurrentUser.UserName, CurrentUser.Name); } Page.ClientScript.RegisterClientScriptBlock(GetType(), "success", "alert('通知成功');window.location.href='FlightChangeNotice.aspx'", true); } catch (Exception ex) { ShowExceptionMessage(ex, "通知"); } } }
/// <summary> /// 发送短信 /// </summary> public string SendSMS(string phone, string account) { try { if (!SendSMSTime()) { return("请120秒后再获取验证码"); } IPAddress ip = IPAddressLocator.GetRequestIP(HttpContext.Current.Request); if (!AccountCombineService.ValidateIP(ip.ToString())) { return("同一个IP一天只有100次获取验证码的机会"); } var verfiCode = new VerfiCode() { CellPhone = phone, Code = ChinaPay.Utility.VerifyCodeUtility.CreateVerifyCode(6, "1,2,3,4,5,6,7,8,9,0"), IP = ip.ToString(), Type = Common.Enums.VerfiCodeType.Register, AccountNo = account }; Session["phoneValidateCode"] = verfiCode.Code; Session["phoneTime"] = DateTime.Now; SMSSendService.SendB3bRegisterValidateCode(verfiCode.CellPhone, verfiCode.Code, 20, BasePage.CurrenContract.ServicePhone); AccountCombineService.SaveVerfiCode(verfiCode); return(string.Empty); } catch (Exception) { return("发送验证码异常"); } }
protected void btnReSend_Click(object sender, EventArgs e) { try { SMSSendService.ReSendMsg(Guid.Parse(hidSendId.Value)); hidSendId.Value = ""; } catch (Exception ex) { ShowExceptionMessage(ex, "重新发送"); } var pagination = new Pagination() { PageSize = 10, PageIndex = 1, GetRowCount = true }; send_pager.CurrentPageIndex = 1; InitSendData(pagination); }
protected void btnSave_Click(object sender, EventArgs e) { if (valiate()) { string strMsg = SMSSendService.CheckSensitiveWords(txtContext.Text); if (!string.IsNullOrEmpty(strMsg)) { ShowMessage("对不起,您所发送的短信中包含敏感词:\"" + strMsg + "\" 请修改后重试或联系平台!"); return; } try { var acc = from item in AccountService.Query(CurrentCompany.CompanyId) where item.Type == Common.Enums.AccountType.Payment select new { No = item.No }; SMSSendService.SendCustomMessage(new ChinaPay.SMS.Service.Domain.Account(CurrentCompany.CompanyId, acc.First().No), this.txtPhone.Text.Trim().Split(new char[] { ',', ',' }), this.txtContext.Text); RegisterScript("alert('提交成功');window.location.href='/SmsModule/SMSSendRecord.aspx';", true); } catch (Exception ex) { ShowExceptionMessage(ex, "发送"); } } }
public string GetDefaultTemlete(string paramerKey) { return(SMSSendService.GetDefaultTemlete(paramerKey).Replace("DomainName", BasePage.DomainName).Replace("ServicePhone", BasePage.CurrenContract.ServicePhone)); }