I'm already displaying a table in the Index, but I want to display another table from the same controller. I created a PartialView
called PartCorteCabos()
and created a View of it. I tried to make the call using @Html.Partial()
, but it does not display the information coming from the database. How do I display the second table?
Controller
public class DashboardSPMController : Controller
{
DashboardSPMRepository dashRepository = new DashboardSPMRepository();
public ActionResult Index()
{
return View(dashRepository.InfoReceb());
}
public ActionResult PartCorteCabos()
{
return PartialView(dashRepository.InfoCorteCabos());
}
}
PartCorteCabos (Partial View)
@model IEnumerable<WAM.Areas.Monitoramentos.Models.Entities.DashboardSPM>
@Html.Grid(Model).Columns(column =>
{
column.Add(x => x.prioridade_cc).Titled("Prioridade");
column.Add(x => x.sales_order_cc).Titled("SO's");
column.Add(x => x.delivery_cc).Titled("Delivery");
column.Add(x => x.material_cc).Titled("P/N");
})
Index View
@model IEnumerable<WAM.Areas.Monitoramentos.Models.Entities.DashboardSPM>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/Master.cshtml";
}
<div>
<span class="titulo">
<p>Status Recebimento</p>
</span>
<span class="size-tab">
@Html.Grid(Model).Columns(column =>
{
column.Add(x => x.material).Titled("Itens 902");
column.Add(x => x.lead_time).Titled("LT");
column.Add(x => x.lotes_nac).Titled("Lote Nacional");
column.Add(x => x.lotes_imp).Titled("Lote Importado");
column.Add(x => x.sb).Titled("SB's");
column.Add(x => x.danfe).Titled("DANFE's");
})
</span>
</div>
<div>
<span class="titulo">
<p>Corte Cabos</p>
</span>
@Html.Partial("PartCorteCabos")
</div>