Exemplo n.º 1
0
        public async Task CheckInDeviceAsync()
        {
            ProgressTitle   = _progressTitleForCheckIn;
            ProgressMessage = _progressMessageForCheckIn;
            IsBusy          = true;

            CheckInOutService service = new CheckInOutService(_repositories);
            CheckInOutActions status  = await service.GetDeviceStatus(Mvx.Resolve <IDeviceInfo>().IMEI);

            IsBusy = false;
            if (status == CheckInOutActions.CheckOut)
            {
                ShowViewModel <CheckInViewModel>();
            }
            else
            {
                await Mvx.Resolve <ICustomUserInteraction>().AlertAsync("This device is not checked out, so can not be checked in.");
            }
        }
Exemplo n.º 2
0
        public static bool IsValidQRCode(string qrCode, CheckInOutActions currentAction)
        {
            bool valid = false;

            try
            {
                Models.QRData qrData = JsonConvert.DeserializeObject <Models.QRData>(qrCode);
                if (qrData.deviceId != 0 &&
                    qrData.driverId != 0 &&
                    !string.IsNullOrEmpty(qrData.phoneNumber) &&
                    qrData.imei == Mvx.Resolve <IDeviceInfo>().IMEI&&
                    qrData.actionPerformed == (int)currentAction)
                {
                    valid = true;
                }
            }
            catch
            {
            }
            return(valid);
        }