예제 #1
0
        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);
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
파일: UnitTest2.cs 프로젝트: WISD/WisdCar
        public void TestMethod1()
        {
            //for DB record to PO
            Mapper.CreateMap <IDataReader, ClubCardTypePO>();
            //PO to VO
            Mapper.CreateMap <ClubCardTypePO, ClubCardTypeVO>();
            //VO to PO
            //Mapper.CreateMap<ClubCardTypeVO, ClubCardTypePO>();
            ClubCardTypeMgm clubMgm = new ClubCardTypeMgm();

            clubMgm.GetAllCardType();
        }