private bool PopulateData(int plantId) { Guards.ArgumentGuard(plantId); try { ProgressReports = Progress.FindAllForPlant(plantId); _plant = Plant.Find(plantId); PlantName = $"Progress Report For {_plant.Name}"; Schedule schedule = Schedule.Find(_plant.ScheduleId); ScheduleName = schedule.Name; WeekScheduleModel model = new WeekScheduleModel(_plant.ScheduleId, SelectedProgressReport.WeekNum); NameAndDose = model.NameAndDose; return(ProgressReports.Any()); } catch (Exception) { return(false); } }
public ProgressReportsViewModel(int plantId) { Guards.ArgumentGuard(plantId); PopulateData(plantId); DoneCommand = new Command(ClosePage, CanClosePage); SelectedProgressReport = ProgressReports?.FirstOrDefault(); }
private void ClosePage(object obj) { Guards.ArgumentGuard(obj); NavigationEvents.RequestPage(Pages.Back); }