public string SignIn(Credential credential) { try { string user = credential.user; string pass = credential.pass; if (PdpUserProvider.IsValidUser(user, pass)) { Interlocked.Increment(ref actives_users); Interlocked.Increment(ref accesscounter); Session session = new Session(); session.user = user; using (var connect = new Connect()) { connect.BeginTrx(); SqlConnection sqlconn = connect.GetConnection(); var smapper = new SessionDataMapper(sqlconn); smapper.SetTransaction(connect.Transaction); //smapper.Insert(session); } return(authProvider.AutenticateUser(credential)); } return(null); } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
// // Insert a Regist // public int InsertRegist(Regist val) { try { using (var c = new Connect()) { c.BeginTrx(); var registMapper = new RegistDataMapper(c.GetConnection()); registMapper.SetTransaction(c.Transaction); int result = registMapper.Insert(val); c.Commit(); return(result); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
// // Insert a Person // public int InsertPerson(Person val) { try { using (var c = new Connect()) { c.BeginTrx(IsolationLevel.ReadCommitted); var personDoa = new PersonDataMapper(c.GetConnection()); personDoa.SetTransaction(c.Transaction); int result = personDoa.Insert(val); c.Commit(); return(result); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
public void InsertDocument(Document doc) { try { using (var connect = new Connect()) { connect.BeginTrx(); SqlConnection sqlconn = connect.GetConnection(); var docmapper = new DocumentDataMapper(sqlconn); docmapper.SetTransaction(connect.Transaction); docmapper.Insert(doc); connect.Commit(); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
public void InsertParticipant(Participant val) { try { using (var c = new Connect()) { c.BeginTrx(); var partiMapper = new ParticipantDataMapper(c.GetConnection()); partiMapper.SetTransaction(c.Transaction); partiMapper.Insert(val); c.Commit(); } } 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()); } }