Beispiel #1
0
 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, "通知");
         }
     }
 }
Beispiel #2
0
 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, "发送");
         }
     }
 }