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 #2
0
 internal void _fromJSON(com.sybase.afx.json.JsonObject _json)
 {
     __listClientPK  = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ClientPersonalization>)(YPF.Comercial.RRCC.SUP.ClientPersonalization.FromJSONList(_json.Get("listClientPK")));
     __listSessionPK = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.SessionPersonalization>)(YPF.Comercial.RRCC.SUP.SessionPersonalization.FromJSONList(_json.Get("listSessionPK")));
     __ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNRKey            = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR>)(YPF.Comercial.RRCC.SUP.ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR.FromJSONList(_json.Get("ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNRKey")));
     __ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNRKeyUserDefined = (_json.GetBoolean("ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNRKeyUserDefined"));
     __ZCRM_CONSULTA_CLI_INTERLOCUTORESKey                   = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ZCRM_CONSULTA_CLI_INTERLOCUTORES>)(YPF.Comercial.RRCC.SUP.ZCRM_CONSULTA_CLI_INTERLOCUTORES.FromJSONList(_json.Get("ZCRM_CONSULTA_CLI_INTERLOCUTORESKey")));
     __ZCRM_CONSULTA_CLI_INTERLOCUTORESKeyUserDefined        = (_json.GetBoolean("ZCRM_CONSULTA_CLI_INTERLOCUTORESKeyUserDefined"));
     __ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDADKey            = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDAD>)(YPF.Comercial.RRCC.SUP.ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDAD.FromJSONList(_json.Get("ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDADKey")));
     __ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDADKeyUserDefined = (_json.GetBoolean("ZCRM_ACTRRCC_CONSULTA_INTERLO_ACTIVIDADKeyUserDefined"));
     __FECHA_SINCRONIZACIONKey            = (_json.GetNullableDate("FECHA_SINCRONIZACIONKey"));
     __FECHA_SINCRONIZACIONKeyUserDefined = (_json.GetBoolean("FECHA_SINCRONIZACIONKeyUserDefined"));
     __Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIALKey            = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIAL>)(YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIAL.FromJSONList(_json.Get("Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIALKey")));
     __Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIALKeyUserDefined = (_json.GetBoolean("Z01CRM_RRCC_F_CABPEDIDOS_REPRESENTANTE_COMERCIALKeyUserDefined"));
     __Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOSKey            = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOS>)(YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOS.FromJSONList(_json.Get("Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOSKey")));
     __Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOSKeyUserDefined = (_json.GetBoolean("Z01CRM_RRCC_F_DETPEDIDOS_PEDIDOSKeyUserDefined"));
     __REPRESENTANTE_COMERCIALKey            = (_json.GetNullableString("REPRESENTANTE_COMERCIALKey"));
     __REPRESENTANTE_COMERCIALKeyUserDefined = (_json.GetBoolean("REPRESENTANTE_COMERCIALKeyUserDefined"));
     __Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIALKey            = (Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIAL>)(YPF.Comercial.RRCC.SUP.Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIAL.FromJSONList(_json.Get("Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIALKey")));
     __Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIALKeyUserDefined = (_json.GetBoolean("Z01CRM_RRCC_F_FACTURACION_REPRESENTANTE_COMERCIALKeyUserDefined"));
     __CUITsKey                  = (_json.GetString("CUITsKey"));
     __CUITsKeyUserDefined       = (_json.GetBoolean("CUITsKeyUserDefined"));
     __CUENTAS_SGCKey            = (_json.GetString("CUENTAS_SGCKey"));
     __CUENTAS_SGCKeyUserDefined = (_json.GetBoolean("CUENTAS_SGCKeyUserDefined"));
     __APIESsKey                 = (_json.GetString("APIESsKey"));
     __APIESsKeyUserDefined      = (_json.GetBoolean("APIESsKeyUserDefined"));
     __username                  = (_json.GetString("username"));
     __usernameUserDefined       = (_json.GetBoolean("usernameUserDefined"));
     __password                  = (_json.GetString("password"));
     __passwordUserDefined       = (_json.GetBoolean("passwordUserDefined"));
 }