/// <summary> /// return MBO count filter by query object /// </summary> public static int GetSize(Sybase.Persistence.Query query) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); try { query.SetEntity(META_DATA); query.SetDatabaseMetaData(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Metadata); int count_2 = 0; com.sybase.afx.db.DynamicQuery query_4 = new com.sybase.afx.db.DynamicQuery(); System.Data.IDbCommand ps_5 = query_4.CreateCommand(_conn, query, true); System.Data.IDataReader rs_6 = ps_5.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); com.sybase.afx.db.ReaderUtil.Read(profile, rs_6); count_2 = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs_6, "count", 0); if (rs_6 != null) { com.sybase.afx.db.ReaderUtil.Close(profile, rs_6, count_2); } if (ps_5 != null) { ps_5.Dispose(); } return(count_2); } catch (Sybase.Persistence.PersistenceException ex_10) { throw ex_10; } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__passwordHash = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "passwordHash", 0); this.__user = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "user", 1); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__username = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "username", 0); this.__remoteId = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "remoteId", 1); this.__UsuarioParam = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "UsuarioParam", 2); this.__id = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "id", 3); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__Usuario = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "Usuario", 0); this.__UsuarioUserDefined = com.sybase.afx.db.ReaderUtil.GetBoolean(profile, rs, "UsuarioUserDefined", 1); this.__size_sp = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "size_sp", 2); this.__user_sp = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "user_sp", 3); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__operationType = com.sybase.afx.db.ReaderUtil.GetChar(profile, rs, "operationType", 0); this.__rootEntityType = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "rootEntityType", 1); this.__rootSurrogateKey = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "rootSurrogateKey", 2); this.__entityType = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "entityType", 3); this.__surrogateKey = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "surrogateKey", 4); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__firstId = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "firstId", 0); this.__lastId = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "lastId", 1); this.__nextId = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "nextId", 2); this.__remoteId = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "remoteId", 3); this.__batchId = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "batchId", 4); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__key_name = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "key_name", 0); this.__user = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "user", 1); this.__value = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "value", 2); this.__user_defined = com.sybase.afx.db.ReaderUtil.GetBoolean(profile, rs, "user_defined", 3); this.__description = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "description", 4); this.__id = com.sybase.afx.db.ReaderUtil.GetLong(profile, rs, "id", 5); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__tipoInteraccion = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "tipoInteraccion", 0); this.__cantidadInteraccion = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "cantidadInteraccion", 1); this.__diaInteraccion = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "diaInteraccion", 2); this.__mesInteraccion = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "mesInteraccion", 3); this.__anioInteraccion = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "anioInteraccion", 4); this.__idTipoInteraccion = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "idTipoInteraccion", 5); _isNew = false; _isDirty = false; }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__valorBoolean = com.sybase.afx.db.ReaderUtil.GetNullableBoolean(profile, rs, "valorBoolean", 0); this.__valorInteger = com.sybase.afx.db.ReaderUtil.GetNullableInt(profile, rs, "valorInteger", 1); this.__valorString = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "valorString", 2); this.__valorDouble = com.sybase.afx.db.ReaderUtil.GetNullableDouble(profile, rs, "valorDouble", 3); this.__valorDateTime = com.sybase.afx.db.ReaderUtil.GetNullableDateTime(profile, rs, "valorDateTime", 4); this.__idCustomLocalData = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "idCustomLocalData", 5); _isNew = false; _isDirty = false; }
/// <summary> /// Find a mobile business object YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal FindByPrimaryKey(int diaInteraccion , int mesInteraccion , int anioInteraccion , int idTipoInteraccion) { YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal 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.\"d\",x.\"e\",x.\"a\",x.\"b\",x.\"c\",x.\"f\" FROM \"co_crmmobiledesa_1_0_calendariointeraccionlocal\" x WHERE x.\"a\" = ? AND x.\"b\" = ? AND x.\"c\" = ? AND x.\"f\" = ?"; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps_3, "diaInteraccion", diaInteraccion); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps_3, "mesInteraccion", mesInteraccion); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps_3, "anioInteraccion", anioInteraccion); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps_3, "idTipoInteraccion", idTipoInteraccion); 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.CalendarioInteraccionLocal entity_6 = new YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal(); 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); }
protected void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) { this.__deviceId = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "deviceId", 0); this.__username = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "username", 1); this.__appname = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "appname", 2); this.__enable = com.sybase.afx.db.ReaderUtil.GetBoolean(profile, rs, "enable", 3); this.__adminLock = com.sybase.afx.db.ReaderUtil.GetBoolean(profile, rs, "adminLock", 4); this.__interval = com.sybase.afx.db.ReaderUtil.GetInt(profile, rs, "interval", 5); this.__protocol = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "protocol", 6); this.__address = com.sybase.afx.db.ReaderUtil.GetNullableStringUL(profile, rs, "address", 7); this.__domain = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "domain", 8); this.__package = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "package", 9); this.__syncGroup = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "syncGroup", 10); this.__clientId = com.sybase.afx.db.ReaderUtil.GetString(profile, rs, "clientId", 11); _isNew = false; _isDirty = false; }
/// <summary> /// Find a mobile business object 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 YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq FindSub(string _username , string Usuario) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq 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 s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s where s.\"username\" =? and ( s.\"UsuarioParam\"=? or (s.\"UsuarioParam\" IS NULL AND CAST(? AS varchar(100)) IS NULL))"; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "_username", _username); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); 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 = 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); }
/// <summary> /// Find a List of YPF.Comercial.RRCC.SUP.ClientPersonalization /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ClientPersonalization> FindByUser(string user, int skip, int take) { skip = skip + 1; Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ClientPersonalization> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ClientPersonalization>(); 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 = " p.\"key_name\",p.\"user\",p.\"value\",p.\"user_defined\",p.\"description\",p.\"id\" from \"co_crmmobiledesa_1_0_clientpersonalization\" p where p.\"user\" = ?"; _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetString(_conn.GetConnectionProfile(), ps_3, "user", user); 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.ClientPersonalization entity_6 = new YPF.Comercial.RRCC.SUP.ClientPersonalization(); 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); }
/// <summary> /// Find a List of YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal> FindByIdTipoInteraccion(int idTipoInteraccion, int skip, int take) { skip = skip + 1; Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal>(); 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.\"d\",x.\"e\",x.\"a\",x.\"b\",x.\"c\",x.\"f\" FROM \"co_crmmobiledesa_1_0_calendariointeraccionlocal\" x WHERE x.\"f\" = ?"; _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetInt(_conn.GetConnectionProfile(), ps_3, "idTipoInteraccion", idTipoInteraccion); 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.CalendarioInteraccionLocal entity_6 = new YPF.Comercial.RRCC.SUP.CalendarioInteraccionLocal(); 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); }
/// <summary> /// Find a List of ChangeLogImpl /// </summary> /// <param name="query">The query to be filter.</param> /// <exception cref="PersistenceException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl> FindWithQuery(Sybase.Persistence.Query query) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); try { query.SetEntity(META_DATA); query.SetDatabaseMetaData(YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Metadata); int count_2 = 0; Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl> list_3 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ChangeLogImpl>(); if (query.Take == 0) { return(list_3); } com.sybase.afx.db.DynamicQuery query_4 = new com.sybase.afx.db.DynamicQuery(); System.Data.IDbCommand ps_5 = query_4.CreateCommand(_conn, query); System.Data.IDataReader rs_6 = ps_5.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_6)) { YPF.Comercial.RRCC.SUP.ChangeLogImpl entity_9 = new YPF.Comercial.RRCC.SUP.ChangeLogImpl(); entity_9.Bind(profile, rs_6); list_3.Add(entity_9); count_2++; } if (rs_6 != null) { com.sybase.afx.db.ReaderUtil.Close(profile, rs_6, count_2); } if (ps_5 != null) { ps_5.Dispose(); } return(list_3); } catch (Sybase.Persistence.PersistenceException ex_10) { throw ex_10; } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
/// <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); }
/// <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); }
/// <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); }
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(); } }
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(); } }
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(); } }
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(); } }
static CRMMobileDesaDB() { Sybase.Persistence.ConnectionProfile _cp0 = Sybase.Persistence.ConnectionProfile.Find(_profile.GetName()); if (_cp0 != null) { _profile = _cp0; } else { _profile.SetProperty("databaseFile", "cRMMobile1_0.udb"); _profile.SetProperty("enableStreaming", "true"); GetConnectionProfile().PageSize = 4096; } Sybase.Persistence.ConnectionProfile _cp = Sybase.Persistence.ConnectionProfile.Find(GetSynchronizationProfile().GetName()); if (_cp != null) { _profile.SetSyncProfile(_cp); } _listSyncGroupNames.Add("Deuda"); _listSyncGroupNames.Add("Cliente"); _listSyncGroupNames.Add("RepresentanteComercial"); _listSyncGroupNames.Add("Interaccion"); _listSyncGroupNames.Add("TablasMaestras"); _listSyncGroupNames.Add("Parametro"); _listSyncGroupNames.Add("CabeceraPedido"); _listSyncGroupNames.Add("DetallePedido"); _listSyncGroupNames.Add("Facturacion"); _appName = _profile.GetString("appName"); if (_appName == null) { _appName = System.Reflection.Assembly.GetCallingAssembly().GetName().CodeBase; } _profile.SetProperty("packageName", GetPackageName()); _profile.GetSyncProfile().SetProperty("packageName", GetPackageName()); }
private static void InternalSynchronize (string synchronizationGroup, Sybase.Persistence.SyncStatusListener listener, Sybase.Persistence.SynchronizationContext syncContext, com.sybase.afx.json.JsonObject syncContextEx) { string mlServerHost; int mlServerPort; string syncUsername; string syncPassword; bool isInitialSync = "initialSync".Equals(synchronizationGroup) || KeyGenerator.InitSync(); YPF.Comercial.RRCC.SUP.PersonalizationParameters _pp = GetPersonalizationParameters(); _pp.Username =(GetSynchronizationProfile().UserName); _pp.Password =(GetSynchronizationProfile().Password); _pp.SaveUserNamePassword(); lock(_synchronizeLock) { Sybase.Mobile.Application.GetInstance().ApplicationSettings.CheckApplicationSettingsAvailable(); Sybase.Persistence.ConnectionProfile _interProfile = new Sybase.Persistence.ConnectionProfile(); _interProfile.DomainName =("default"); _interProfile.ServerName =("sdbuetmapl28"); _interProfile.PortNumber =(2480); _interProfile.NetworkProtocol =("http,https"); _interProfile.NetworkStreamParams =("trusted_certificates=;url_suffix="); _interProfile.ApplyProperties(Sybase.Mobile.Application.GetInstance().ApplicationSettings); _interProfile.ApplyProperties(GetSynchronizationProfile()); mlServerHost = _interProfile.ServerName; mlServerPort = _interProfile.PortNumber; syncUsername = _interProfile.UserName; syncPassword = _interProfile.Password; string sysPlatform = _interProfile.GetProperty("os"); Sybase.Persistence.ConnectionWrapper ulConn = null; com.sybase.afx.db.ConnectionSyncParams syncParms = new com.sybase.afx.db.ConnectionSyncParams(); try { YPF.Comercial.RRCC.SUP.PersonalizationParameters pp = new YPF.Comercial.RRCC.SUP.PersonalizationParameters(); syncUsername += ("@" + _interProfile.DomainName); com.sybase.afx.json.JsonObject json = new com.sybase.afx.json.JsonObject(); Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.ClientPersonalization> listClientPersonalization = pp.ListClientPK; foreach(YPF.Comercial.RRCC.SUP.ClientPersonalization __item in listClientPersonalization) { json.Put(__item.Key_name, __item.GetRealValue()); } Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.SessionPersonalization> sessionServerPersonalization = pp.ListSessionPK; foreach(YPF.Comercial.RRCC.SUP.SessionPersonalization __item in sessionServerPersonalization) { json.Put(__item.Key_name, __item.Value); } json.Put("pv", "" + YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.GetProtocolVersion()); json.Put("pid", com.sybase.afx.util.PidUtil.GetId()); json.Put("cle", _interProfile.GetProperty("changeLogEnabled", "false")); if(isInitialSync) { com.sybase.afx.json.JsonObject jsonMBOMap = new com.sybase.afx.json.JsonObject(); jsonMBOMap.Put("DireccionEntrega",231); jsonMBOMap.Put("Interaccion",232); jsonMBOMap.Put("CalendarioInteraccionLocal",233); jsonMBOMap.Put("CategoriaPregunta",234); jsonMBOMap.Put("ClienteCabeceraPedido",235); jsonMBOMap.Put("ClienteDetallePedido",236); jsonMBOMap.Put("ClienteDeuda",237); jsonMBOMap.Put("ClienteFacturacion",238); jsonMBOMap.Put("CustomLocalData",239); jsonMBOMap.Put("Direccion",240); jsonMBOMap.Put("EstadoInteraccion",241); jsonMBOMap.Put("Formulario",242); jsonMBOMap.Put("FormularioMercado",243); jsonMBOMap.Put("FormularioMercadoSegmento",244); jsonMBOMap.Put("FormularioMercadoSubsegmento",245); jsonMBOMap.Put("FormularioMercadoTamano",246); jsonMBOMap.Put("FormularioPrecios",247); jsonMBOMap.Put("FormularioPreciosMercado",248); jsonMBOMap.Put("FormularioPreciosRed",249); jsonMBOMap.Put("FormularioPreciosZonaInspeccion",250); jsonMBOMap.Put("FormularioTransporte",251); jsonMBOMap.Put("Mail",252); jsonMBOMap.Put("Motivo",253); jsonMBOMap.Put("Negocio",254); jsonMBOMap.Put("OpcionRespuesta",255); jsonMBOMap.Put("Parametro",256); jsonMBOMap.Put("Pregunta",257); jsonMBOMap.Put("PreguntaFormulario",258); jsonMBOMap.Put("Provincia",259); jsonMBOMap.Put("RelevamientoPrecios",260); jsonMBOMap.Put("RelevamientoPreciosProducto",261); jsonMBOMap.Put("RelevamientoProducto",262); jsonMBOMap.Put("RelevamientoProductoProducto",263); jsonMBOMap.Put("RelevamientoProductoTipo",264); jsonMBOMap.Put("RelevamientoProveedor",265); jsonMBOMap.Put("RelevamientoProveedorCanal",266); jsonMBOMap.Put("RelevamientoProveedorLogistica",267); jsonMBOMap.Put("RelevamientoTransporte",268); jsonMBOMap.Put("RelevamientoTransporteCompetidor",269); jsonMBOMap.Put("RelevamientoTransporteProducto",270); jsonMBOMap.Put("RepresentanteComercial",271); jsonMBOMap.Put("Respuesta",272); jsonMBOMap.Put("RespuestaInteraccionFormulario",273); jsonMBOMap.Put("Segmento",274); jsonMBOMap.Put("SeleccionFormulario",275); jsonMBOMap.Put("SeleccionTablaRelevamiento",276); jsonMBOMap.Put("TablaRelevamiento",277); jsonMBOMap.Put("Telefono",278); jsonMBOMap.Put("TipoInteraccion",279); jsonMBOMap.Put("LogRecordImpl",281); jsonMBOMap.Put("OperationReplay",282); jsonMBOMap.Put("SISSubscription",285); jsonMBOMap.Put("PackageProperties",286); jsonMBOMap.Put("ChangeLogImpl",288); jsonMBOMap.Put("OfflineAuthentication",289); jsonMBOMap.Put("RepresentanteComercialSynchronizationParameters",290); jsonMBOMap.Put("RepresentanteComercial_pull_pq",291); jsonMBOMap.Put("ClientPersonalization",341); jsonMBOMap.Put("KeyGenerator",346); jsonMBOMap.Put("LocalKeyGenerator",348); json.Put("mboMap", jsonMBOMap); json.Put("publications", synchronizationGroup); json.Put("isInitialSync", isInitialSync.ToString()); } else { json.Put("publications", synchronizationGroup); } bool async = !isInitialSync && _interProfile.GetBoolean("asyncReplay", true); if(syncContextEx == null) { syncContextEx = new com.sybase.afx.json.JsonObject(); } syncContextEx.Remove("async"); syncContextEx.Put("async", async + ""); json.Put("_as", async + ""); if(async && !IsReplayQueueEmpty()) { YPF.Comercial.RRCC.SUP.intrnl.OperationReplay rq = new YPF.Comercial.RRCC.SUP.intrnl.OperationReplay(); rq.SetComponent("CRMMobileDesaDB"); com.sybase.afx.json.JsonObject parameter = new com.sybase.afx.json.JsonObject(); if(syncContext != null) { object userContext = syncContext.UserContext; if(userContext != null) { if(userContext is string) { parameter.Put("userContext", userContext); } else { throw new Sybase.Persistence.PersistenceException("user context must be string for async operation replay"); } } parameter.Put("synchronizationGroup",synchronizationGroup); } rq.SetParameters(parameter.ToString()); rq.SetOperation("batchNotify"); rq.Save(); } if(_appName != null) { json.Put("app", _appName); } json.Put("appId", Sybase.Mobile.Application.GetInstance().ApplicationIdentifier); if (sysPlatform != null) { json.Put("os", sysPlatform); } string str = json.ToString(); byte[] bin = com.sybase.afx.util.StringUtil.ToUTF8(str); string authParam = com.sybase.afx.util.BinaryUtil.ToStringBase64(bin); bool isHttps = _interProfile.NetworkProtocol.Equals("https", System.StringComparison.OrdinalIgnoreCase); int maxLen = 4000; int size = (authParam.Length + maxLen - 1) / maxLen; if (size > 16) { throw new Sybase.Persistence.SynchronizeException("the whole length of personalization parameters exceeds the limit of authenticate parameters and the safe length is 512 bytes"); } string[] authList = new string[16]; for (int i = 0; i < size; i++) { authList[i] = authParam.Substring(i * maxLen, ((i + 1) * maxLen < authParam.Length) ? maxLen : (authParam.Length - i * maxLen)); } for (int i = size; i < 16; i++) { authList[i] = "x";//Spacer } ulConn = AcquireDBWriteConnection(); syncParms.IsHttps = isHttps; syncParms.Version = _interProfile.DomainName + "_" + "crmmobiledesa.1_0"; syncParms.UserName = syncUsername; if(_interProfile.Certificate != null) { syncPassword = null; } syncParms.Password = syncPassword + ("@" + com.sybase.afx.util.PidUtil.GetId()); string mlStreamParams = "host=\"" + mlServerHost + "\";port=\"" + mlServerPort + "\""; string urlSuffix = com.sybase.afx.util.NetworkStreamParams.ExtractValue("url_suffix", _interProfile.NetworkStreamParams); if(urlSuffix != null && urlSuffix.Length != 0) { mlStreamParams = "host=\"" + mlServerHost + "\";port=\"" + mlServerPort + "\";url_suffix=\"" + urlSuffix + "\""; } //setting http_userid and http_password if HTTPCredentials are available Sybase.Persistence.LoginCredentials lc = Sybase.Mobile.Application.GetInstance().ConnectionProperties.HTTPCredentials; if (lc != null) { string http_userid = lc.UserName; string http_password = lc.Password; mlStreamParams = mlStreamParams + ";http_userid=\"" + http_userid + "\";http_password=\"" + http_password + "\""; } string cookie = com.sybase.afx.util.NetworkStreamParams.ExtractValue("set_cookie", _interProfile.NetworkStreamParams); Sybase.Collections.StringProperties httpCookies = Sybase.Mobile.Application.GetInstance().ConnectionProperties.HttpCookies; if (httpCookies != null) { foreach(string key in httpCookies.Keys()) { string value = httpCookies.Item(key); if (cookie == null || cookie.Length == 0) { cookie = key + "=" + value; } else { cookie += "," + key + "=" + value; } } } if (cookie != null && cookie.Length != 0) { mlStreamParams = mlStreamParams + ";set_cookie=\"" + cookie +"\""; } System.Collections.Generic.List<string> headers = com.sybase.afx.util.NetworkStreamParams.ExtractListValue("custom_header", _interProfile.NetworkStreamParams); foreach (string header in headers) { mlStreamParams = mlStreamParams + ";custom_header=\"" + header +"\""; } Sybase.Collections.StringProperties httpHeaders = Sybase.Mobile.Application.GetInstance().ConnectionProperties.HttpHeaders; if (httpHeaders != null) { foreach(string key in httpHeaders.Keys()) { string value = httpHeaders.Item(key); mlStreamParams = mlStreamParams + ";custom_header=\"" + key + ":" + value + "\""; } } string ip = _interProfile.GetString("client_ip"); if(ip != null && ip.Length != 0) { mlStreamParams = mlStreamParams + ";client_ip_addr=\"" + ip + "\""; } if(isHttps) { string ts = com.sybase.afx.util.NetworkStreamParams.ExtractValue("trusted_certificates", _interProfile.NetworkStreamParams); mlStreamParams += ";trusted_certificates=\"" + ts + "\""; string tls = com.sybase.afx.util.NetworkStreamParams.ExtractValue("tls_type", _interProfile.NetworkStreamParams); if (tls != null) { mlStreamParams += ";tls_type=\"" + tls + "\""; } } System.Collections.Generic.IList<System.Collections.Generic.KeyValuePair<string, string>> nwParams = com.sybase.afx.util.NetworkStreamParams.Parse(_interProfile.NetworkStreamParams); foreach (System.Collections.Generic.KeyValuePair<string, string> entry in nwParams) { string v = entry.Key; if (!v.StartsWith("url_suffix") && !v.StartsWith("trusted_certificates") && !v.StartsWith("tls_type") && !v.StartsWith("http_userid") && !v.StartsWith("http_password") && !v.StartsWith("set_cookie") && !v.StartsWith("custom_header")) { mlStreamParams += ";" + v + "=\"" + entry.Value + "\""; } } syncParms.StreamParms = mlStreamParams; syncParms.Publications = synchronizationGroup; syncParms.AuthenticationParms = authList; syncParms.UploadOnly = syncContextEx.GetBoolean("uploadOnly"); com.sybase.afx.db.ConnectionUtil.SetConnectionSyncParams(ulConn, syncParms); com.sybase.afx.db.CommandUtil.TraceSynchronize(_profile.GetSyncProfile(), synchronizationGroup, syncContext, GetRemoteId(ulConn)); if (listener != null) { string[] mboNames = com.sybase.afx.DatabaseBase.GetMBONames(synchronizationGroup, GetPublications()); System.Collections.Hashtable tableMBOMap = getTableMBOMap(); com.sybase.afx.db.ConnectionUtil.Synchronize(ulConn, listener, _interProfile.ToSyncConnection(), mboNames, tableMBOMap); } else { com.sybase.afx.db.ConnectionUtil.Synchronize(ulConn); } //check protocol version PackageProperties _props = PackageProperties.Find("protocol_version"); int _pv = 0; if (_props != null) { _pv = System.Int32.Parse(_props.Value); } if (!isInitialSync && GetProtocolVersion() > _pv) { string _msg = "device's protocol version is incompatible with the server's protocol version. (" + GetProtocolVersion() + " > " + _pv + ")"; Sybase.Persistence.ProtocolException _pe = new Sybase.Persistence.ProtocolException(_msg); GetCallbackHandler().OnMessageException(_pe); throw _pe; } PackageProperties lastRequestId = PackageProperties.Find("lastRequestId"); if(lastRequestId == null) { lastRequestId = new PackageProperties(); lastRequestId.Key = "lastRequestId"; } try { lastRequestId.Value = KeyGenerator.GenerateId()+""; } catch(Sybase.Persistence.SynchronizeRequiredException) { lastRequestId = null; } if(lastRequestId != null) { lastRequestId.Save(); } YPF.Comercial.RRCC.SUP.intrnl.OperationReplay.Finish(); } catch(com.sybase.afx.db.SynchronizationException _ex) { string exMsg = _ex.ToString(); com.sybase.afx.db.ConnectionImpl connImpl = (com.sybase.afx.db.ConnectionImpl)ulConn; iAnywhere.Data.UltraLite.ULConnection ul_conn = (iAnywhere.Data.UltraLite.ULConnection)connImpl.GetConnection(); if (_ex.NativeError == com.sybase.afx.db.SynchronizationException.SQLE_MOBILINK_COMMUNICATIONS_ERROR) { string strMessage = ul_conn.SyncResult.StreamErrorParameters; try { int errorCode = System.Convert.ToInt32(strMessage); Sybase.Mobile.Application.GetInstance().ApplicationCallback.OnHttpCommunicationError(errorCode, "", new Sybase.Collections.StringProperties()); } catch (System.FormatException) { } } long authValue = ul_conn.SyncResult.AuthValue; if ((_ex.NativeError == com.sybase.afx.db.SynchronizationException.SQLE_MOBILINK_AUTHENTICATION_FAILED) && (authValue == com.sybase.afx.util.AuthExceptionUtil.FAILURE_CODE_TOKEN_VALIDATION_ERROR || authValue == 4000)) { GetCallbackHandler().OnLoginFailure(); if (syncContext == null) { syncContext = new Sybase.Persistence.SynchronizationContext(); } syncContext.ErrorCode = 401; syncContext.ErrorMessage = "authentication failed."; if (authValue == com.sybase.afx.util.AuthExceptionUtil.FAILURE_CODE_TOKEN_VALIDATION_ERROR) { syncContext.ErrorCode = 412; } } com.sybase.afx.util.AuthExceptionUtil.CheckAuthValueAfterSync(com.sybase.afx.db.ConnectionUtil.GetConnectionSyncAuthValue(ulConn), _ex); if (_ex.NativeError == com.sybase.afx.db.SynchronizationException.SQLE_MOBILINK_COMMUNICATIONS_ERROR) { exMsg += "Details:\n" + com.sybase.afx.db.ConnectionUtil.GetConnectionSyncDetail(ulConn) + "\n"; } if( !"system".Equals(synchronizationGroup) && com.sybase.afx.db.SynchronizationException.SQLE_SERVER_SYNCHRONIZATION_ERROR == _ex.NativeError ) { try { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Synchronize("system", null); } catch { if (!"initialSync".Equals(synchronizationGroup)) { string _msg = "the package is not deployed or device's protocol version may be incompatible with the server's protocol version. (" + GetProtocolVersion() + " > 0)"; Sybase.Persistence.ProtocolException _pe = new Sybase.Persistence.ProtocolException(_msg); GetCallbackHandler().OnMessageException(_pe); throw _pe; } } } throw new Sybase.Persistence.SynchronizeException(exMsg,_ex); } catch(System.Exception _ex) { throw new Sybase.Persistence.SynchronizeException(_ex.ToString(),_ex); } finally { if(ulConn != null) { ReleaseDBConnection();; } } } }