Пример #1
0
        public static async void createNewMemberCheckInformation(MessageBody data)
        {
            string Id       = data.id;
            var    url      = $"{Constant.Host}/api/member/checkin/{Id}";
            var    response = await HttpUtil.Request(url);

            var obj = JsonConvert.DeserializeObject <ResponseResult <MemberCheckIn> >(response);

            if (!Instance.membercheckinlist.Any(i => i._id == obj.data._id))
            {
                Instance.membercheckinlist.Add(obj.data);
            }
            Instance.OnReceiveCheckInResponse(Instance, new CustomCheckInEventArge {
                currentdata = Instance.membercheckinlist
            });
        }
Пример #2
0
        public static async Task updateMemberCheckInInformation(MessageBody data)
        {
            string Id       = data.id;
            var    url      = $"{Constant.Host}/api/member/checkin/{Id}";
            var    response = await HttpUtil.Request(url);

            var obj = JsonConvert.DeserializeObject <ResponseResult <MemberCheckIn> >(response);

            var member = Instance.membercheckinlist.SingleOrDefault(m => m.openId == obj.data.openId);

            if (member == null)
            {
                return;
            }
            member.result      = obj.data.result;
            member.status      = obj.data.status;
            member.checkInTime = obj.data.checkInTime;
            member.message     = obj.data.message;
            Instance.OnReceiveCheckInResponse(Instance, new CustomCheckInEventArge {
                currentdata = Instance.membercheckinlist
            });
        }