/// <summary>
        /// Sybase internal use only.
        /// <summary>
        public void RbsReplayInternal(YPF.Comercial.RRCC.SUP.FormularioMercado entity)
        {
            YPF.Comercial.RRCC.SUP.intrnl.OperationReplay _replay = new YPF.Comercial.RRCC.SUP.intrnl.OperationReplay();
            _replay.RemoteId  = (".");
            _replay.Component = ("CRMMobileDesa.FormularioMercado_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.FormularioMercado.__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;
            }
            //}
        }
        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.FormularioMercado entity = (YPF.Comercial.RRCC.SUP.FormularioMercado)(YPF.Comercial.RRCC.SUP.FormularioMercado.__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.FormularioMercado _client        = YPF.Comercial.RRCC.SUP.FormularioMercado.Find(entity._pk());
                YPF.Comercial.RRCC.SUP.FormularioMercado _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.FormularioMercado.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.FormularioMercado.GetCallbackHandler().OnReplayFailure(_client);
                }
                _call.Delete();
                tran.Commit();
            }
            catch (Sybase.Persistence.PersistenceException pe)
            {
                tran.Rollback();
                throw pe;
            }
            catch (System.ApplicationException e)
            {
                tran.Rollback();
                throw e;
            }
            //}
        }
Пример #3
0
 internal  void _fromJSON(com.sybase.afx.json.JsonObject _json)
 {
     __idInteraccion = (_json.GetString("idInteraccion"));
     __tipoInteraccion_CodigoSAP = (_json.GetString("tipoInteraccion_CodigoSAP"));
     __titulo = (_json.GetNullableString("titulo"));
     __tipoInteraccion_CategoriaSAP = (_json.GetString("tipoInteraccion_CategoriaSAP"));
     __GUID = (_json.GetString("GUID"));
     __nroOperacionSAP = (_json.GetNullableString("nroOperacionSAP"));
     __segmento_CodigoSAP = (_json.GetNullableString("segmento_CodigoSAP"));
     __negocio_CodigoSAP = (_json.GetNullableString("negocio_CodigoSAP"));
     __formulario_CodigoSAP = (_json.GetNullableString("formulario_CodigoSAP"));
     __puntaje = (_json.GetNullableDecimal("puntaje"));
     __latitud = (_json.GetNullableString("latitud"));
     __longitud = (_json.GetNullableString("longitud"));
     __comentarios = (_json.GetNullableString("comentarios"));
     __notasPreparacion = (_json.GetNullableString("notasPreparacion"));
     __notasResultado = (_json.GetNullableString("notasResultado"));
     __notasResultadoAdministrativo = (_json.GetNullableString("notasResultadoAdministrativo"));
     __notasResultadoComercial = (_json.GetNullableString("notasResultadoComercial"));
     __notasResultadoOperativo = (_json.GetNullableString("notasResultadoOperativo"));
     __notasResultadoMercado = (_json.GetNullableString("notasResultadoMercado"));
     __notasResultadoAsesoramiento = (_json.GetNullableString("notasResultadoAsesoramiento"));
     __fechaInicioPlanificada = (_json.GetNullableDate("fechaInicioPlanificada"));
     __horaInicioPlanificada = (_json.GetNullableTime("horaInicioPlanificada"));
     __fechaFinPlanificada = (_json.GetNullableDate("fechaFinPlanificada"));
     __horaFinPlanificada = (_json.GetNullableTime("horaFinPlanificada"));
     __fechaInicioReal = (_json.GetNullableDate("fechaInicioReal"));
     __horaInicioReal = (_json.GetNullableTime("horaInicioReal"));
     __fechaFinReal = (_json.GetNullableDate("fechaFinReal"));
     __horaFinReal = (_json.GetNullableTime("horaFinReal"));
     __idDireccionEntrega = (_json.GetNullableString("idDireccionEntrega"));
     __direccionEntregaNombre = (_json.GetNullableString("direccionEntregaNombre"));
     __representanteComercial_CodigoInterlocutor = (_json.GetString("representanteComercial_CodigoInterlocutor"));
     __representanteComercial_Nombre = (_json.GetNullableString("representanteComercial_Nombre"));
     __responsable_CodigoInterlocutor = (_json.GetNullableString("responsable_CodigoInterlocutor"));
     __responsableNombre = (_json.GetNullableString("responsableNombre"));
     __estadoInteraccion_CodigoSAP = (_json.GetString("estadoInteraccion_CodigoSAP"));
     __motivo_CodigoSAP = (_json.GetString("motivo_CodigoSAP"));
     __calle = (_json.GetNullableString("calle"));
     __direccionNro = (_json.GetNullableString("direccionNro"));
     __codigoPostal = (_json.GetNullableString("codigoPostal"));
     __ciudad = (_json.GetNullableString("ciudad"));
     __provincia_CodigoSAP = (_json.GetNullableString("provincia_CodigoSAP"));
     __pais_CodigoSAP = (_json.GetNullableString("pais_CodigoSAP"));
     __formularioPrecios = (YPF.Comercial.RRCC.SUP.FormularioPrecios)(YPF.Comercial.RRCC.SUP.FormularioPrecios.FromJSON(_json.Get("formularioPrecios")));
     __formularioPreciosValid = com.sybase.afx.json.JsonValue.GetBoolean(_json.Get("formularioPreciosValid"));
     __formularioMercado = (YPF.Comercial.RRCC.SUP.FormularioMercado)(YPF.Comercial.RRCC.SUP.FormularioMercado.FromJSON(_json.Get("formularioMercado")));
     __formularioMercadoValid = com.sybase.afx.json.JsonValue.GetBoolean(_json.Get("formularioMercadoValid"));
     __relevamientosTransporte = (Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.RelevamientoTransporte>)(YPF.Comercial.RRCC.SUP.RelevamientoTransporte.FromJSONList(_json.Get("relevamientosTransporte")));
     __relevamientosProducto = (Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.RelevamientoProducto>)(YPF.Comercial.RRCC.SUP.RelevamientoProducto.FromJSONList(_json.Get("relevamientosProducto")));
     __relevamientosPrecio = (Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.RelevamientoPrecios>)(YPF.Comercial.RRCC.SUP.RelevamientoPrecios.FromJSONList(_json.Get("relevamientosPrecio")));
     __formularioTransporte = (YPF.Comercial.RRCC.SUP.FormularioTransporte)(YPF.Comercial.RRCC.SUP.FormularioTransporte.FromJSON(_json.Get("formularioTransporte")));
     __formularioTransporteValid = com.sybase.afx.json.JsonValue.GetBoolean(_json.Get("formularioTransporteValid"));
     __relevamientosProveedor = (Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.RelevamientoProveedor>)(YPF.Comercial.RRCC.SUP.RelevamientoProveedor.FromJSONList(_json.Get("relevamientosProveedor")));
     __respuestasInteraccionFormulario = (Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.RespuestaInteraccionFormulario>)(YPF.Comercial.RRCC.SUP.RespuestaInteraccionFormulario.FromJSONList(_json.Get("respuestasInteraccionFormulario")));
     __pending = (_json.GetBoolean("pending"));
     __pendingChange = (_json.GetChar("pendingChange"));
     __replayPending = (_json.GetLong("replayPending"));
     __replayFailure = (_json.GetLong("replayFailure"));
     __surrogateKey = (_json.GetLong("surrogateKey"));
     __replayCounter = (_json.GetLong("_rc"));
     __disableSubmit = (_json.GetBoolean("disableSubmit"));
     char op_2 = _json.GetChar("_op");
     _isNew = (op_2 == 'C');
     _isDirty = (op_2 == 'U');
     _isDeleted = (op_2 == 'D');
 }
Пример #4
0
 /// <summary>
 /// copy the MBO attributes to current MBO
 /// </summary>
 public void CopyAll(YPF.Comercial.RRCC.SUP.Interaccion entity)
 {
     this._isNew = entity._isNew;
     this.__idInteraccion = entity.__idInteraccion;
     this.__tipoInteraccion_CodigoSAP = entity.__tipoInteraccion_CodigoSAP;
     this.__titulo = entity.__titulo;
     this.__tipoInteraccion_CategoriaSAP = entity.__tipoInteraccion_CategoriaSAP;
     this.__GUID = entity.__GUID;
     this.__nroOperacionSAP = entity.__nroOperacionSAP;
     this.__segmento_CodigoSAP = entity.__segmento_CodigoSAP;
     this.__negocio_CodigoSAP = entity.__negocio_CodigoSAP;
     this.__formulario_CodigoSAP = entity.__formulario_CodigoSAP;
     this.__puntaje = entity.__puntaje;
     this.__latitud = entity.__latitud;
     this.__longitud = entity.__longitud;
     this.__comentarios = entity.__comentarios;
     this.__notasPreparacion = entity.__notasPreparacion;
     this.__notasResultado = entity.__notasResultado;
     this.__notasResultadoAdministrativo = entity.__notasResultadoAdministrativo;
     this.__notasResultadoComercial = entity.__notasResultadoComercial;
     this.__notasResultadoOperativo = entity.__notasResultadoOperativo;
     this.__notasResultadoMercado = entity.__notasResultadoMercado;
     this.__notasResultadoAsesoramiento = entity.__notasResultadoAsesoramiento;
     this.__fechaInicioPlanificada = entity.__fechaInicioPlanificada;
     this.__horaInicioPlanificada = entity.__horaInicioPlanificada;
     this.__fechaFinPlanificada = entity.__fechaFinPlanificada;
     this.__horaFinPlanificada = entity.__horaFinPlanificada;
     this.__fechaInicioReal = entity.__fechaInicioReal;
     this.__horaInicioReal = entity.__horaInicioReal;
     this.__fechaFinReal = entity.__fechaFinReal;
     this.__horaFinReal = entity.__horaFinReal;
     this.__idDireccionEntrega = entity.__idDireccionEntrega;
     this.__direccionEntregaNombre = entity.__direccionEntregaNombre;
     this.__representanteComercial_CodigoInterlocutor = entity.__representanteComercial_CodigoInterlocutor;
     this.__representanteComercial_Nombre = entity.__representanteComercial_Nombre;
     this.__responsable_CodigoInterlocutor = entity.__responsable_CodigoInterlocutor;
     this.__responsableNombre = entity.__responsableNombre;
     this.__estadoInteraccion_CodigoSAP = entity.__estadoInteraccion_CodigoSAP;
     this.__motivo_CodigoSAP = entity.__motivo_CodigoSAP;
     this.__calle = entity.__calle;
     this.__direccionNro = entity.__direccionNro;
     this.__codigoPostal = entity.__codigoPostal;
     this.__ciudad = entity.__ciudad;
     this.__provincia_CodigoSAP = entity.__provincia_CodigoSAP;
     this.__pais_CodigoSAP = entity.__pais_CodigoSAP;
     this.__formularioPrecios = entity.__formularioPrecios;
     this.__formularioPreciosValid = entity.__formularioPreciosValid;
     this.__formularioMercado = entity.__formularioMercado;
     this.__formularioMercadoValid = entity.__formularioMercadoValid;
     this.__relevamientosTransporte = entity.__relevamientosTransporte;
     this.__relevamientosProducto = entity.__relevamientosProducto;
     this.__relevamientosPrecio = entity.__relevamientosPrecio;
     this.__formularioTransporte = entity.__formularioTransporte;
     this.__formularioTransporteValid = entity.__formularioTransporteValid;
     this.__relevamientosProveedor = entity.__relevamientosProveedor;
     this.__respuestasInteraccionFormulario = entity.__respuestasInteraccionFormulario;
     this.__pending = entity.__pending;
     this.__pendingChange = entity.__pendingChange;
     this.__replayPending = entity.__replayPending;
     this.__replayFailure = entity.__replayFailure;
     this.__surrogateKey = entity.SurrogateKey;
     this.__replayCounter = entity.__replayCounter;
     this.__disableSubmit = entity.__disableSubmit;
 }
Пример #5
0
 /// <summary>
 /// Clear the reference of relationships in memory.
 /// </summary>
 public void ClearRelationshipObjects()
 {
     __formularioPreciosValid = false;
     __formularioPrecios = null;
     __formularioMercadoValid = false;
     __formularioMercado = null;
     __relevamientosTransporte = null;
     __relevamientosProducto = null;
     __relevamientosPrecio = null;
     __formularioTransporteValid = false;
     __formularioTransporte = null;
     __relevamientosProveedor = null;
     __respuestasInteraccionFormulario = null;
 }
Пример #6
0
 /// <summary>
 /// Sybase internal use only.
 /// <summary>
 public void SetOriginalState(YPF.Comercial.RRCC.SUP.FormularioMercado orig)
 {
     __originalStateValid = true;
     __originalState = orig;
 }
Пример #7
0
 private void Internal_Create()
 {
     bool ok = true;
     Sybase.Persistence.LocalTransaction localTransaction = null;
     try
     {
         localTransaction = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.BeginTransaction();
         if(__surrogateKey == 0) __surrogateKey = (long)(YPF.Comercial.RRCC.SUP.KeyGenerator.GenerateId());
         YPF.Comercial.RRCC.SUP.FormularioMercado os_1 = new YPF.Comercial.RRCC.SUP.FormularioMercado();
         os_1.CopyAll(this);
         this.SetOriginalState(os_1);
         PendingChange = 'C';
         SetReplayCounter(KeyGenerator.GenerateId());
         SetReplayFailure(0);
         ReplayPending = 0;
         if(_isNew)
         {
             Create(true);
         }
         else
         {
             Update(true);
         }
     }
     catch(System.SystemException e)
     {
         ok = false;
         throw e;
     }
     finally
     {
         if(localTransaction != null)
         {
             localTransaction.EndTransaction(ok);
         }
     }
 }
Пример #8
0
 protected  override void Bind(Sybase.Persistence.ConnectionProfile profile, System.Data.IDataReader rs) 
 {
     this.__idInteraccion = com.sybase.afx.db.ReaderUtil.GetString(profile,rs,"idInteraccion",0);
     this.__empresa = com.sybase.afx.db.ReaderUtil.GetString(profile,rs,"empresa",1);
     this.__formularioMercadoTamano_CodigoSAP = com.sybase.afx.db.ReaderUtil.GetString(profile,rs,"formularioMercadoTamano_CodigoSAP",2);
     this.__formularioMercadoSegmento_CodigoSAP = com.sybase.afx.db.ReaderUtil.GetString(profile,rs,"formularioMercadoSegmento_CodigoSAP",3);
     this.__formularioMercadoSubsegmento_CodigoSAP = com.sybase.afx.db.ReaderUtil.GetString(profile,rs,"formularioMercadoSubsegmento_CodigoSAP",4);
     this.__pending = com.sybase.afx.db.ReaderUtil.GetBoolean(profile,rs,"pending",5);
     this.__pendingChange = com.sybase.afx.db.ReaderUtil.GetChar(profile,rs,"pendingChange",6);
     this.__replayPending = com.sybase.afx.db.ReaderUtil.GetLong(profile,rs,"replayPending",7);
     this.__replayFailure = com.sybase.afx.db.ReaderUtil.GetLong(profile,rs,"replayFailure",8);
     this.__interaccionFK = com.sybase.afx.db.ReaderUtil.GetNullableLong(profile,rs,"interaccionFK",9);
     this.__surrogateKey = com.sybase.afx.db.ReaderUtil.GetLong(profile,rs,"surrogateKey",10);
     this.__replayCounter = com.sybase.afx.db.ReaderUtil.GetLong(profile,rs,"replayCounter",11);
     this.__disableSubmit = com.sybase.afx.db.ReaderUtil.GetBoolean(profile,rs,"disableSubmit",12);
     _isNew = false;
     _isDirty = false;
     if (this.IsPending)
     {
         this.SetOriginalState(null);
         this.__originalStateValid = false;
     }
     else
     {
         YPF.Comercial.RRCC.SUP.FormularioMercado os_1 = new YPF.Comercial.RRCC.SUP.FormularioMercado();
         os_1.CopyAll(this);
         this.SetOriginalState(os_1);
     }
 }
Пример #9
0
 /// <summary>
 /// Set current MBO attributes by specified MBO.
 /// </summary>
 public static YPF.Comercial.RRCC.SUP.FormularioMercado Merge(YPF.Comercial.RRCC.SUP.FormularioMercado entity)
 {
     YPF.Comercial.RRCC.SUP.FormularioMercado ent = Find(entity._pk());
     if (ent == null)
     {
         ent = new YPF.Comercial.RRCC.SUP.FormularioMercado();
     }
     ent.CopyAll(entity);
     ent.Save();
     return ent;
 }
Пример #10
0
 private static YPF.Comercial.RRCC.SUP.FormularioMercado _find(long 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.FormularioMercado _rt = null;
         System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql);
         com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "surrogateKey", 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.FormularioMercado();
             _rt.Bind(profile, _rs);
             count++;
             if(findOs)
             {
                 _rt.__isOsEntity = true;
                 _rt.__pending = false;  
             }
             if( !findNonPending )
             {
                 if(_rt.IsPending)
                 {
                     break;
                 }
             }
             else
             {
                 if( !_rt.IsPending )
                 {
                     break;
                 }
                 else
                 {
                     _rt = null;
                 }
             }
         }
         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();
     }
 }
Пример #11
0
 /// <summary>
 /// Refresh the mobile business object from database.
 /// </summary>
 public void Refresh()
 {
     if (!_isNew && !__isOsEntity)
     {
         YPF.Comercial.RRCC.SUP.FormularioMercado ent = Load(_pk());
         CopyAll(ent);
         if (this.IsPending)
         {
             this.SetOriginalState(null);
             this.__originalStateValid = false;
         }
         else
         {
             YPF.Comercial.RRCC.SUP.FormularioMercado os_1 = new YPF.Comercial.RRCC.SUP.FormularioMercado();
             os_1.CopyAll(this);
             this.SetOriginalState(os_1);
         }
         _isNew = false;
         _isDirty = false;
     }
 }
Пример #12
0
 internal static YPF.Comercial.RRCC.SUP.FormularioMercado FromJSON(object _json)
 {
     if (_json == null)
     {
         return null;
     }
     else
     {
         YPF.Comercial.RRCC.SUP.FormularioMercado _obj = new YPF.Comercial.RRCC.SUP.FormularioMercado();
         _obj._fromJSON((com.sybase.afx.json.JsonObject)_json);
         return _obj;
     }
 }
Пример #13
0
 /// <summary>
 /// Find a List of YPF.Comercial.RRCC.SUP.FormularioMercado
 /// </summary>
 /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
 /// <remarks> </remarks>
 public static Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.FormularioMercado> GetPendingObjects(char pendingChange, int skip, int take)
 {
         skip = skip + 1;
     Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.FormularioMercado> result_2 = new Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.FormularioMercado>();
     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.\"a\",x.\"b\",x.\"c\",x.\"d\",x.\"e\",x.\"pending\",x.\"_pc\",x.\"_rp\",x.\"_rf\",x.\"interaccionFK\",x.\"f\",x.\"_rc\",x.\"_ds\" from \"crmmobiledesa_1_0_formulariomercado\" x where x.\"_pc\" = ?";
         _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.SetChar(_conn.GetConnectionProfile(), ps_3, "pendingChange", pendingChange);
         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.FormularioMercado entity_6 = new YPF.Comercial.RRCC.SUP.FormularioMercado();
             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; 
   
 }
Пример #14
0
 /// <summary>
 /// Find a mobile business object YPF.Comercial.RRCC.SUP.FormularioMercado
 /// </summary>
 /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception>
 /// <remarks> </remarks>
 public static YPF.Comercial.RRCC.SUP.FormularioMercado GetFormularioMercado_for_Interaccion(long? surrogateKey)
 {
     YPF.Comercial.RRCC.SUP.FormularioMercado 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.\"a\",x.\"b\",x.\"c\",x.\"d\",x.\"e\",x.\"pending\",x.\"_pc\",x.\"_rp\",x.\"_rf\",x.\"interaccionFK\",x.\"f\",x.\"_rc\",x.\"_ds\" from \"crmmobiledesa_1_0_formulariomercado\" x where (((x.\"pending\" = 1 or not exists (select x_os.\"f\" from \"crmmobiledesa_1_0_formulariomercado_os\" x_os where"
                                 + " x_os.\"f\" = x.\"f\")))) and ( x.\"interaccionFK\"=?)";
         System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL);
         com.sybase.afx.db.CommandUtil.SetNullableLong(_conn.GetConnectionProfile(), ps_3, "surrogateKey", surrogateKey);
         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.FormularioMercado entity_6 = new YPF.Comercial.RRCC.SUP.FormularioMercado();
             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; 
   
 }