Ejemplo n.º 1
0
        public void Eliminar(TipoIncidente eliminar)
        {
            if (eliminar == null)
            {
                return;
            }

            try {
                eliminar.Eliminar(0);
                if (this.incidentes != null)
                {
                    this.incidentes.Remove(eliminar);
                }
            }
            catch (SinConexionException) {
                OnErrorMsgEliminar(eliminar);
            }
            catch (NoSePuedeEliminarException) {
                this.arg1        = this.arg1 ?? new ErrorMsgArgs( );
                this.arg1.Motivo = "Hay una referencia al incidente.";
                OnErrorMsg(null);
            }
            catch (BloqueoException) {
                this.arg1        = this.arg1 ?? new ErrorMsgArgs( );
                this.arg1.Motivo = "Esta prestablecido.";
                OnErrorMsg(null);
            }
            catch (Exception) {
                throw;
            }
        }
Ejemplo n.º 2
0
        private void OnErrorMsgEliminar(TipoIncidente item)
        {
            if (this.errorMsg == null)
            {
                return;
            }

            this.arg1            = this.arg1 ?? new ErrorMsgArgs( );
            this.arg1.Reintentar = true;

            this.errorMsg.ErrorEnEliminar(this.arg1);
            if (this.arg1.Reintentar)
            {
                var t = new Timer(x => this.Eliminar(item));
                t.Change(TimeSpan.FromSeconds(1), Timeout.InfiniteTimeSpan);
            }
        }
Ejemplo n.º 3
0
        private void OnErrorMsgSinConexion( )
        {
            if (this.errorMsg == null)
            {
                return;
            }

            this.arg1            = this.arg1 ?? new ErrorMsgArgs( );
            this.arg1.Reintentar = true;

            this.errorMsg.ErrorEnActualizar(this.arg1);

            if (this.arg1.Reintentar)
            {
                var t = new Timer(x => this.ActualizarLista( ));
                t.Change(TimeSpan.FromSeconds(1), Timeout.InfiniteTimeSpan);
            }
        }
Ejemplo n.º 4
0
        private void OnErrorMsg(Action m)
        {
            if (this.errorMsg != null)
            {
                this.arg1            = this.arg1 ?? new ErrorMsgArgs( );
                this.arg1.Reintentar = true;

                this.errorMsg.ErrorEnEliminarNoSePuede(this.arg1);
                // this.errorMsg.ErrorHappen (this.arg1);

                //if (!arg1.Reintentar) {
                //    return;
                //}

                //var t = new Timer (x => m ( ));
                //t.Change (TimeSpan.FromSeconds (1), Timeout.InfiniteTimeSpan);
            }
        }