I have multiple Table that has these fields
"ChoiceCodeID" (int), "NodeID" (int) and "AllowDelete" (bit).
I need to write a function that returns the "AllowDelete" value from the Table i pass.
How do i do this in LLBL.
Following is the way i have been doing for a Table CustomChoice. I am passing the "ChoiceCodeID" and "NodeID" and it returns me the "AllowDelete".
But instead of writting the function for each table i just want to pass the Table,ChoiceCodeID, NodeID and get the same result as follow:
something like GetAllowDelete(EntityBase2 TableName,int PassedCustomChoiceID,int PassedNodeID)....
---------------This is how i get the value from ChoiceCodeTable----
Public static bool GetAllowDelete(int PassedCustomChoiceID,int PassedNodeID)
{
IRelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add(PredicateFactory.CompareValue(CustomChoiceEntityFieldIndex.CustomChoiceID, ComparisonOperator.Equal, PassedCustomChoiceID));
filter.PredicateExpression.Add(PredicateFactory.CompareValue(CustomChoiceEntityFieldIndex.NodeID, ComparisonOperator.Equal, PassedNodeID));
DataAccessAdapter adapter = DataAccess.GetAdapter();
EntityCollection CustomChoiceCollection = new EntityCollection (new CustomChoiceEntityFactory());
adapter.FetchEntityCollection(CustomChoiceCollection,bucket);
adapter.Dispose();
CustomChoiceEntity CustomChoice =new CustomChoiceEntity();
CustomChoice = (CustomChoiceEntity)CustomChoiceCollection[0];
return CustomChoice.AllowDelete;
}
Thank you for your help.