/// <summary> /// 编辑 /// </summary> /// <returns></returns> public ActionResult MemberBaseModify() { int mid = int.Parse(RequestBase.GetString("m_ID")); Model.MemberBase mb = memberbll.GetModel(mid); BLL.VipRank vipbll = new BLL.VipRank(); #region 根据积分得到等级 decimal discount = 1.0M; var vipRanks = vipbll.GetModelList(" r_Status = 0 and r_Score <= " + mb.m_Score); if (vipRanks != null && vipRanks.Any()) { var model= vipRanks.OrderByDescending(m => m.r_Score).FirstOrDefault(); if (model != null) { //discount = model.r_ZheK.Value; List<Model.VipRank> modelVipType = vipbll.GetModelList(" r_Status != 2 and r_Status!=1"); List<SelectListItem> selectType = new List<SelectListItem>(); //selectType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "0" } }; for (int i = 0; i < modelVipType.Count; i++) { selectType.Add(new SelectListItem { Value = modelVipType[i].r_Rank.ToString(), Text = modelVipType[i].r_Name + "---" + modelVipType[i].r_ZheK + "折扣" }); } ViewData["selviprank"] = new SelectList(selectType, "Value", "Text", model.r_Rank); } } #endregion return View(mb); }
/// <summary> /// 添加 /// </summary> /// <returns></returns> public ActionResult MemberBaseEdit() { BLL.VipRank vipbll = new BLL.VipRank(); List<Model.VipRank> modelVipType = vipbll.GetModelList(" r_Status != 2 and r_Status!=1"); List<SelectListItem> selectType = new List<SelectListItem>(); //selectType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "0" } }; for (int i = 0; i < modelVipType.Count; i++) { selectType.Add(new SelectListItem { Value = modelVipType[i].r_Rank.ToString(), Text = modelVipType[i].r_Name + "---" + modelVipType[i].r_ZheK + "折扣" }); } ViewData["addselviprank"] = new SelectList(selectType, "Value", "Text", "请选择"); return View(); }