I have a fairly large CRUD winform app that is set up to display forms embedded in tabcontrols. I want to have objects for Person,(has a) Enrollment,(has a) Plan that hold and track the information as they interact with the forms. How do I accomplish this? I found a suggestion to declare the Person object in my Program.cs like so -->
internal static class Program
{
public static CurrentPerson _CurrentPerson;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmWWCShell());
}
}
and then on the Search.cs -->
Program._CurrentPerson = new CurrentPerson
{
PersonID = Convert.ToInt32(pID),
LastName = lName,
FirstName = fName,
SocialSn = sSN,
MiddleName = mName,
BirthDate = Convert.ToDateTime(bDate)
};
Is this the best way? There is still a bunch of Data that needs to be filled in from the database once they have made this selection on the Search page. What about declaring the object on each form and passing it some way? The object is slowly "built" as they progress. First they Search for someone by name and select who they will work with. Then they can work with there Enrollments. After selecting an Enrollment they will be able to interact with there Plans.
I would be grateful for any guidance here as the scope of this has left my inexperienced head spinning...