public static async Task getAllMemberCheckInOnToday(CheckInType type, CheckInAddress address) { try { var url = $"{Constant.Host}/api/member/checkin/?type={Convert.ToInt32(type)}&locationId={address?.value}"; var response = await HttpUtil.Request(url); var obj = JsonConvert.DeserializeObject <ResponseResult <List <MemberCheckIn> > >(response); Instance.membercheckinlist.Clear(); if (obj.code == 0) { Instance.membercheckinlist = obj.data; } Instance.OnReceiveCheckInResponse(Instance, new CustomCheckInEventArge { currentdata = Instance.membercheckinlist }); } catch (Exception ex) { throw ex; } }
public void SetCheckInType(CheckInType type) { try { switch (type) { case CheckInType.Family: FamilyDatabase = new FamilyDatabase(); CurrentView = new FamilyViewModel(this); break; case CheckInType.Pilot: PilotDatabase = new PilotDatabase(); CurrentView = new PilotViewModel(this); break; } } catch (Exception e) { //TODO: We need to give the user a warning that the connection failed. Console.WriteLine(@"No connection...\n\n" + e.Message); } }