public void SincronizarDeudaClientes(GenericList <DireccionEntrega> clientes, bool async) { GenericList <ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR> arrZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR = new GenericList <ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR>(); foreach (DireccionEntrega cliente in clientes) { if (cliente.CuentaLPO != null && cliente.CuentaLPO.Trim().Length > 0) { ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR cuentaLP0 = new ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR(); cuentaLP0.KUNNR = cliente.CuentaLPO; arrZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR.Add(cuentaLP0); } } if (arrZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR.Size() > 0) { PersonalizationParameters _customParams = App.CurrentSUPContext.GetPersonalizationParameters(); _customParams.ZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNRKey = arrZARFIAR_RFC_DEUDASCLIENTES_IM_KUNNR; _customParams.Save(); if (async) { GenericList <ISynchronizationGroup> syncGroups = new GenericList <ISynchronizationGroup>(); syncGroups.Add(CRMMobileDesaDB.GetSynchronizationGroup("Deuda")); App.CurrentSUPContext.SyncAsync(syncGroups, "", "Deuda de clientes"); } else { App.CurrentSUPContext.Sync(DEUDAS_CLIENTES, "Deuda de clientes"); } } }
private void configureFechaSincronizacion() { _customParams = App.CurrentSUPContext.GetPersonalizationParameters(); DateTime lastMonth = DateTime.Today.AddMonths(-1); _customParams.FECHA_SINCRONIZACIONKey = lastMonth; _customParams.Save(); }
public void SincronizarClientes(string codigoRepresentanteComercial) { configureFechaSincronizacion(); ZCRM_CONSULTA_CLI_INTERLOCUTORES codigoRRCC = new ZCRM_CONSULTA_CLI_INTERLOCUTORES(); codigoRRCC.NOM_USER_RRCC = codigoRepresentanteComercial.Trim(); GenericList <ZCRM_CONSULTA_CLI_INTERLOCUTORES> arrZCRM_CONSULTA_CLI_INTERLOCUTORES = new GenericList <ZCRM_CONSULTA_CLI_INTERLOCUTORES>(); arrZCRM_CONSULTA_CLI_INTERLOCUTORES.Add(codigoRRCC); PersonalizationParameters customParams = App.CurrentSUPContext.GetPersonalizationParameters(); customParams.ZCRM_CONSULTA_CLI_INTERLOCUTORESKey = arrZCRM_CONSULTA_CLI_INTERLOCUTORES; customParams.Save(); App.CurrentSUPContext.Sync(CLIENTES, "Clientes"); }