Exemplo n.º 1
0
        public MemberModel Get(int id)
        {
            var entity =_MemberService.GetMemberById(id);
            var model = new MemberModel
            {

                Id = entity.Id,

                User = entity.User,

                OpenId = entity.OpenId,

            //		        Orders = entity.Orders,

                ContactName = entity.ContactName,

            };
            return model;
        }
Exemplo n.º 2
0
        public bool Post(MemberModel model)
        {
            var entity = new MemberEntity
            {

                User = model.User,

                OpenId = model.OpenId,

            //				Orders = model.Orders,

                ContactName = model.ContactName,

            };
            if(_MemberService.Create(entity).Id > 0)
            {
                return true;
            }
            return false;
        }
Exemplo n.º 3
0
        public bool Put(MemberModel model)
        {
            var entity = _MemberService.GetMemberById(model.Id);
            if(entity == null)
                return false;

            entity.User = model.User;

            entity.OpenId = model.OpenId;

            //			entity.Orders = model.Orders;

            entity.ContactName = model.ContactName;

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