예제 #1
0
        public ActionResult Add([FromBody] Movie[] NMovie)
        {
            try
            {
                var grado = 7;
                var path  = Path.Combine(Environment.CurrentDirectory, "arbol.txt");
                if (!ArbolB <Movie> .ExisteArbol())
                {
                    string text = $"{grado.ToString("0000;-0000")}|0000|0001|";
                    System.IO.File.WriteAllText(path, text);
                }

                var PtS = new MovieToSring(Movie.MovieToString);
                var StP = new StringToMovie(Movie.StringToMovie);
                for (int i = 0; i < NMovie.Length; i++)
                {
                    ArbolB <Movie> .InsertarArbol(NMovie[i], StP, PtS);
                }
                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
예제 #2
0
        public List <Movie> Get(string traversal)
        {
            var grado = 7;
            var path  = Path.Combine(Environment.CurrentDirectory, "arbol.txt");

            if (!ArbolB <Movie> .ExisteArbol())
            {
                string text = $"{grado.ToString("0000;-0000")}|0000|0001|";
                System.IO.File.WriteAllText(path, text);
            }
            var StP = new StringToMovie(Movie.StringToMovie);

            return(ArbolB <Movie> .Recorrido(null));
        }