Exemple #1
0
 public BiometricType[] GetBiometricTypes(int person_id)
 {
     try
     {
         using (var connect = new Connect())
         {
             SqlConnection sqlconn = connect.GetConnection();
             var           bioDao  = new BiometricTypeDataMapper(sqlconn);
             return(bioDao.GetAll().Where(bio => bio.Person.Id == person_id).ToArray());
         }
     }
     catch (Exception exception)
     {
         throw new FaultException <ServerError>(new ServerError());
     }
 }
Exemple #2
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());
            }
        }
Exemple #3
0
        public BiometricType GetBiometricType(int person_id, string name)
        {
            try
            {
                name = name.ToLower();
                using (var connect = new Connect())
                {
                    SqlConnection sqlconn = connect.GetConnection();
                    var           bioDao  = new BiometricTypeDataMapper(sqlconn);


                    return(bioDao.GetAll().FirstOrDefault(
                               bio =>
                               bio.Person.Id == person_id && bio.Name.ToLower().Equals(name)));
                }
            }
            catch (Exception exception)
            {
                throw new FaultException <ServerError>(new ServerError());
            }
        }
Exemple #4
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());
            }
        }
Exemple #5
0
 public BiometricType[] GetBiometricTypes(int person_id)
 {
     try
     {
         using (var connect = new Connect())
         {
             SqlConnection sqlconn = connect.GetConnection();
             var bioDao = new BiometricTypeDataMapper(sqlconn);
             return bioDao.GetAll().Where(bio => bio.Person.Id == person_id).ToArray();
         }
     }
     catch (Exception exception)
     {
         throw new FaultException<ServerError>(new ServerError());
     }
 }
Exemple #6
0
        public BiometricType GetBiometricType(int person_id, string name)
        {
            try
            {
                name = name.ToLower();
                using (var connect = new Connect())
                {
                    SqlConnection sqlconn = connect.GetConnection();
                    var bioDao = new BiometricTypeDataMapper(sqlconn);

                    return bioDao.GetAll().FirstOrDefault(
                        bio =>
                            bio.Person.Id == person_id && bio.Name.ToLower().Equals(name));
                }
            }
            catch (Exception exception)
            {
                throw new FaultException<ServerError>(new ServerError());
            }
        }