Example #1
0
        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;
            });
        }
Example #2
0
        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);
        }
Example #3
0
        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());
            }
        }
Example #4
0
        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;
            });
        }
Example #5
0
        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;
        }
Example #6
0
        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());
            }
        }
Example #7
0
 public BiometricUpdateBuilder WithBiometricType(BiometricType type)
 {
     _biometricUpdate.BiometricType = type;
     return(this);
 }