26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
53 lines
1.8 KiB
C#
Executable File
53 lines
1.8 KiB
C#
Executable File
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using DataModel.Process;
|
|
using WebInterface.Helpers;
|
|
|
|
namespace WebInterface.Controllers
|
|
{
|
|
/// <summary>
|
|
/// DB lookup API controller
|
|
/// </summary>
|
|
public class LookupController : Controller
|
|
{
|
|
// GET: Lookup/FindItem?itemNumber
|
|
public JsonNetResult FindItem(string itemNumber)
|
|
{
|
|
return new JsonNetResult()
|
|
{
|
|
Data = LotFinderDB.SearchItems(itemNumber).OrderBy(i => i.ItemNumber).Select(i => i.ToViewModel()),
|
|
JsonRequestBehavior = JsonRequestBehavior.AllowGet
|
|
};
|
|
}
|
|
|
|
// GET: Lookup/FindProfitCenter?profitCenter
|
|
public JsonNetResult FindProfitCenter(string profitCenter)
|
|
{
|
|
return new JsonNetResult()
|
|
{
|
|
Data = LotFinderDB.SearchProfitCenters(profitCenter).OrderBy(pc => pc.Code).Select(pc => pc.ToViewModel()),
|
|
JsonRequestBehavior = JsonRequestBehavior.AllowGet
|
|
};
|
|
}
|
|
|
|
// GET: Lookup/FindWorkCenter?workCenter
|
|
public JsonNetResult FindWorkCenter(string workCenter)
|
|
{
|
|
return new JsonNetResult()
|
|
{
|
|
Data = LotFinderDB.SearchWorkCenters(workCenter).OrderBy(wc => wc.Code).Select(wc => wc.ToViewModel()),
|
|
JsonRequestBehavior = JsonRequestBehavior.AllowGet
|
|
};
|
|
}
|
|
|
|
// GET: Lookup/FindOperator?operatorName
|
|
public JsonNetResult FindOperator(string operatorName)
|
|
{
|
|
return new JsonNetResult()
|
|
{
|
|
Data = LotFinderDB.SearchUsers(operatorName).OrderBy(o => o.FullName).Select(o => o.ToViewModel()),
|
|
JsonRequestBehavior = JsonRequestBehavior.AllowGet
|
|
};
|
|
}
|
|
}
|
|
} |