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 bool BuildSchedule(int schedNum, int weekNum) { WeekScheduleModel model = new WeekScheduleModel(schedNum, weekNum); Name = model.Name; NameAndDose = model.NameAndDose; return(!string.IsNullOrEmpty(Name)); }
private bool UpdateData() { try { WeekScheduleModel model = new WeekScheduleModel(_plant.ScheduleId, SelectedProgressReport.WeekNum); NameAndDose = model.NameAndDose; return(true); } catch (Exception) { return(false); } }
private void Setup(int id) { /*NOTES * For the cycles, if the date is in the future, use projected, change color * if the date is in the past, use the actual times, standard color. */ if (id < 1) { Plant = new Plant(); } Plant = Core.Plant.Find(id); Schedule schedule = Schedule.Find(Plant.ScheduleId); ScheduleName = schedule.Name; WeekScheduleModel model = new WeekScheduleModel(Plant.ScheduleId, Plant.Week); NameAndDose = model.NameAndDose; }