Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 public ProgressReportsViewModel(int plantId)
 {
     Guards.ArgumentGuard(plantId);
     PopulateData(plantId);
     DoneCommand            = new Command(ClosePage, CanClosePage);
     SelectedProgressReport = ProgressReports?.FirstOrDefault();
 }
Exemplo n.º 3
0
        private void ClosePage(object obj)
        {
            Guards.ArgumentGuard(obj);

            NavigationEvents.RequestPage(Pages.Back);
        }