예제 #1
0
    /// <summary>
    /// 选择模板
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddltemplate_SelectedIndexChanged(object sender, EventArgs e)
    {
        string templateid = ddltemplate.SelectedItem.Value.ToString();

        if (templateid != "-1")
        {
            Tb_Sms_Template mTemplate = baseDataManage.CallMethod("Tb_Sms_Template", "GetById", null, new object[] { templateid.ToString() }) as Tb_Sms_Template;
            this.txtContents.Value = mTemplate.SmsTpContent;
        }
        else
        {
            this.txtContents.Value = "";
        }
    }
예제 #2
0
 /// <summary>
 /// 根据订单号导入内容
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btdrcontents_Click(object sender, EventArgs e)
 {
     if (ddltemplate.SelectedValue != "-1")
     {
         if (txtorderno.Text == "")
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "key", "<script>alert('请填写订单号!')</script>", false);
             return;
         }
         IList <Tb_Ticket_Order> OrderList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { "OrderId='" + txtorderno.Text.Trim() + "'" }) as List <Tb_Ticket_Order>;
         if (OrderList != null && OrderList.Count > 0)
         {
             IList <Tb_Ticket_SkyWay> skyWayList = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { "OrderId='" + OrderList[0].OrderId + "'" }) as List <Tb_Ticket_SkyWay>;
             if (ddltemplate.SelectedValue != "-1")
             {
                 string ToDate    = "未知";
                 string CarryName = "";
                 if (skyWayList != null && skyWayList.Count > 0)
                 {
                     ToDate    = skyWayList[0].ToDate.ToString("MM月dd日HH:mm");
                     CarryName = skyWayList[0].CarryName;
                 }
                 Tb_Sms_Template mTemp = baseDataManage.CallMethod("Tb_Sms_Template", "GetById", null, new object[] { ddltemplate.SelectedValue.ToString() }) as Tb_Sms_Template;
                 this.txtContents.Value = mTemp.SmsTpContent.ToString().Replace("[订单号]", OrderList[0].OrderId).Replace("[乘机人]", OrderList[0].PassengerName).Replace("[订单编号]", OrderList[0].OrderId).Replace("[起抵城市]", OrderList[0].Travel).Replace("[起飞城市]", OrderList[0].Travel.Split('-')[0]).Replace("[到达城市]", OrderList[0].Travel.Split('-')[1]).Replace("[起飞时间]", OrderList[0].AirTime.ToString("MM月dd日HH:mm")).Replace("[起飞日期]", OrderList[0].AirTime.ToString("MM月dd日HH:mm")).Replace("[到达日期]", ToDate).Replace("[到达时间]", ToDate).Replace("[航班号]", CarryName + OrderList[0].FlightCode);
                 if (string.IsNullOrEmpty(Request["phone"]))
                 {
                     this.txtnum.Value = OrderList[0].LinkManPhone.ToString();
                 }
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "key", "<script>alert('模板出错!')</script>", false);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "key", "<script>alert('暂无此订单信息')</script>", false);
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "key", "<script>alert('请选择模板')</script>", false);
     }
 }
    /// <summary>
    /// 操作项 (改,删)
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void RepTempLate_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string tid = e.CommandArgument.ToString();

        if (e.CommandName == "edit")
        {
            this.HiddenField1.Value = tid.ToString();
            Mtemplate                     = baseDataManage.CallMethod("Tb_Sms_Template", "GetById", null, new object[] { tid }) as Tb_Sms_Template;
            txttemplatename.Text          = Mtemplate.SmsTpName.ToString();
            txttemplatecontent.Value      = Mtemplate.SmsTpContent.ToString();
            this.btaddtemplate.Text       = "确定修改";
            this.Panel2.Visible           = true;
            this.txttemplatename.ReadOnly = true;
        }
        else
        {
            msg = (bool)baseDataManage.CallMethod("Tb_Sms_Template", "DeleteById", null, new Object[] { tid }) == true ? "删除成功" : "删除失败";
            BindTemplateInfo();
            ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
        }
    }