コード例 #1
0
        public void RequestCourse()
        {
            CourseManagementService cms    = new CourseManagementService();
            Result <CourseRequest>  result = cms.RequestCourse("*****@*****.**", "Advanced Stat");

            Console.WriteLine(result.message);
        }
コード例 #2
0
        public void GetOfferedCourses()
        {
            CourseManagementService cms    = new CourseManagementService();
            Result <List <Course> > result = cms.GetOfferedCourses();

            Console.WriteLine(result.message);
        }
コード例 #3
0
        public void GetAllCoursesRequestCount()
        {
            CourseManagementService cms = new CourseManagementService();
            Result <List <CourseRequestCountView> > result = cms.GetAllCoursesRequestCount();

            Console.WriteLine(result.message);
        }
コード例 #4
0
        public void GetAllCoursesRatings()
        {
            CourseManagementService           cms    = new CourseManagementService();
            Result <List <CourseRatingView> > result = cms.GetAllCoursesInfo();

            Console.WriteLine(result.message);
        }
コード例 #5
0
        public void GetOfferedCourses(string tutorUsername)
        {
            CourseManagementService cms = new CourseManagementService();
            String userName             = "******";
            Result <List <SessionsListView> > result = cms.GetOfferedCoursesByTutor(userName);

            Console.WriteLine(result.message);
        }
コード例 #6
0
        public void GetCourseRequestCount()
        {
            CourseManagementService cms = new CourseManagementService();
            String       Name           = "Statistical Methods";
            Result <int> result         = cms.GetCourseRequestCount(Name);

            Console.WriteLine(result.message);
        }
コード例 #7
0
        public void GetCourseRating()
        {
            CourseManagementService cms = new CourseManagementService();
            int             ID          = 113;
            Result <double> result;

            result = cms.GetCourseRating(ID);
            Console.WriteLine(result.message);
        }
コード例 #8
0
        public void AddNewCourse()
        {
            CourseManagementService cms = new CourseManagementService();
            Course crs = new Course();

            crs.CourseName = "Database II";
            Result <Course> result = cms.AddNewCourse(crs);

            Console.WriteLine(result.message);
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsLoggedIn)
            {
                if (!IsPostBack)
                {
                    dpcSessionsCalendar.StartDate = DateTime.Today;
                    dpcSessionsCalendar.Days      = 7;


                    ICourseManagementService crsems        = new CourseManagementService();
                    Result <List <Course> >  serviceResult = null;
                    serviceResult = crsems.GetOfferedCourses();
                    /*To display list of courses in dropdown menu*/
                    if (serviceResult.isSuccess)
                    {
                        /*Data Source: Collection list*/
                        ddlCourses.DataSource     = serviceResult.resultObject;
                        ddlCourses.DataValueField = "ID";
                        ddlCourses.DataTextField  = "CourseName";
                        ddlCourses.DataBind();
                        ddlCourses.SelectedIndex = -1;
                    }


                    if (Request.Params.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(Request.Params["sid"]))
                        {
                            LoadSession(int.Parse(Request.Params["sid"]));
                        }
                        else if (!string.IsNullOrEmpty(Request.Params["c"]))
                        {
                            if (!string.IsNullOrEmpty(Request.Params["mxs"]))
                            {
                                if (!string.IsNullOrEmpty(Request.Params["d"]))
                                {
                                    ddlCourses.SelectedValue = Request.Params["c"];
                                    ddlCourses.Enabled       = false;
                                    txtDate.Text             = Request.Params["d"];
                                    txtDate.Enabled          = false;
                                    txtMaxNumber.Text        = Request.Params["mxs"];

                                    if (DateTime.Parse(txtDate.Text).CompareTo(DateTime.Now) < 0)
                                    {
                                        UrlUtility.Redirect(WebsitePages.Tutor.SESSION_MANAGEMENT);
                                    }
                                }
                            }
                        }
                    }
                    LoadSessions();
                }
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsLoggedIn)
            {
                if (!IsPostBack)
                {
                    /*Take data from result object (BL)*/
                    gvSearchResults.DataSource = null;
                    /* Combine the data I give you with the screen in its correct place */
                    gvSearchResults.DataBind();

                    anpTopPaging.AlwaysShow  = anpBottomPaging.AlwaysShow = true;
                    gvSearchResults.PageSize = anpTopPaging.PageSize = anpBottomPaging.PageSize = BL.Common.Models.Constants.DEFAULT_RESULTS_PAGE_SIZE;

                    ceRequestedSessionDate.StartDate = DateTime.Today.AddDays(BL.Common.Models.Constants.MIN_NUM_DAYS_REQUEST_SESSION);

                    //Get parameters from URL named 'q'
                    string query;
                    query = Request.QueryString.Get("q");
                    if (!string.IsNullOrEmpty(query))
                    {
                        txtSearchQuery.Text = query;

                        //Apply the logic of search
                        Search(query);
                    }

                    //Load all request statuses from backend
                    Result <List <string> > result = sms.GetAllPossibleStatuses();
                    if (result.isSuccess)
                    {
                        ddlStatus.DataSource = result.resultObject;
                        ddlStatus.DataBind();
                    }
                }

                ICourseManagementService crsems        = new CourseManagementService();
                Result <List <Course> >  serviceResult = null;
                serviceResult = crsems.GetOfferedCourses();
                /*To display list of courses in dropdown menu*/
                if (serviceResult.isSuccess)
                {
                    /*Data Source: Collection list*/
                    ddlCourses.DataSource     = serviceResult.resultObject;
                    ddlCourses.DataValueField = "ID";
                    ddlCourses.DataTextField  = "CourseName";
                    ddlCourses.DataBind();
                    ddlCourses.SelectedIndex = -1;
                }
            }
        }
コード例 #11
0
 protected void btnMakeRequest_Click(object sender, EventArgs e)
 {
     if (IsLoggedIn)
     {
         ICourseManagementService cms = new CourseManagementService();
         Result <CourseRequest>   result;
         result = cms.RequestCourse(CurrentUser.Email, txtCourseName.Text);
         if (result.isSuccess)
         {
             txtCourseName.Text = string.Empty;
         }
         ShowMessage(result.message);
     }
 }
コード例 #12
0
        protected void lbDelete_Click(object sender, EventArgs e)
        {
            if (IsLoggedIn)
            {
                HiddenField rowHfCourseName = (sender as LinkButton).NamingContainer.FindControl("hdnCourseName") as HiddenField;

                if (rowHfCourseName != null)
                {
                    ICourseManagementService cms = new CourseManagementService();

                    Result <object> result = cms.DeleteCourseRequests(rowHfCourseName.Value);
                    ShowMessage(result.message);
                    LoadPendingRequests();
                }
            }
        }