Beispiel #1
0
        //CRUD FOR INVENTORY ENTITY
        public DataSet Get_ListInventory(inventoryModel currentInventory)
        {//~~~~~~~~~ READ INVENTORY
            DbCommand get_Inventory = db.GetStoredProcCommand("sp_readInventory");

            db.AddInParameter(get_Inventory, "@itemID", DbType.Int32, currentInventory.inventoryID);

            DataSet ds = db.ExecuteDataSet(get_Inventory);

            return(ds);//RETURNS DATASET TO READ
        }
Beispiel #2
0
        public Boolean Delete_ListInventory(inventoryModel currentEvent)
        {//~~~~~~~~~ DELETE INVENTORY
            Boolean success = false;

            DbCommand Delete_Inventory = db.GetStoredProcCommand("sp_DeleteInventoryItem");

            db.AddInParameter(Delete_Inventory, "@inventoryID", DbType.Int32, currentEvent.inventoryID);

            DataSet ds = db.ExecuteDataSet(Delete_Inventory);

            //RETURNS IF OPERATION WAS A SUCCESS
            success = Convert.ToBoolean(Delete_Inventory.ExecuteNonQuery());


            return(success);
        }
Beispiel #3
0
        public Boolean Update_ListInventory(inventoryModel currentInventory)
        {////~~~~~~~~~ UPDATE INVENTORY
            Boolean success = false;

            DbCommand Update_Inventory = db.GetStoredProcCommand("sp_UpdateInventoryItem");

            db.AddInParameter(Update_Inventory, "@donationIDFK", DbType.Int32, currentInventory.donationIDFK);
            db.AddInParameter(Update_Inventory, "@categoryIDFK", DbType.String, currentInventory.categoryIDFK);
            db.AddInParameter(Update_Inventory, "@inventoryQuantity", DbType.Int32, currentInventory.inventoryQuantity);
            db.AddInParameter(Update_Inventory, "@inventoryDescription", DbType.String, currentInventory.inventoryDescription);

            success = Convert.ToBoolean(Update_Inventory.ExecuteNonQuery());


            return(success);//RETURNS IF OPERATION WAS A SUCCESS
        }