public void BindPreferentialObject() { DataTable dt = new Chain.BLL.MemLevel().GetList("").Tables[0]; this.sltPromotionsLevel.Items.Add(new ListItem("=== 所有会员 ===", "-1")); for (int i = 0; i < dt.Rows.Count; i++) { this.sltPromotionsLevel.Items.Add(new ListItem(dt.Rows[i]["LevelName"].ToString(), dt.Rows[i]["LevelID"].ToString())); } }
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()); }
private void BindMemInfo(int MemID) { Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID); this.spMemCard.InnerHtml = modelMem.MemCard; this.spMemName.InnerHtml = modelMem.MemName.ToString(); List <Chain.Model.SysShopMemLevel> list = new Chain.BLL.SysShopMemLevel().GetModelList(string.Format(" ShopID=1 and MemLeveLID={0} ", modelMem.MemLevelID)); if (list.Count > 0) { Chain.Model.MemLevel mdlMemLevel = new Chain.BLL.MemLevel().GetModel(modelMem.MemLevelID); if (list[0].ClassRechargePointRate > 0m) { this.txtPointRate.Value = list[0].ClassRechargePointRate.ToString(); } else { this.txtPointRate.Value = "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); } } }
public void GetLevel() { try { HttpContext.Current.Response.ContentType = "application/json;charset=utf-8"; string jsonCallBackFunName = string.Empty; jsonCallBackFunName = HttpContext.Current.Request.Params["callback"].ToString(); Chain.BLL.MemLevel bll = new Chain.BLL.MemLevel(); List <Chain.Model.MemLevel> listLevel = bll.GetLevelList(""); StringBuilder sb = new StringBuilder(); string[] strList = new string[listLevel.Count]; for (int i = 0; i < listLevel.Count; i++) { strList[i] = JsonPlus.ToJson(listLevel[i]); if (0 == i) { sb.AppendFormat("{0}\":{1}", "{\"" + i, strList[i] + "}"); } else { sb.AppendFormat(",{0}\":{1}", "{\"" + i, strList[i] + "}"); } } if (listLevel.Count > 1) { HttpContext.Current.Response.Write(jsonCallBackFunName + "([" + sb.ToString() + "])"); } else { HttpContext.Current.Response.Write(jsonCallBackFunName + "(" + sb.ToString() + ")"); } } catch { } }