コード例 #1
0
        /// <summary>
        /// 增加标签
        /// </summary>
        /// <param name="model"></param>
        public static void AddLabel(LabelModel model)
        {
            //   var labelInfo = AutoMapper.Mapper.Map<Entities.LabelInfo>(model);
            var labelInfo = model.Map <Entities.LabelInfo>();


            _iMemberLabelService.AddLabel(labelInfo);
        }
コード例 #2
0
        public JsonResult Label(LabelModel model)
        {
            LabelInfo labelmodel = new LabelInfo()
            {
                Id        = model.Id,
                LabelName = model.LabelName
            };

            if (MemberLabelApplication.CheckNameIsExist(model.LabelName))
            {
                throw new HimallException("标签已经存在,不能重复!");
            }
            if (labelmodel.Id > 0)
            {
                _iMemberLabelService.UpdateLabel(labelmodel);
            }
            else
            {
                _iMemberLabelService.AddLabel(labelmodel);
            }
            return(Json(new { Success = true }));
        }
コード例 #3
0
        /// <summary>
        /// 增加标签
        /// </summary>
        /// <param name="model"></param>
        public static void AddLabel(LabelModel model)
        {
            var labelInfo = AutoMapper.Mapper.Map <Model.LabelInfo>(model);

            _iMemberLabelService.AddLabel(labelInfo);
        }