27 lines
1.2 KiB
C#
27 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace CPRNIMS.WebApps.ViewComponents.POMgmt
|
|
{
|
|
public class ShippingInstructionsViewComponent : ViewComponent
|
|
{
|
|
public IViewComponentResult Invoke(int shippingInstructionId)
|
|
{
|
|
// Set the correct view path based on the shippingInstructionId
|
|
string viewName = shippingInstructionId switch
|
|
{
|
|
1 => "~/Views/Components/POMgmt/ShippingInstructions/Air.cshtml",
|
|
2 => "~/Views/Components/POMgmt/ShippingInstructions/Courier.cshtml",
|
|
3 => "~/Views/Components/POMgmt/ShippingInstructions/SeaFCL.cshtml",
|
|
4 => "~/Views/Components/POMgmt/ShippingInstructions/SeaLCL.cshtml",
|
|
5 => "~/Views/Components/POMgmt/ShippingInstructions/RawMatAir.cshtml",
|
|
6 => "~/Views/Components/POMgmt/ShippingInstructions/RawMatCourier.cshtml",
|
|
7 => "~/Views/Components/POMgmt/ShippingInstructions/RawMatSeaFCL.cshtml",
|
|
_ => "~/Views/Components/POMgmt/ShippingInstructions/RawMatSeaLCL.cshtml"
|
|
};
|
|
|
|
// Render the selected view
|
|
return View(viewName);
|
|
}
|
|
}
|
|
}
|