public bool AfiliarEstudianteAcurso(AfiliateStudentCourseEntity estudiantecurso) { EstudianteCursoBL estudianteCursoBL = new EstudianteCursoBL(); CourseBL courseBL = new CourseBL(); UserBL userbl = new UserBL(); CourseEntity courseEntity = courseBL.GetCourse(estudiantecurso.nombrecurso, estudiantecurso.areacurso); UserEntity user = userbl.GetUser(estudiantecurso.nombreusuario, estudiantecurso.documento); return(estudianteCursoBL.AfiliarEstudianteacurso(user, courseEntity)); }
public bool RealizarPago(MakePaymentEntity payment) { CourseBL courseBL = new CourseBL(); UserBL userbl = new UserBL(); CourseEntity courseEntity = courseBL.GetCourse(payment.nombrecurso, payment.areacurso); UserEntity user = userbl.GetUser(payment.nombreusuario, payment.documento); return(courseBL.RealizarPago(user, courseEntity)); }
public bool HacerCita(MakeAppointmentEntity appointmentEntity) { bool pago = false; EstudianteCursoBL estudianteCursoBL = new EstudianteCursoBL(); CourseBL courseBL = new CourseBL(); UserBL userbl = new UserBL(); CourseEntity courseEntity = courseBL.GetCourse(appointmentEntity.nombrecurso, appointmentEntity.areacurso); UserEntity user = userbl.GetUser(appointmentEntity.nombreusuario, appointmentEntity.documento); pago = courseBL.VerificaPago(user, courseEntity); if (pago == true) { return(estudianteCursoBL.HacerCita(user, courseEntity, appointmentEntity.fechadeappointment)); } return(false); }
public ResultExamStudentEntity CalificateQuestions(List <QuestionEntity> questions, string curso, string area, string nombreusuario, string documento) { List <QuestionEntity> questionsInDB = new List <QuestionEntity>(); QuestionBL questionBL = new QuestionBL(); int totalPregunta = questions.Count; int totalcorrecto = 0; double totalcorrectasporexamen = 0; ResultExamStudentEntity resultExam = new ResultExamStudentEntity(); resultExam.questionsStudent = questions; ResponseBL responseBL = new ResponseBL(); foreach (QuestionEntity que in questions) { ResponseEntity response = new ResponseEntity(); QuestionEntity question = new QuestionEntity(); question = questionBL.Getstudentquestions(curso, area, que.descripcionPregunta); response = responseBL.GetCorrectResponseFromQuestion(question); question.respuestaDBCorrecta = response; if (question.respuestaDBCorrecta.DescripcionRespuesta == que.RespuestaUsuario.DescripcionRespuesta) { totalcorrecto++; } questionsInDB.Add(question); } resultExam.QuestionDB = questionsInDB; totalcorrectasporexamen = (totalcorrecto * 5) / totalPregunta; resultExam.puntaje = totalcorrectasporexamen; UserBL userbl = new UserBL(); CourseBL courseBL = new CourseBL(); UserEntity user = userbl.GetUser(nombreusuario, documento); CourseEntity course = courseBL.GetCourse(curso, area); EstudianteCursoBL estudianteCursoBL = new EstudianteCursoBL(); estudianteCursoBL.GuardarCalificacion(user, course, totalcorrectasporexamen); return(resultExam); }
public CourseEntity GetCourse(string username, string area) { CourseBL courseBL = new CourseBL(); return(courseBL.GetCourse(username, area)); }