/// <summary> /// Renders the view to display the view that allows the user to create a resident record /// </summary> public void GetAddResident() { ViewContext.Dispose(); ViewResidentView view = new ViewResidentView(); ViewContext.ActiveForm = view; ViewContext.ActiveForm.ShowDialog(); }
/// <summary> /// Displays a specific resident, the view allows the fields to be edited, including the status /// </summary> public void GetViewResident(int residentId) { ViewContext.Dispose(); Resident resident = dbEnt.Resident.Residents().Where(m => m.ResidentId == residentId).FirstOrDefault(); if (resident != null) { ViewResidentView view = new ViewResidentView(); view.Resident = resident; ViewContext.ActiveForm = view; ViewContext.ActiveForm.ShowDialog(); } else { MessageBox.Show("Resident cannot be found", "View Resident", MessageBoxButtons.OK, MessageBoxIcon.Error); new ResidentPresenter().GetDisplayResidents(); } }