Ejemplo n.º 1
0
        public override async Task <Enums.eSyncResult> SaveAndSync(ISUPModel sender)
        {
            InteraccionModel <InteraccionBusiness> interaccion = sender as InteraccionModel <InteraccionBusiness>;

            Enums.eSyncResult syncResult = Enums.eSyncResult.Synchronized;

            LocalTransaction localTransaction = CRMMobileDesaDB.BeginTransaction();

            try
            {
                if (interaccion.Formulario_CodigoSAP != null)
                {
                    // Save formularios
                    guardarFormularios(interaccion);
                    guardarRelevamientos(interaccion);
                }
                // Save this and sync Transacciones
                syncResult = await base.SaveAndSync(sender, new Func <ISUPModel, Task <bool> >(syncTransacciones));

                localTransaction.Commit();
            }
            catch (Exception ex)
            {
                localTransaction.Rollback();
                throw ex;
            }
            return(syncResult);
        }