The reason I am asking this is due to I have a complex query and that needs to be in stored procedure that returns as a collection nicely using es.
Now ... I want to reuse/extend this collection by doing manipulation within that returned collection (sum of one of the column or filtering it).
How do I do that? Is there any example for this? How do iterate each record of this collection? How do I get the returned namefield of the result? Any example?
My custom class:
Code:
Code:
public partial class TndFileConsumptionDetailCollection : esTndFileConsumptionDetailCollection
{
public bool GetScheduleConsumption(int FileConsumptionID, int ScheduleGroupID)
{
esParameters oParameters = new esParameters();
oParameters.Add("FileConsumptionID", FileConsumptionID);
oParameters.Add("ScheduleGroupID", ScheduleGroupID);
return this.Load(esQueryType.StoredProcedure, "tnd_GetScheduleConsumption", oParameters);
}
public bool GetScheduleConsumptionSummary (int FileConsumptionID, int ScheduleGroupID)
{
esParameters oParameters = new esParameters();
oParameters.Add("FileConsumptionID", FileConsumptionID);
oParameters.Add("ScheduleGroupID", ScheduleGroupID);
return this.Load(esQueryType.StoredProcedure, "tnd_GetScheduleConsumptionSummary", oParameters);
}
}
Note:
The returned result from the stored procedure are completely different fieldname from the one define within the class TndFileConsumptionDetail
Code:
TndFileConsumptionDetailCollection fileConsumptionDistributor = new TndFileConsumptionDetailCollection();
fileConsumptionDistributor.GetScheduleConsumption(Convert.ToInt32(ViewState["FileConsumptionID"].ToString()), 1);
foreach( ??? in fileConsumptionDistributor)
{
XXX
}
???: what class entity should I use?
Thanks