Ejemplo n.º 1
0
        //Register user to device
        internal bool RegisterUser()
        {
            try
            {
                //User add
                foreach (var memberViewModel in _attendanceDevice.TeamMembers)
                {
                    if (_syncStatus.IsRunning == false)
                    {
                        return(false);
                    }

                    var isSuccess = _attendanceDeviceDriver.SaveToDevice(memberViewModel, false);
                    if (isSuccess)
                    {
                        OnThrowingMessage("Member " + memberViewModel.member_id + " operation completed ", MessageType.Success);
                    }
                }

                //Refresh data at device
                _attendanceDeviceDriver.RefreshData();

                return(true);
            }
            catch (Exception ex)
            {
                serviceLog.Error(ex);
                return(false);
            }
        }
Ejemplo n.º 2
0
        //Prepare device before operation
        // clean Device hardware
        internal bool ReadyDevice()
        {
            try
            {
                //_attendanceDeviceDriver.Clean();
                _attendanceDeviceDriver.RefreshData();

                return(true);
            }
            catch (Exception e)
            {
                //Log.Error(e);
                return(false);
            }
        }