2022-08-02 19:32:39 +02:00
|
|
|
|
using RMDataManagerLibrary.DataAcccess;
|
|
|
|
|
using RMDataManagerLibrary.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Web.Http;
|
|
|
|
|
|
|
|
|
|
namespace RMDataManager.Controllers
|
|
|
|
|
{
|
2022-08-06 16:21:52 +02:00
|
|
|
|
|
2022-08-02 19:32:39 +02:00
|
|
|
|
public class InventoryController : ApiController
|
|
|
|
|
{
|
2022-08-06 16:21:52 +02:00
|
|
|
|
[Authorize(Roles = "Admin,Manager")]
|
2022-08-02 19:32:39 +02:00
|
|
|
|
public List<InventoryModel> Get()
|
|
|
|
|
{
|
|
|
|
|
InventoryData data = new InventoryData();
|
|
|
|
|
return data.GetInventory();
|
|
|
|
|
}
|
2022-08-06 16:21:52 +02:00
|
|
|
|
[Authorize(Roles = "Admin")]
|
2022-08-02 19:32:39 +02:00
|
|
|
|
public void Post(InventoryModel item)
|
|
|
|
|
{
|
|
|
|
|
InventoryData data = new InventoryData();
|
|
|
|
|
data.SaveInventoryRecord(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|