Beispiel #1
0
        /// <summary>
        /// Find a List of YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq
        /// </summary>
        /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
        /// <remarks> </remarks>
        public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> FindAll(int skip, int take)
        {
            skip = skip + 1;
            Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq>();
            System.Data.IDataReader rs_4 = null;
            int count_5 = 0;

            Sybase.Persistence.ConnectionWrapper _conn = null;
            try
            {
                _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
                string _selectSQL = " s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s";
                _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL;
                System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL);
                rs_4 = ps_3.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4))
                {
                    YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq();
                    entity_6.Bind(profile, rs_4);
                    count_5++;
                    result_2.Add(entity_6);
                }
                if (rs_4 != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5);
                }
                if (ps_3 != null)
                {
                    ps_3.Dispose();
                }
                _selectSQL = null;
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
            return(result_2);
        }
Beispiel #2
0
        /// <summary>
        /// Find a List of YPF.Comercial.RRCC.SUP.LocalKeyGenerator
        /// </summary>
        /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
        /// <remarks> </remarks>
        public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.LocalKeyGenerator> FindAll(int skip, int take)
        {
            skip = skip + 1;
            Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.LocalKeyGenerator> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.LocalKeyGenerator>();
            System.Data.IDataReader rs_4 = null;
            int count_5 = 0;

            Sybase.Persistence.ConnectionWrapper _conn = null;
            try
            {
                _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
                string _selectSQL = " x.\"first_id\",x.\"last_id\",x.\"next_id\",x.\"remote_id\",x.\"batch_id\" from \"co_crmmobiledesa_1_0_localkeygenerator\" x order by x.\"first_id\"";
                _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL;
                System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL);
                rs_4 = ps_3.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4))
                {
                    YPF.Comercial.RRCC.SUP.LocalKeyGenerator entity_6 = new YPF.Comercial.RRCC.SUP.LocalKeyGenerator();
                    entity_6.Bind(profile, rs_4);
                    count_5++;
                    result_2.Add(entity_6);
                }
                if (rs_4 != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5);
                }
                if (ps_3 != null)
                {
                    ps_3.Dispose();
                }
                _selectSQL = null;
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
            return(result_2);
        }
Beispiel #3
0
        /// <summary>
        /// Find a List of YPF.Comercial.RRCC.SUP.intrnl.SISSubscription
        /// </summary>
        /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
        /// <remarks> </remarks>
        public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.SISSubscription> FindAll(int skip, int take)
        {
            skip = skip + 1;
            Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.SISSubscription> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.SISSubscription>();
            System.Data.IDataReader rs_4 = null;
            int count_5 = 0;

            Sybase.Persistence.ConnectionWrapper _conn = null;
            try
            {
                _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
                string _selectSQL = " ss.\"device_id\",ss.\"user_name\",ss.\"h\",ss.\"i\",ss.\"admin_lock\",ss.\"l\",ss.\"m\",ss.\"n\",ss.\"domain\",ss.\"pkg\",ss.\"sync_group\",ss.\"cid\" FROM \"sup_sis_subscription\" ss";
                _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL;
                System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL);
                rs_4 = ps_3.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4))
                {
                    YPF.Comercial.RRCC.SUP.intrnl.SISSubscription entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.SISSubscription();
                    entity_6.Bind(profile, rs_4);
                    count_5++;
                    result_2.Add(entity_6);
                }
                if (rs_4 != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5);
                }
                if (ps_3 != null)
                {
                    ps_3.Dispose();
                }
                _selectSQL = null;
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
            return(result_2);
        }
Beispiel #4
0
        /// <summary>
        /// Find a mobile business object YPF.Comercial.RRCC.SUP.CustomLocalData
        /// </summary>
        /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
        /// <remarks> </remarks>
        public static YPF.Comercial.RRCC.SUP.CustomLocalData FindByPrimaryKey(string idCustomLocalData)
        {
            YPF.Comercial.RRCC.SUP.CustomLocalData result_2 = null;
            System.Data.IDataReader rs_4 = null;
            int count_5 = 0;

            Sybase.Persistence.ConnectionWrapper _conn = null;
            try
            {
                _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
                string _selectSQL           = "SELECT x.\"b\",x.\"c\",x.\"d\",x.\"e\",x.\"f\",x.\"a\" FROM \"co_crmmobiledesa_1_0_customlocaldata\" x WHERE x.\"a\" = ?";
                System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps_3, "idCustomLocalData", idCustomLocalData);
                rs_4 = ps_3.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4))
                {
                    YPF.Comercial.RRCC.SUP.CustomLocalData entity_6 = new YPF.Comercial.RRCC.SUP.CustomLocalData();
                    entity_6.Bind(profile, rs_4);
                    count_5++;
                    result_2 = entity_6;
                }
                if (rs_4 != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5);
                }
                if (ps_3 != null)
                {
                    ps_3.Dispose();
                }
                _selectSQL = null;
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
            return(result_2);
        }
Beispiel #5
0
        private static YPF.Comercial.RRCC.SUP.intrnl.SISSubscription _find(YPF.Comercial.RRCC.SUP.intrnl.SISSubscriptionKey id, String sql, bool findOs, bool findNonPending)
        {
            Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
            System.Data.IDataReader _rs = null;
            int count = 0;

            try
            {
                YPF.Comercial.RRCC.SUP.intrnl.SISSubscription _rt = null;
                System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps, "domain", id.Domain);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps, "package", id.Package);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps, "syncGroup", id.SyncGroup);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps, "clientId", id.ClientId);
                _rs = ps.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs))
                {
                    _rt = new YPF.Comercial.RRCC.SUP.intrnl.SISSubscription();
                    _rt.Bind(profile, _rs);
                    count++;
                }
                if (_rs != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count);
                }
                if (ps != null)
                {
                    ps.Dispose();
                }
                return(_rt);
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
        }
Beispiel #6
0
        private static YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal _find(YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocalKey id, String sql, bool findOs, bool findNonPending)
        {
            Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
            System.Data.IDataReader _rs = null;
            int count = 0;

            try
            {
                YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal _rt = null;
                System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql);
                com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "diaInteraccion", id.DiaInteraccion);
                com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "mesInteraccion", id.MesInteraccion);
                com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "anioInteraccion", id.AnioInteraccion);
                com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "idTipoInteraccion", id.IdTipoInteraccion);
                _rs = ps.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs))
                {
                    _rt = new YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal();
                    _rt.Bind(profile, _rs);
                    count++;
                }
                if (_rs != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count);
                }
                if (ps != null)
                {
                    ps.Dispose();
                }
                return(_rt);
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
        }
Beispiel #7
0
 /// <summary>
 /// Delete the mobile business object.
 /// </summary>
 public void Delete()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         int count = 1;
         System.Data.IDbCommand ps1 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, "delete co_crmmobiledesa_1_0_clientpersonalization where \"id\"=?");
         com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps1, "id", this.Id);
         count = ps1.ExecuteNonQuery();
         ps1.Dispose();;
         _isNew     = false;
         _isDeleted = true;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
        private static YPF.Comercial.RRCC.SUP.ChangeLogImpl _find(YPF.Comercial.RRCC.SUP.ChangeLogKey id, String sql, bool findOs, bool findNonPending)
        {
            Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
            System.Data.IDataReader _rs = null;
            int count = 0;

            try
            {
                YPF.Comercial.RRCC.SUP.ChangeLogImpl _rt = null;
                System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql);
                com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps, "entityType", id.EntityType);
                com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "surrogateKey", id.SurrogateKey);
                _rs = ps.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs))
                {
                    _rt = new YPF.Comercial.RRCC.SUP.ChangeLogImpl();
                    _rt.Bind(profile, _rs);
                    count++;
                }
                if (_rs != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count);
                }
                if (ps != null)
                {
                    ps.Dispose();
                }
                return(_rt);
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
        }
Beispiel #9
0
 /// <summary>
 /// Sybase internal use only.
 /// <summary>
 public void NextBatch()
 {
     //lock(typeof(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB))
     //{
     Sybase.Persistence.ConnectionWrapper       _conn   = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     Sybase.Persistence.LocalTransaction        _tran_1 = _conn.BeginTransaction();
     YPF.Comercial.RRCC.SUP.LocalKeyGeneratorPK _pk_2   = new YPF.Comercial.RRCC.SUP.LocalKeyGeneratorPK();
     _pk_2.RemoteId = ("*");
     _pk_2.BatchId  = (1);
     YPF.Comercial.RRCC.SUP.LocalKeyGenerator _batch_3 = YPF.Comercial.RRCC.SUP.LocalKeyGenerator.Find(_pk_2);
     if (_batch_3 == null)
     {
         _batch_3          = new YPF.Comercial.RRCC.SUP.LocalKeyGenerator();
         _batch_3.RemoteId = (_pk_2.RemoteId);
         _batch_3.BatchId  = (_pk_2.BatchId);
         _batch_3.FirstId  = (1);
         _batch_3.NextId   = (1 + 100000);
         // _batch_3.LastId =(9223372036854775807);
         _batch_3.LastId = (2147483647);
         _batch_3.Save();
         this.RemoteId = ("*");
         this.BatchId  = (1);
         this.FirstId  = (1);
         this.NextId   = (1);
         this.LastId   = (100000);
     }
     else
     {
         long _next_4 = _batch_3.NextId;
         long _next_5 = _next_4 + 100000;
         _batch_3.NextId = (_next_5);
         _batch_3.Save();
         this.FirstId = (_next_4);
         this.NextId  = (_next_4);
         this.LastId  = (_next_5 - 1);
     }
     _tran_1.Commit();
     //}
 }
        /// <summary>
        /// Sybase internal use only.
        /// <summary>
        public void RbsReplayInternal(YPF.Comercial.RRCC.SUP.RelevamientoProducto entity)
        {
            YPF.Comercial.RRCC.SUP.intrnl.OperationReplay _replay = new YPF.Comercial.RRCC.SUP.intrnl.OperationReplay();
            _replay.RemoteId  = (".");
            _replay.Component = ("CRMMobileDesa.RelevamientoProducto_rs");
            _replay.EntityKey = (entity.KeyToString());
            _replay.Operation = (entity.LastOperation);
            bool _includeBig = !("delete").Equals(_replay.Operation);

            com.sybase.afx.json.JsonObject _parameters = new com.sybase.afx.json.JsonObject();
            _parameters.Put("entity", YPF.Comercial.RRCC.SUP.RelevamientoProducto.__toJSON(entity, _includeBig));
            //_replay.Parameters =(_parameters.ToString());
            //lock(typeof(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB))
            //{
            Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
            Sybase.Persistence.LocalTransaction  _tran = null;
            try
            {
                _tran = _conn.BeginTransaction();

                com.sybase.afx.json.JsonObject _json = new com.sybase.afx.json.JsonObject();
                _replay.Attributes = (_json.ToString());
                _replay.Save();
                _replay.SaveParameter(_parameters);
                _tran.Commit();
            }
            catch (Sybase.Persistence.PersistenceException pe)
            {
                _tran.Rollback();
                throw pe;
            }
            catch (System.ApplicationException e)
            {
                _tran.Rollback();
                throw e;
            }
            //}
        }
        private static YPF.Comercial.RRCC.SUP.RepresentanteComercialSynchronizationParameters _find(string id, String sql, bool findOs, bool findNonPending)
        {
            Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection();
            System.Data.IDataReader _rs = null;
            int count = 0;

            try
            {
                YPF.Comercial.RRCC.SUP.RepresentanteComercialSynchronizationParameters _rt = null;
                System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql);
                com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps, "user_sp", id);
                _rs = ps.ExecuteReader();
                Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile();
                while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs))
                {
                    _rt = new YPF.Comercial.RRCC.SUP.RepresentanteComercialSynchronizationParameters();
                    _rt.Bind(profile, _rs);
                    count++;
                }
                if (_rs != null)
                {
                    com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count);
                }
                if (ps != null)
                {
                    ps.Dispose();
                }
                return(_rt);
            }
            catch (System.Data.DataException ex)
            {
                throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
            }
            finally
            {
                YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
            }
        }
Beispiel #12
0
 /// <summary>
 /// create an MBO instance
 /// </summary>
 public void Create()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         CreateBySQL(_conn, "insert sup_sis_subscription (\"device_id\",\"user_name\",\"h\",\"i\",\"admin_lock\",\"l\",\"m\",\"n\",\"domain\",\"pkg\",\"sync_group\",\"cid\") values (?,?,?,?,?,?,?,?,?,?,?,?)", this);
         _isNew     = false;
         _isDeleted = false;
         _isDirty   = false;
     }
     catch (Sybase.Persistence.PersistenceException pe)
     {
         throw pe;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
 /// <summary>
 /// Delete the mobile business object.
 /// </summary>
 public void Delete()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         int count = 1;
         System.Data.IDbCommand ps1 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, "delete crmmobiledesa_1_0_changelogimpl where \"a\"=? and \"b\"=?");
         com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps1, "entityType", this.EntityType);
         com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps1, "surrogateKey", this.SurrogateKey);
         count = ps1.ExecuteNonQuery();
         ps1.Dispose();;
         _isNew     = false;
         _isDeleted = true;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
Beispiel #14
0
 /// <summary>
 /// create an MBO instance
 /// </summary>
 public void Create()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         CreateBySQL(_conn, "insert co_crmmobiledesa_1_0_localkeygenerator (\"first_id\",\"last_id\",\"next_id\",\"remote_id\",\"batch_id\") values (?,?,?,?,?)", this);
         _isNew     = false;
         _isDeleted = false;
         _isDirty   = false;
     }
     catch (Sybase.Persistence.PersistenceException pe)
     {
         throw pe;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
 /// <summary>
 /// create an MBO instance
 /// </summary>
 public void Create()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         CreateBySQL(_conn, "insert crmmobiledesa_1_0_changelogimpl (\"c\",\"d\",\"e\",\"a\",\"b\") values (?,?,?,?,?)", this);
         _isNew     = false;
         _isDeleted = false;
         _isDirty   = false;
     }
     catch (Sybase.Persistence.PersistenceException pe)
     {
         throw pe;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
Beispiel #16
0
 /// <summary>
 /// Update the mobile business object
 /// </summary>
 public void Update()
 {
     Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
     try
     {
         int count = 1;
         System.Data.IDbCommand cmd = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, "update co_crmmobiledesa_1_0_offlineauthentication set \"b\"=? where \"a\"=?");
         com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), cmd, "passwordHash", this.PasswordHash);
         com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), cmd, "user", this.User);
         count = cmd.ExecuteNonQuery();
         cmd.Dispose();;
         _isNew     = false;
         _isDirty   = false;
         _isDeleted = false;
     }
     catch (System.Data.DataException ex)
     {
         throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex);
     }
     finally
     {
         YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection();
     }
 }
        public void Finish_rbsReplayInternal(Sybase.Persistence.IOperationReplay _call_tmp)
        {
            YPF.Comercial.RRCC.SUP.intrnl.OperationReplay _call = (YPF.Comercial.RRCC.SUP.intrnl.OperationReplay)_call_tmp;
            com.sybase.afx.json.JsonObject parameters           = (com.sybase.afx.json.JsonObject)(com.sybase.afx.json.JsonReader
                                                                                                   .Parse(_call.Parameters));
            string exception = _call.Exception;

            YPF.Comercial.RRCC.SUP.RelevamientoProducto entity = (YPF.Comercial.RRCC.SUP.RelevamientoProducto)(YPF.Comercial.RRCC.SUP.RelevamientoProducto.__fromJSON(parameters.Get("entity")));

            //lock(typeof(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB))
            //{
            Sybase.Persistence.ConnectionWrapper conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBWriteConnection();
            Sybase.Persistence.LocalTransaction  tran = null;
            try
            {
                tran = conn.BeginTransaction();

                long ____id = entity.ReplayCounter;
                YPF.Comercial.RRCC.SUP.RelevamientoProducto _client        = YPF.Comercial.RRCC.SUP.RelevamientoProducto.Find(entity._pk());
                YPF.Comercial.RRCC.SUP.RelevamientoProducto _downloadState = null;
                if (_client != null)
                {
                    _downloadState = _client.DownloadState;
                }
                if (exception == null)
                {
                    YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.GetCallbackHandler().OnReplaySuccess(_client == null ? entity : _client);
                    YPF.Comercial.RRCC.SUP.RelevamientoProducto.GetCallbackHandler().OnReplaySuccess(_client == null ? entity : _client);
                    if ((_client != null) && _client.IsPending)
                    {
                        long _rc = _client.ReplayPending;
                        if (_rc == ____id)
                        {
                            if (_rc == _client.ReplayCounter)
                            {
                                _client._cancelPending2(false);
                            }
                            else
                            {
                                _client.ReplayPending = 0;
                                _client.ReplayFailure = 0;
                                _client.__update(true);
                            }
                        }
                    }
                }
                else
                {
                    _client.ReplayFailure = (_client.ReplayPending);
                    _client._cascadeUpdateReplayCounterPending(false);
                    if (_client != null && _client.ReplayPending == ____id)
                    {
                        _client.ReplayPending = (0);
                        _client.ReplayCounter = (YPF.Comercial.RRCC.SUP.KeyGenerator.GenerateId());
                        _client.ReplayFailure = (____id);
                        _client.__update(true);
                        if (_downloadState != null)
                        {
                            _downloadState._update_os();
                        }
                    }
                    YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.GetCallbackHandler().OnReplayFailure(_client);
                    YPF.Comercial.RRCC.SUP.RelevamientoProducto.GetCallbackHandler().OnReplayFailure(_client);
                }
                _call.Delete();
                tran.Commit();
            }
            catch (Sybase.Persistence.PersistenceException pe)
            {
                tran.Rollback();
                throw pe;
            }
            catch (System.ApplicationException e)
            {
                tran.Rollback();
                throw e;
            }
            //}
        }
Beispiel #18
0
 /// <summary>
 /// Closes all the free connections and clears the connection pool.
 /// </summary>
 public static void CloseDBConnection()
 {
     lock(typeof(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB))
     {
         if (_synchronizeConn!= null)
         {
             _synchronizeConn.Close();
             _synchronizeConn = null;
         }
         if(_lockManager != null)
         {
             _lockManager.ClearPayload();
             _lockManager = null;
         }
     }
 }