<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EFAdventure;

namespace MVCAdventure.Controllers
{
    public class ProveedorController : Controller
    {
        // GET: Proveedor
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetProveedores()
        {
            List<Person> ListaProveedores;
            AdventureWorks2014Entities contexto = new AdventureWorks2014Entities();

            var proveedores = (from prov in contexto.SalesPerson
                               join per in contexto.Person on prov.BusinessEntityID equals per.BusinessEntityID into lista
                               from ListaProv in lista
                               select ListaProv);

            ListaProveedores = proveedores.ToList();
            contexto.Dispose();

            return View("Proveedor", ListaProveedores);
        }

        public ActionResult GetProductos()
        {

            return PartialView("_Productos");
        }
    }
}<commit_msg>Añadida acción GetProductos al controlador de proveedores<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EFAdventure;

namespace MVCAdventure.Controllers
{
    public class ProveedorController : Controller
    {
        // GET: Proveedor
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetProveedores()
        {
            List<Person> ListaProveedores;
            AdventureWorks2014Entities contexto = new AdventureWorks2014Entities();

            var proveedores = (from prov in contexto.SalesPerson
                               join per in contexto.Person on prov.BusinessEntityID equals per.BusinessEntityID into lista
                               from ListaProv in lista
                               select ListaProv);

            ListaProveedores = proveedores.ToList();
            contexto.Dispose();

            return View("Proveedor", ListaProveedores);
        }

        public ActionResult GetProductos(int provID)
        {
            List<Product> ListaProductos = new List<Product>();
            List<int> ListaID = new List<int>();
            AdventureWorks2014Entities contexto = new AdventureWorks2014Entities();

            var LHeader = (from OrderHeader in contexto.SalesOrderHeader
                           where OrderHeader.SalesPersonID == provID
                           join OrderDetail in contexto.SalesOrderDetail on OrderHeader.SalesOrderID equals OrderDetail.SalesOrderID into lista
                           from listaproductos in lista
                           select listaproductos.ProductID).Distinct();

            ListaID = LHeader.ToList();
            foreach(int id in ListaID)
            {
                var producto = (from product in contexto.Product
                                 where product.ProductID == id
                                 select product).First();
                ListaProductos.Add(producto);
            }

            contexto.Dispose();
            ViewBag.ID = provID;

            return PartialView("_Productos", ListaProductos);
        }
    }
}
{'fraction_non_alphanumeric': 0.06579745300181929, 'fraction_numerical': 0.0072771376591873865, 'mean_word_length': 1.7746005046257358, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3512824', 'n_tokens_mistral': 856, 'n_tokens_neox': 816, 'n_words': 200}