Beispiel #1
0
    public static string GetSendContent(int intTemplateType, SmsTemplateParameter smsTemplateParameter, int intShopID)
    {
        Chain.BLL.SmsTemplate   bllTemplate   = new Chain.BLL.SmsTemplate();
        Chain.Model.SmsTemplate modelTemplate = new Chain.Model.SmsTemplate();
        modelTemplate = bllTemplate.GetModel(intTemplateType);
        StringBuilder strTemplateContent = new StringBuilder(modelTemplate.TemplateContent);

        strTemplateContent.Replace("{CardID}", smsTemplateParameter.strCardID);
        strTemplateContent.Replace("{LCardID}", smsTemplateParameter.strCardID.Substring(smsTemplateParameter.strCardID.Length - 3));
        strTemplateContent.Replace("{Name}", smsTemplateParameter.strName);
        strTemplateContent.Replace("{TempMoney}", smsTemplateParameter.dclTempMoney.ToString("0.00"));
        strTemplateContent.Replace("{Money}", smsTemplateParameter.dclMoney.ToString("0.00"));
        strTemplateContent.Replace("{Time}", DateTime.Now.ToString("yy年MM月dd日HH时mm分"));
        strTemplateContent.Replace("{TempPoint}", smsTemplateParameter.intTempPoint.ToString());
        strTemplateContent.Replace("{Point}", smsTemplateParameter.intPoint.ToString());
        Chain.BLL.MemLevel   bllMemLevel   = new Chain.BLL.MemLevel();
        Chain.Model.MemLevel modelMemLevel = new Chain.Model.MemLevel();
        modelMemLevel = bllMemLevel.GetModel(smsTemplateParameter.OldLevelID);
        strTemplateContent.Replace("{OldLevel}", modelMemLevel.LevelName);
        modelMemLevel = bllMemLevel.GetModel(smsTemplateParameter.NewLevelID);
        strTemplateContent.Replace("{NewLevel}", modelMemLevel.LevelName);
        strTemplateContent.Replace("{MemBirthday}", string.Format("{0}月{1}日", Convert.ToInt32(smsTemplateParameter.MemBirthday.ToString("MM")), Convert.ToInt32(smsTemplateParameter.MemBirthday.ToString("dd"))));
        strTemplateContent.Replace("{MemPastTime}", smsTemplateParameter.MemPastTime.ToString("yyyy-MM-dd"));
        strTemplateContent.Replace("{TempGoodsItem}", smsTemplateParameter.CountItemsString);
        if (modelTemplate.TemplateID < 13)
        {
            if (PubFunction.curParameter.bolIsSmsShopName)
            {
                if (PubFunction.curParameter.strSmsShopName != "")
                {
                    strTemplateContent.Append("【" + PubFunction.curParameter.strSmsShopName + "】");
                }
            }
            else
            {
                Chain.BLL.SysShop   bllShop   = new Chain.BLL.SysShop();
                Chain.Model.SysShop modelShop = new Chain.Model.SysShop();
                modelShop = bllShop.GetModel(intShopID);
                if (modelShop.ShopSmsName != "")
                {
                    strTemplateContent.Append("【" + modelShop.ShopSmsName + "】");
                }
            }
        }
        return(strTemplateContent.ToString());
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["PromotionsID"] != null)
         {
             int ProductID = int.Parse(base.Request.QueryString["PromotionsID"]);
             Chain.BLL.Promotions   bllPromotions   = new Chain.BLL.Promotions();
             Chain.Model.Promotions modelPromotions = bllPromotions.GetModel(ProductID);
             this.spPromotionsDesc.InnerHtml = modelPromotions.PromotionsDesc;
             string   shopnameLsit = modelPromotions.ShopList;
             string[] shopList     = shopnameLsit.Split(new char[]
             {
                 ','
             });
             string sql = " ShopType=3 ";
             if (shopList.Length > 0)
             {
                 string shopidList = "( ";
                 for (int i = 0; i < shopList.Length; i++)
                 {
                     shopidList = shopidList + shopList[i] + ",";
                 }
                 shopidList  = shopidList.Substring(0, shopidList.Length - 1);
                 shopidList += ")";
                 sql         = sql + " and ShopID in " + shopidList;
             }
             if (modelPromotions.PromotionsMemLevel == -1)
             {
                 this.spMemLevel.InnerHtml = "所有会员";
             }
             else
             {
                 Chain.BLL.MemLevel bllLevel = new Chain.BLL.MemLevel();
                 this.spMemLevel.InnerHtml = bllLevel.GetModel(modelPromotions.PromotionsMemLevel).LevelName;
             }
             this.rptShopBind(sql);
         }
     }
 }