示例#1
0
        public TagModel Get(int id)
        {
            var entity =_TagService.GetTagById(id);
            var model = new TagModel
            {

                Id = entity.Id,

                Tag = entity.Tag,

                Adduser = entity.Adduser,

                Addtime = entity.Addtime,

                UpdUser = entity.UpdUser,

                UpdTime = entity.UpdTime,

            //		        Content = entity.Content,

            };
            return model;
        }
示例#2
0
        public bool Post(TagModel model)
        {
            var entity = new TagEntity
            {

                Tag = model.Tag,

                Adduser = model.Adduser,

                Addtime = model.Addtime,

                UpdUser = model.UpdUser,

                UpdTime = model.UpdTime,

            //				Content = model.Content,

            };
            if(_TagService.Create(entity).Id > 0)
            {
                return true;
            }
            return false;
        }
示例#3
0
        public bool Put(TagModel model)
        {
            var entity = _TagService.GetTagById(model.Id);
            if(entity == null)
                return false;

            entity.Tag = model.Tag;

            entity.Adduser = model.Adduser;

            entity.Addtime = model.Addtime;

            entity.UpdUser = model.UpdUser;

            entity.UpdTime = model.UpdTime;

            //			entity.Content = model.Content;

            if(_TagService.Update(entity) != null)
                return true;
            return false;
        }