Retail_manager/RMDataManager/Controllers/InventoryController.cs

29 lines
718 B
C#
Raw Normal View History

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
{
public class InventoryController : ApiController
{
[Authorize(Roles = "Admin,Manager")]
public List<InventoryModel> Get()
{
InventoryData data = new InventoryData();
return data.GetInventory();
}
[Authorize(Roles = "Admin")]
public void Post(InventoryModel item)
{
InventoryData data = new InventoryData();
data.SaveInventoryRecord(item);
}
}
}