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()); } }
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 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()); } }
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 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()); } }
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()); } }