private List<SelectListItem> GetClubCardType(List<SelectListItem>ddllist,params object[]where) { IClubCardTypeMgm ctmgm = new ClubCardTypeMgm(); List<ClubCardTypeVO> list = ctmgm.GetAllCardType(); if (list.Count>0) { list.ForEach(ct => { if (ddllist.Count == 0) { ddllist.Add(new SelectListItem() { Text = ct.CardTypeName, Value = ct.ClubCardTypeID.ToString(), Selected = true }); } else { ddllist.Add(new SelectListItem() { Text = ct.CardTypeName, Value = ct.ClubCardTypeID.ToString() }); } }); } return ddllist; }
/// <summary> /// 获取所有的会员卡类型 /// </summary> /// <returns></returns> public JsonResult GetAllClubCardType() { List<ClubCardTypeVO> result = new List<ClubCardTypeVO>(); try { //BizMocker mocker = new BizMocker(); //result = mocker.GetAllCardType(); IClubCardTypeMgm ctypMgm = new ClubCardTypeMgm(); result = ctypMgm.GetAllCardType(); foreach (var item in result) { item.DT_RowId = item.ClubCardTypeID.ToString(); item.Operation = "<a href='javascript:void(0)' onclick='ClubCardType.Edit(" + item.DT_RowId + ")'><i class='fa fa-pencil'></i> 编辑</a> | <a href='javascript:void(0)' onclick='ClubCardType.Del(" + item.DT_RowId + ")'><i class='fa fa-times'></i> 删除</a>"; item.PayDiscountDesc = ConvertDiscount(item.PayDiscount); item.PackageDiscountDesc = ConvertDiscount(item.PackageDiscount); } } catch (Exception ex) { LogHandler.Error(ex.Message.ToString()); } return Json(result, JsonRequestBehavior.AllowGet); }