NonInventPurchasingSystem/CPRNIMS.WebApps/ViewComponents/POMgmt/ShippingInstructionsVC.cs
2026-01-20 07:44:30 +08:00

23 lines
834 B
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",
_ => "~/Views/Components/POMgmt/ShippingInstructions/SeaLCL.cshtml"
};
// Render the selected view
return View(viewName);
}
}
}