Exemple #1
0
 public ProgressReportsViewModel(int plantId)
 {
     Guards.ArgumentGuard(plantId);
     PopulateData(plantId);
     DoneCommand            = new Command(ClosePage, CanClosePage);
     SelectedProgressReport = ProgressReports?.FirstOrDefault();
 }
Exemple #2
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);
            }
        }
        private void flowManager_ProgressReport(object sender, EventArgs e)
        {
            ProgressReport d = sender as ProgressReport;

            ProgressReports.Add(d);
        }