public FileUpload GetById(long uploadedFileId) { return(uploadRepository.GetById(uploadedFileId)); }
public SelfEvaluation Get(Observed observed, int contextoAno) { var selfEvaluation = _selfEvaluationRepository.Get(observed, contextoAno); if (selfEvaluation == null) { return(null); } /*if (selfEvaluation == null && contextoAno == Convert.ToInt32(DateTime.Now.Year.ToString())) * { * selfEvaluation = _selfEvaluationRepository.GenerateByYear(observed, contextoAno); * } * else if (selfEvaluation == null && contextoAno != Convert.ToInt32(DateTime.Now.Year.ToString())) * { * return null; * }*/ selfEvaluation.DegreeImage = _selfFileUploadRepository.GetById(selfEvaluation.DegreeImageId); // Question1 var coursesQ1 = _selfEvaluationRepository.GetCourseParticipated(new int[] { 2, 3, 4 }, observed, contextoAno); foreach (var c in coursesQ1) { c.Classes = _selfEvaluationRepository.GetClassesParticipatedByCourseId(int.Parse(c.Id), observed, contextoAno); } var ctjEventsQ1 = new CTJEvents(); ctjEventsQ1.Courses = coursesQ1; selfEvaluation.Question1 = ctjEventsQ1; // Question2 var coursesQ2 = _selfEvaluationRepository.GetCourseParticipated(new int[] { 5, 6 }, observed, contextoAno); foreach (var c in coursesQ2) { c.Classes = _selfEvaluationRepository.GetClassesParticipatedByCourseId(int.Parse(c.Id), observed, contextoAno); } var ctjEventsQ2 = new CTJEvents(); ctjEventsQ2.Courses = coursesQ2; selfEvaluation.Question2 = ctjEventsQ2; // Question2A var coursesQ2A = _selfEvaluationRepository.GetCourseParticipated(new int[] { 7 }, observed, contextoAno); foreach (var c in coursesQ2A) { c.Classes = _selfEvaluationRepository.GetClassesParticipatedByCourseId(int.Parse(c.Id), observed, contextoAno); } var ctjEventsQ2A = new CTJEvents(); ctjEventsQ2A.Courses = coursesQ2A; selfEvaluation.Question2A = ctjEventsQ2A; selfEvaluation.ProfessionalDevelopments = _selfEvaluationRepository.GetProfessionalDevelopmentByAnoAndChapa(observed, contextoAno); foreach (var item in selfEvaluation.ProfessionalDevelopments) { item.Imagem = _selfFileUploadRepository.GetById(item.ImagemId); } selfEvaluation.DigitalLiteracies = _selfEvaluationRepository.GetDigitalLiteracyByAnoAndChapa(observed, contextoAno); selfEvaluation.ProjectActivities = _selfEvaluationRepository.GetProjectActivityByAnoAndChapa(observed, contextoAno); selfEvaluation.DegreeComplete = 0; var person = _selfEmployeeRepository.GetPersonByChapa(observed.ObservedId); List <string> options = new List <string>(new string[] { "9", "A", "B", "C", "D", "E", "F", "G", "H" }); foreach (var item in options) { if (person.GrauInstrucao.ToUpper() == item.ToUpper()) { selfEvaluation.DegreeComplete = 1; selfEvaluation.Degree = 1; break; } } return(selfEvaluation); }