private void Get_ParameterList(string strWhere) { Chain.BLL.SmsTemplate bllSmsTemplate = new Chain.BLL.SmsTemplate(); int Counts = 1; strWhere += "and dbo.SmsTemplate.TemplateShopID=dbo.SysShop.ShopID "; DataTable db = bllSmsTemplate.GetListSP(10000, 1, out Counts, new string[] { strWhere }).Tables[0]; this.gvSmsTemplate.DataSource = db; this.gvSmsTemplate.DataBind(); PageBase.BindSerialRepeater(this.gvSmsTemplate, 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()); }