/// <summary> /// Retrieves Get Total Rows of Inventory /// </summary> /// <returns>Int32 type object</returns> public Int32 GetRowCount() { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.GetRowCount()); } }
/// <summary> /// Retrieve list of Inventory by PageRequest. /// <param name="request"></param> /// </summary> /// <returns>List of Inventory</returns> public InventoryList GetPaged(PagedRequest request) { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.GetPaged(request)); } }
/// <summary> /// Retrieve list of Inventory by query String. /// <param name="query"></param> /// </summary> /// <returns>List of Inventory</returns> public InventoryList GetByQuery(String query) { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.GetByQuery(query)); } }
/// <summary> /// Retrieve list of Inventory. /// no parameters required to be passed in. /// </summary> /// <returns>List of Inventory</returns> public InventoryList GetAll() { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.GetAll()); } }
/// <summary> /// Retrieve Inventory data using unique ID /// </summary> /// <param name="_Id"></param> /// <returns>Inventory Object</returns> public Inventory Get(Int32 _Id) { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.Get(_Id)); } }
public RentalTransactionScript(IConfiguration configuration) { inventoryDataAccess = new InventoryDataAccess(configuration); rentalDataAccess = new RentalDataAccess(configuration); movieDataAccess = new MovieDataAccess(configuration); userDataAccess = new UserDataAccess(configuration); }
/// <summary> /// Delete operation for Inventory /// <param name="_Id"></param> /// <returns></returns> private bool Delete(Int32 _Id) { using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { // return if code > 0 return(data.Delete(_Id) > 0); } }
/// <summary> /// Retrieve list of Inventory. /// </summary> /// <param name="fillChild"></param> /// <returns>List of Inventory</returns> public InventoryList GetAll(bool fillChild) { InventoryList inventoryList = new InventoryList(); using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { inventoryList = data.GetAll(); } if (fillChild) { foreach (Inventory inventoryObject in inventoryList) { FillInventoryWithChilds(inventoryObject, fillChild); } } return(inventoryList); }
/// <summary> /// Update base of Inventory Object. /// Data manipulation processing for: new, deleted, updated Inventory /// </summary> /// <param name="inventoryObject"></param> /// <returns></returns> public bool UpdateBase(Inventory inventoryObject) { // use of switch for different types of DML switch (inventoryObject.RowState) { // insert new rows case BaseBusinessEntity.RowStateEnum.NewRow: return(Insert(inventoryObject)); // delete rows case BaseBusinessEntity.RowStateEnum.DeletedRow: return(Delete(inventoryObject.Id)); } // update rows using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { return(data.Update(inventoryObject) > 0); } }
/// <summary> /// Insert new inventory. /// data manipulation for insertion of Inventory /// </summary> /// <param name="inventoryObject"></param> /// <returns></returns> private bool Insert(Inventory inventoryObject) { // new inventory using (InventoryDataAccess data = new InventoryDataAccess(ClientContext)) { // insert to inventoryObject Int32 _Id = data.Insert(inventoryObject); // if successful, process if (_Id > 0) { inventoryObject.Id = _Id; return(true); } else { return(false); } } }
public SaleTransactionScript(IConfiguration configuration) { inventoryDataAccess = new InventoryDataAccess(configuration); saleDataAccess = new SaleDataAccess(configuration); movieDataAccess = new MovieDataAccess(configuration); }
public void Post([FromBody] InventoryModel item) { var inventoryData = new InventoryDataAccess(); inventoryData.SaveInventoryRecord(item); }
public List <InventoryModel> Get() { var inventoryData = new InventoryDataAccess(); return(inventoryData.GetInventory()); }