OK, here is what I have done so far. I am hoping that someone will let me know if I am on the right track or not.
I have a table named Household and therefore NetTiers generated my service layer called HouseholdService. What I am doing is allowing the user to define what data he/she wants and then they press a [Find] button. Once the [Find] button is pressed I instantiate the approprate service (HouseholdService) and within the overrideable section of the HouseholdService I have the following code:
private
TList<Household> _HouseholdList;
public TList<Household> HouseholdList
{
get { return _HouseholdList; }
set { _HouseholdList = value; }
}
public void GetPagedList (String SqlWhereClause, String SqlFieldName, Int32 _RowStart, Int32 _BatchSize, out Int32 _RecordsFound)
{
_HouseholdList = this.GetPaged(SqlWhereClause, SqlFieldName, _RowStart, _BatchSize, out _RecordsFound);
}
So essentially I am storing the data that the datagridview and HouseholdEditControl can share. Then in my main application I have the following code when the user presses [Find]:
HouseholdService HouseholdService; // this is in variable initialization
// this is in [Find] button code:
if (HouseholdService == null) { HouseholdService = new HouseholdService(); }
HouseholdService.GetPagedList(SqlWhereClause, SqlFieldName, _RowStart, _BatchSize, out _RecordsFound);
grdData.DataSource = HouseholdService.HouseholdList;
Then when the user signifies they want to update the record I have the following code in the HouseholdService overrideable section:
Int32 iIndex = _HouseholdList.FindIndex(delegate(Household HouseholdEntity) { return HouseholdEntity.HouseholdId == entity.HouseholdId; });
_HouseholdList[iIndex] = entity;
return base.Update(entity);
Can someone PLEASE respond and let me know if this is even close to being correct? I am developing the framework and really do NOT want to go back and make a bunch of changes if this is not how things should be done. Keep in mind I am new to Visual Studio and NETTIERS.