예제 #1
0
 //
 // 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());
     }
 }
예제 #2
0
 //
 //  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());
     }
 }
예제 #3
0
        public int InsertParticipant(Participant val)
        {
            try
            {
                using (var c = new Connect())
                {

                    c.BeginTrx();
                    var partiMapper = new ParticipantDataMapper(c.GetConnection());
                    partiMapper.SetTransaction(c.Transaction);
                    int ret = partiMapper.Insert(val);
                    c.Commit();
                    return ret;

                }
            }

            catch (Exception exception)
            {
                throw new FaultException<ServerError>(new ServerError());
            }
        }
예제 #4
0
        public int InsertDocument(Document doc)
        {
            try
            {
                using (var connect = new Connect())
                {

                    connect.BeginTrx();
                    SqlConnection sqlconn = connect.GetConnection();
                    var docmapper = new DocumentDataMapper(sqlconn);
                    docmapper.SetTransaction(connect.Transaction);
                    int ret = docmapper.Insert(doc);
                    connect.Commit();

                    return ret;
                }
            }
            catch (Exception exception)
            {
                throw new FaultException<ServerError>(new ServerError());
            }
        }
예제 #5
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());
            }
        }
예제 #6
0
파일: Broker.cs 프로젝트: ProjectoFinal/PS
        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());
            }
        }