Help me out with the problem

Hi, I have written a return method in dataset method for an enum which returns true or false. Now when i add an item in PurchReqLine of EP and if my enum is ticked for that particular item, the unit price field in EP shoud be editable. So how do i call the dataset method in C# and where.