protected void CreateEnrollmentDialog_OkButtonClicked(object sender, EventArgs e)
 {
     _newUserEnrollment = new UserEnrollment();
     _newUserEnrollment.SKU = SKUDropDownList.SelectedValue.ToString();
     _newUserEnrollment.CourseID = Convert.ToInt32(CourseDropDownList.SelectedValue.ToString());
     OnEnrollmentCreated(EventArgs.Empty);
 }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //ImFinishedButton.Click += new EventHandler(ImFinishedButton_Click);
        if (!IsPostBack)
        {
            //this.BindPage();
            
        }

        this.BindPage();

        /* Show appropriate image according to user workbook status */
        if (WorkbookCompleted(WorkbookId))
        {
            WorkbookStatusDiv.Attributes.Add("class", "classProgressIcon item48 tasks48complete");
            WorkbookStatusTitleDiv.Attributes.Add("class", "classProgressIcon item48 tasks48complete");
            divCompleteStatus.Style.Add("Display", "block");
            divIncompleteStatus.Style.Add("Display", "none");
            //ImFinishedButton.Text = "I'll Finish Later";
        }
        else
        {
            WorkbookStatusDiv.Attributes.Add("class", "classProgressIcon item48 tasks48");
            WorkbookStatusTitleDiv.Attributes.Add("class", "classProgressIcon item48 tasks48");
            divIncompleteStatus.Style.Add("Display", "block");
            divCompleteStatus.Style.Add("Display", "none");
            //ImFinishedButton.Text = "I'm Finished";
        }

        /* Binding Class & course info */
        if (this.ClassID > 0)
        {

            // get the class
            _selectedClass = ClassroomController.GetClass(this.ClassID);

            // get the course
            //_selectedCourse = ClassroomController.GetCourse(_selectedClass.CourseId);
            _selectedCourse = CourseInfo.GetCourse(_selectedClass.CourseId);

            // get sku of user enrollment for course
            Monaco.ELearning.Entities.UserEnrollment u = new Monaco.ELearning.Entities.UserEnrollment();
            u = (Monaco.ELearning.Entities.UserEnrollment)ClassroomController.GetUserEnrollmentByCourse(_selectedClass.CourseId, this.UserId)[0]; ;
            _courseSku = u.SKU;


            DataBind();

        }


        ///* Assignin navigate url to go back to class detail */
        //if (SelectedWorkbook != null)
        //    lnkBack.NavigateUrl = "~/Classroom/Class.aspx?id=" + SelectedWorkbook.ClassID;
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.BindPage();

            ViewState["ClassID"] = _entity.ClassId.ToString();

            /* Show appropriate image according to user audio status */
            if (AudioCompleted(AudioId))
            {
                AudioStatusDiv.Attributes.Add("class", "classProgressIcon item48 audio48complete");
                //FinishedListeningButton.Text = "I'll Finish Later";
            }
            else
            {
                AudioStatusDiv.Attributes.Add("class", "classProgressIcon item48 audio48");
                //FinishedListeningButton.Text = "I'm Finished Listening";
            }

            /* Binding Class & course info */
            if (this.ClassID > 0)
            {

                // get the class
                _selectedClass = ClassroomController.GetClass(this.ClassID);

                // get the course
                //_selectedCourse = ClassroomController.GetCourse(_selectedClass.CourseId);
                _selectedCourse = CourseInfo.GetCourse(_selectedClass.CourseId);

                // get sku of user enrollment for course
                Monaco.ELearning.Entities.UserEnrollment u = new Monaco.ELearning.Entities.UserEnrollment();
                u = (Monaco.ELearning.Entities.UserEnrollment)ClassroomController.GetUserEnrollmentByCourse(_selectedClass.CourseId, this.UserId)[0]; ;
                _courseSku = u.SKU;


                DataBind();

            }

        }
        /* Assignin navigate url to go back to class detail */
        if (SelectedAudio != null)
            lnkBack.NavigateUrl = "~/Classroom/Class.aspx?id=" + SelectedAudio.ClassId;
    }
예제 #4
0
        public static UserEnrollment ToUserEnrollment(this DataRow dr)
        {
            UserEnrollment u = new UserEnrollment();
            u.UserID = dr.GetGuid("UserID");
            u.SKU = dr.GetString("SKU");
            u.TrialPeriod = dr.GetInt("TrialPeriod");
            u.InitialPrice = dr.GetDouble("InitialPrice");
            //u.SubscriptionDuration = dr.GetInt("SubscriptionDuration");
            u.SubscriptionDuration = dr.GetNullableInt("SubscriptionDuration");
            u.LockedOut = dr.GetBoolean("LockedOut");
            u.LockedOutReason = dr.GetString("LockedOutReason");
            u.LastUpdatedBy = dr.GetString("LastUpdatedBy");
            u.CourseID = dr.GetInt("CourseID");
            u.EnrollmentStartDate = dr.GetDate("EnrollmentDate");
            //u.AvailableDuration = dr.GetInt("AvailableDuration");
            u.AvailableDuration = dr.GetNullableInt("AvailableDuration");
            DateTime dt = u.EnrollmentStartDate;
            u.AvailableUntill = dt.AddMonths(Convert.ToInt32(u.AvailableDuration));
            u.PricePerMonth = dr.GetDouble("RecurringPrice");
            u.LastEditDate = dr.GetDate("LastEditDate");
            u.CreationDate = dr.GetDate("CreationDate");
            u.CreditCardNo = dr.GetString("CreditCardNo");
            u.IsFree = dr.GetBoolean("IsFree");
            u.IsTest = dr.GetBoolean("IsTest");


            try
            {
                System.Web.Security.MembershipUser mu = System.Web.Security.Membership.GetUser(u.User.ProviderUserKey);
                if (mu != null)
                {
                    u.Email = mu.Email.ToString();
                }
            }
            catch
            {
                u.Email = "";
            }


            return u;

        }
예제 #5
0
 protected void DeleteEnrollmentButton_Click(object sender, EventArgs e)
 {
     Monaco.ELearning.Entities.UserEnrollment enrollment = new Monaco.ELearning.Entities.UserEnrollment();
     ClassroomController.DeleteUserEnrollmentByCourse(UserId, CourseId); 
     if(!string.IsNullOrEmpty(Request.QueryString["retto"]))
     {
         /* Return back to CourseStudent.aspx  */
         Response.Redirect("~/Admin/Classroom/CourseStudents.aspx?CourseID=" + CourseId);
         
     }
     else
     {
         /* Return back to UserDetails.aspx  */
         Response.Redirect("~/Admin/UserDetails.aspx?user="******"user"]) && !string.IsNullOrEmpty(Request.QueryString["sku"]))
     //{
     //    enrollment.DeleteEnrollment(Request.QueryString["user"].ToString(), Request.QueryString["sku"].ToString());
     //    Response.Redirect("~/Admin/UserDetails.aspx?Tab=4&user="******"user"].ToString());
     //}
         
 }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
         
        //acrdnClass.ItemDataBound += new EventHandler<AjaxControlToolkit.AccordionItemEventArgs>(acrdnClass_ItemDataBound);

        if (!IsPostBack)
        {
            if (this.ClassID > 0)
            {

                // get the class
                _selectedClass = ClassroomController.GetClass(this.ClassID);

                // get the course
                //_selectedCourse = ClassroomController.GetCourse(_selectedClass.CourseId);
                _selectedCourse = CourseInfo.GetCourse(_selectedClass.CourseId);

                // get sku of user enrollment for course
                Monaco.ELearning.Entities.UserEnrollment u = new Monaco.ELearning.Entities.UserEnrollment();
                u = (Monaco.ELearning.Entities.UserEnrollment)ClassroomController.GetUserEnrollmentByCourse(_selectedClass.CourseId, this.UserId)[0]; ;
                _courseSku = u.SKU;


                DataBind();
                 
            }
        }
    }