public void SetImage(BiometricType bio) { if (bio == null) return; byte[] photo = bio.data; if (photo == null || photo.Length == 0) { return; } var memStream = new MemoryStream(); Task t = memStream.WriteAsync(photo, 0, photo.Length); t.ContinueWith(result => { memStream.Position = 0; this.photo.Image = Image.FromStream(memStream, true, true); this.photo.SizeMode = PictureBoxSizeMode.StretchImage; }); }
private BiometricType GetFaceBiometric() { var bio = new BiometricType(); bio.Name = "face"; if (fileStream == null) { bio.data = new byte[0]; return(bio); } using (var ms = new MemoryStream()) { fileStream.Position = 0; fileStream.CopyTo(ms); bio.data = ms.ToArray(); ms.Flush(); } return(bio); }
public int InsertBiometricType(BiometricType val) { try { using (var connect = new Connect()) { connect.BeginTrx(); SqlConnection sqlconn = connect.GetConnection(); var bioDao = new BiometricTypeDataMapper(sqlconn); bioDao.SetTransaction(connect.Transaction); int result = bioDao.Insert(val); connect.Commit(); return(result); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
public void SetImage(BiometricType bio) { if (bio == null) { return; } byte[] photo = bio.data; if (photo == null || photo.Length == 0) { return; } var memStream = new MemoryStream(); Task t = memStream.WriteAsync(photo, 0, photo.Length); t.ContinueWith(result => { memStream.Position = 0; this.photo.Image = Image.FromStream(memStream, true, true); this.photo.SizeMode = PictureBoxSizeMode.StretchImage; }); }
private BiometricType GetFaceBiometric() { var bio = new BiometricType(); bio.Name = "face"; if (fileStream == null) { bio.data = new byte[0]; return bio; } using (var ms = new MemoryStream()) { fileStream.Position = 0; fileStream.CopyTo(ms); bio.data = ms.ToArray(); ms.Flush(); } return bio; }
public int InsertBiometricType(BiometricType val) { try { using (var connect = new Connect()) { connect.BeginTrx(); SqlConnection sqlconn = connect.GetConnection(); var bioDao = new BiometricTypeDataMapper(sqlconn); bioDao.SetTransaction(connect.Transaction); int result = bioDao.Insert(val); connect.Commit(); return result; } } catch (Exception exception) { throw new FaultException<ServerError>(new ServerError()); } }
public BiometricUpdateBuilder WithBiometricType(BiometricType type) { _biometricUpdate.BiometricType = type; return(this); }