private void LoadFromModel(Incident model) { AcademicYearId = model.AcademicYearId; BehaviourTypeId = model.BehaviourTypeId; StudentId = model.StudentId; LocationId = model.LocationId; CreatedById = model.CreatedById; OutcomeId = model.OutcomeId; StatusId = model.StatusId; CreatedDate = model.CreatedDate; Comments = model.Comments; Points = model.Points; Deleted = model.Deleted; if (model.Type != null) { Type = new IncidentTypeModel(model.Type); } if (model.Location != null) { Location = new LocationModel(model.Location); } if (model.AcademicYear != null) { AcademicYear = new AcademicYearModel(model.AcademicYear); } if (model.CreatedBy != null) { CreatedBy = new UserModel(model.CreatedBy); } if (model.Student != null) { Student = new StudentModel(model.Student); } if (model.Outcome != null) { Outcome = new BehaviourOutcomeModel(model.Outcome); } if (model.Status != null) { Status = new BehaviourStatusModel(model.Status); } }
private void LoadFromModel(ReportCard model) { StudentId = model.StudentId; BehaviourTypeId = model.BehaviourTypeId; StartDate = model.StartDate; EndDate = model.EndDate; Comments = model.Comments; Active = model.Active; if (model.Student != null) { Student = new StudentModel(model.Student); } if (model.BehaviourType != null) { BehaviourType = new IncidentTypeModel(model.BehaviourType); } }