Exemplo n.º 1
0
        public bool Eliminar()
        {
            if (id == null)
            {
                return(false);
            }

            return(Ejecutor.Eliminar(TABLA, $"Id = {this.id}")); // Eliminar el registro de la base
        }
Exemplo n.º 2
0
        public bool Eliminar(bool quitar = false)
        {
            if (id == null)
            {
                return(false);
            }

            if (quitar)
            {
                return(Ejecutor.Eliminar(TABLA, $"Id = {this.id}")); // Eliminar el registro de la base
            }
            else
            {
                return(Ejecutor.Actualizar(TABLA, new Dictionary <string, object>()
                {
                    { "estado", false }
                }, $"Id = {this.id}"));                                                                                          // Cambiar estado a false
            }
        }
Exemplo n.º 3
0
        public bool Eliminar(bool quitar = false)
        {
            if (id == null)
            {
                return(false);
            }

            if (this.ObtenerTodo().Count == 1)
            {
                return(false);                               // Porque no se puede quedar sin ningún usuario
            }
            if (quitar)
            {
                return(Ejecutor.Eliminar(TABLA, $"Id = {this.id}")); // Eliminar el registro de la base
            }
            else
            {
                return(Ejecutor.Actualizar(TABLA, new Dictionary <string, object>()
                {
                    { "estado", false }
                }, $"Id = {this.id}"));                                                                                         // Cambiar estado a false
            }
        }