Example #1
0
        public Response Execute(User currentUser, string request)
        {
            var req = JsonConvert.DeserializeObject <Request <Transfer> >(request);
            var obj = req.Entities.FirstOrDefault();

            obj.MasterType = obj.MasterType.GetId();
            obj.MasterId   = obj.MasterId.GetId();

            List <EntityBase> entites = new List <EntityBase>();

            entites.Add(obj);
            if (obj.RowState == RowState.Added)
            {
                obj.TrySetNewEntity();
            }
            var cmd = CommandHelper.CreateSave(entites);

            cmd.AfterCommands = new List <Command> {
                AttachUpdateCreatorId(obj)
            };
            var rsp = DbContext.GetInstance().Execute(cmd);

            if (obj.MasterType == "016001")//活动
            {
                //如果是移交活动, 就将此移交人添加到活动成员中去(通过报名的方式添加)
                if (!ActivityHelper.ActivityUserIsExist(obj.MasterId, obj.TargetUserId))
                {
                    ActivitySignUp(obj);
                }
            }

            if (obj.MasterType == "016002" && rsp.IsSuccess)//移交俱乐部,同步IM 移交群给某人
            {
                ChangeGroupOwner(obj.MasterId, obj.TargetUserId);
            }
            return(rsp);
        }
        public Response Execute(User currentUser, string request)
        {
            var req = JsonConvert.DeserializeObject <Request <GetActivityUserListFilter> >(request);

            return(ActivityHelper.GetActivityUserList(req.Filter));
        }