Esempio n. 1
0
        protected void EnrollBtn_Command(object sender, CommandEventArgs e)
        {
            try
            {
                var sessionId = e.CommandArgument as string;

                var session = SessionService.GetSessionById(SessionVariable.Current.Company.Id, sessionId);

                if (session.Course.CourseType == CourseTypeEnum.External)
                {
                    Response.Redirect("Request?ssid=" + sessionId + "&csid=" + courseId);
                }


                if (session.Cost != null & session.Cost > 0)
                {
                    Response.Redirect("Payment?ssid=" + sessionId + "&csid=" + courseId);
                }
                else
                {
                    EnrolService.EnrollUser(SessionVariable.Current.User.Id, sessionId);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }

            Response.Redirect(Request.RawUrl);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            enrollmentId = Request.QueryString["enid"];

            if (!IsPostBack)
            {
                var enrollment = EnrolService.GetEnrollment(enrollmentId);

                if (enrollment != null)
                {
                    logger.Debug("lesson data count: " + enrollment.ScormData.Count);

                    CourseName.Text = enrollment.Session.Course.Name;
                    CourseDesc.Text = enrollment.Session.Course.Description;

                    SessionName.Text = enrollment.Session.Name;
                    SessionDesc.Text = enrollment.Session.Description;

                    EnrollStatus.Text = enrollment.EnrollStatus.ToString();
                    EnrollResult.Text = enrollment.Result.ToString();

                    if (enrollment.IsActiveEnrollment())
                    {
                        WithdrawBtn.Visible = true;
                    }

                    LessonRepeater.DataSource = enrollment.ScormData.OrderBy(x => x.Lesson.Order).ToList();
                    LessonRepeater.DataBind();
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ActiveNotifications.DataSource = NotificationService.LoadActiveNotifications(SessionVariable.Current.Company.Id)
                                                 .OrderByDescending(x => x.StartDate).ToList();
                ActiveNotifications.DataBind();

                var activeCourses = EnrolService.LoadActiveEnrollments(SessionVariable.Current.User.Id).OrderBy(x => x.Session.Course.Name);
                ActiveCourses.DataSource = activeCourses;
                ActiveCourses.DataBind();

                if (activeCourses.Count() == 0)
                {
                    Panel1.Visible = false;
                }


                Panel2.Visible = false;


                var newCourses = SessionService.LoadNewSessions(SessionVariable.Current.Company.Id, SessionVariable.Current.User.UserType).OrderBy(x => x.Course.Name);
                NewCourses.DataSource = newCourses;
                NewCourses.DataBind();

                if (newCourses.Count() == 0)
                {
                    Panel3.Visible = false;
                }
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GradeRepeater.DataSource = EnrolService.LoadFinishedCourses(SessionVariable.Current.User.Id);
            GradeRepeater.DataBind();

            CertificateRepeater.DataSource = UserService.LoadUserCertificates(SessionVariable.Current.User.Id);
            CertificateRepeater.DataBind();
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            enrollmentId = Request.QueryString["enid"];

            if (!IsPostBack)
            {
                var enrollment = EnrolService.GetEnrollment(enrollmentId);

                if (enrollment != null)
                {
                    LessonRepeater.DataSource = enrollment.ScormData.OrderBy(x => x.Lesson.Order);
                    LessonRepeater.DataBind();
                }
            }
        }
Esempio n. 6
0
        protected void PayBtn_Click(object sender, EventArgs e)
        {
            EnrolService.Test();
            try
            {
                logger.Info("user: {0}, session: {1}, enrol: {2}", SessionVariable.Current.User.Id, sessionId, EnrolService);

                EnrolService.ChargeSession(SessionVariable.Current.User.Id, sessionId, CardNumber.Text, ExpireYear.SelectedValue, ExpireMonth.SelectedValue, Cvv2.Text);
            }
            catch (PaymentException pex)
            {
                CustomValidator1.IsValid      = false;
                CustomValidator1.ErrorMessage = pex.Message;
                CustomValidator1.Visible      = true;
                return;
            }

            Response.Redirect("Details?csid=" + courseId);
        }