public async Task Initialize() { var devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(ParrotUuids.Service_A00)); DeviceInformations.Add(devices[0]); devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(ParrotUuids.Service_B00)); DeviceInformations.Add(devices[0]); devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(ParrotUuids.Service_C00)); DeviceInformations.Add(devices[0]); devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(ParrotUuids.Service_D21)); DeviceInformations.Add(devices[0]); devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(ParrotUuids.Service_D51)); DeviceInformations.Add(devices[0]); }
public ActionResult Update(DeviceInformations deviceInformation) { try { var data = deviceRepository.Update(deviceInformation); return(Ok(new { success = true, successMessage = "Updated Successfully!" })); } catch (Exception ex) { return(Ok(new { success = false, errorMessage = ex.GetBaseException() })); } }
public bool Update(DeviceInformations deviceInformations) { var result = ( from di in context.DeviceInformations where di.Id == deviceInformations.Id select di ).FirstOrDefault(); result.UpdatedOn = DateTime.Now; result.DeviceLocationId = deviceInformations.DeviceLocationId; result.DeviceCode = deviceInformations.DeviceCode; result.DeviceName = deviceInformations.DeviceName; context.Entry(result).State = EntityState.Modified; return(context.SaveChanges() > 0); }
public void connect_Device() { // CloseScanner(); //Thread.Sleep(1000); //string deviceName = "FG_ZF10"; DeviceIdentity selectedDI = new DeviceIdentity(); //Get selected Frame-Grabber selectedDI = DeviceIdentity.FG_ZF10; //Get selected Frame-Grabber //DeviceIdentity selectedDI = (DeviceIdentity)xamlListBoxFG.SelectedItem; //Get selected Frame-Grabber //this.SelectedDeviceIdentity = selectedDI; DeviceInformations[] dinfos = FPScanner.GetAttachedDevices(selectedDI); //Get all Fingerprint Scanners DeviceInformations dinfo = dinfos.First(); DeviceInfos di = new DeviceInfos(dinfo.index, dinfo.name); FingerPrintScanner = FPScanner.GetFPScanner(selectedDI, di.Index); //_fpScanner = FingerPrintScanner; ////use any assembly versions //RedirectAssembly("Dermalog.Imaging.Capturing"); //RedirectAssembly("Dermalog.AFIS.FourprintSegmentation"); //RedirectAssembly("Dermalog.AFIS.TwoPprintSegmentation"); //RedirectAssembly("Dermalog.Afis.NistQualityCheck"); //RedirectAssembly("Dermalog.AFIS.FingerCode3"); //_afis = new LocalAFIS(); //// DisplayMessage("Loading user database"); // // lbStorage.Text = "Storage: " + _afis.StoragePath; // //toolTip1.SetToolTip(lbStorage, _afis.StoragePath); // //lbStorage.ToolTip = _afis.StoragePath; // UpdateUserList(); //EnableGUI(false); //Thread.Sleep(500); }
public bool Save(DeviceInformations deviceInformations) { using (var transaction = context.Database.BeginTransaction()) { try { var model = new DeviceInformations { DeviceGuid = Guid.NewGuid().ToString(), DeviceLocationId = deviceInformations.DeviceLocationId, DeviceName = deviceInformations.DeviceName, DeivceToken = Guid.NewGuid().ToString().ToUpper(), //Regex.Replace(Guid.NewGuid().ToString(), "[^0-9a-zA-Z]", string.Empty).ToUpper(), DeviceCode = deviceInformations.DeviceCode, CreatedOn = DateTime.Now, UpdatedOn = DateTime.Now }; context.Add(model); context.SaveChanges(); //update device serial number this.deviceSerailNumberRepository.SetDeviceSerialNumber(model.DeviceCode); //if all success - commit first step (second step was success completed) transaction.Commit(); return(true); } catch (Exception Ex) { errorLogRepository.Insert(new ErrorLog { EvenName = "Save Device Informations Failed", ErrorDetails = Ex.GetBaseException().Message }); //if we have error - rollback first step (second step not be able accepted) transaction.Rollback(); throw; } } }
public DeviceInformations[] GetDeviceInformations() { var device = new DeviceInformations[] { }; return(device); }
internal Selection(DeviceIdentity id, DeviceInformations info) { DeviceId = id; DeviceInfo = info; }