Example #1
0
        public void GetStudentSessions()
        {
            ISessionManagementService sessionManagementService = new SessionManagementService();
            Result <List <StudentSessionsListView> > result    = sessionManagementService.GetStudentSessions("*****@*****.**");

            Console.WriteLine(result.message);
        }
Example #2
0
        public void GetStudentActiveSessions()
        {
            ISessionManagementService sessionManagementService = new SessionManagementService();
            Result <List <StudentSessionsListView> > result    = sessionManagementService.GetStudentSessions("*****@*****.**", CommonEnums.SessionStatus.Active);

            Console.WriteLine(result.message);
        }
Example #3
0
        private void LoadSessions()
        {
            //LoadResources();
            List <SessionCalendarSlot>     aSessions = new List <SessionCalendarSlot>();
            List <StudentSessionsListView> sessions  = sms.GetStudentSessions(CurrentUser.Email, SessionStatus.All).resultObject;

            SessionCalendarSlot[] activeSessions;
            if (sessions != null)
            {
                aSessions.AddRange(
                    sessions.Select(s => new SessionCalendarSlot()
                {
                    /* If you get an error, user .Value to work (Safe casting) */
                    ID             = s.SessionID.Value,
                    CourseName     = s.CourseName,
                    StartTime      = s.StartDateTime,
                    EndTime        = s.EndDateTime,
                    TutorName      = s.TutorName,
                    Rating         = s.TutorRating,
                    Status         = s.Status,
                    MaxStudents    = s.MaxStudents.Value,
                    RemainingSeats = s.RegisteredStudents.Value
                }));


                activeSessions = aSessions.ToArray();
                //DayPilotCalendar1.StartDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                dpcStudentCalendar.Days = 7; //DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month); // Display week, .Day=28 for month
                                             /* The data this calnder will display will come from activeSessions*/
                dpcStudentCalendar.DataSource = activeSessions;

                /* Combine the data I gave you with the screen */
                dpcStudentCalendar.DataBind();
            }
        }
Example #4
0
        private void LoadData()
        {
            SessionStatus sessionStatus;

            switch (ddlSessionsStatus.SelectedValue)
            {
            case "Completed":
                sessionStatus = SessionStatus.Completed;
                break;

            case "In_Progress":
                sessionStatus = SessionStatus.In_Progress;
                break;

            case "Cancelled":
                sessionStatus = SessionStatus.Canceled;
                break;

            case "Active":
                sessionStatus = SessionStatus.Active;
                break;

            default:
                sessionStatus = SessionStatus.All;
                break;
            }

            //Here we implement the search logic
            ISessionManagementService ums = new SessionManagementService();

            Result <List <StudentSessionsListView> > result = ums.GetStudentSessions(CurrentUser.Email, sessionStatus, anpTopPaging.CurrentPageIndex - 1, anpTopPaging.PageSize, GridSortColumnName, GridViewSortDirection, Filters);;

            if (result.isSuccess)
            {
                /*Take data from result object (BL)*/
                gvSearchResults.DataSource = result.resultObject;
                /* set number of total rows for Paginator*/
                anpTopPaging.RecordCount = anpBottomPaging.RecordCount = result.totalNumOfRecords;
                /* Combine the data I give you with the screen in its correct place */
                gvSearchResults.DataBind();

                divSearchResults.Visible = true;
                //divNotFound.Visible = false;
            }
            else
            {
                /*Take data from result object (BL)*/
                gvSearchResults.DataSource = null;
                /* Combine the data I give you with the screen in its correct place */
                gvSearchResults.DataBind();

                divSearchResults.Visible = false;
                //divNotFound.Visible = true;
            }
            //upSearchDiv.Update();
        }