//-------------------Request Access---------------------------------
 public bool requestAdminPrivileges(bool didUserRequestAccess)
 {
     if (HttpContext.Session.GetString("username") != null)
     {
         adminControls.adminFunctions adminfunction = new adminControls.adminFunctions();
         return(adminfunction.requestAdminPrivileges(didUserRequestAccess, HttpContext.Session.GetString("username"), HttpContext.Session.GetString("password")));
     }
     else
     {
         return(false);
     }
 }
        public IActionResult Reports()
        {
            //Get testing report if signed in
            List <RetrieveUsersReportModel> retrieveuserreportModel = new List <RetrieveUsersReportModel>();

            if (HttpContext.Session.GetString("username") != null)
            {
                adminControls.adminFunctions admincontrols = new adminControls.adminFunctions();
                retrieveuserreportModel = admincontrols.retrieveUsersReport(HttpContext.Session.GetString("username"));
                return(View(retrieveuserreportModel));
            }
            else
            {
                return(View(retrieveuserreportModel));
            }
        }
        public IActionResult Admin()
        {
            //Return admin privileges
            AdminModel adminmodel = new AdminModel();

            adminControls.adminFunctions admincontrols = new adminControls.adminFunctions();
            if (HttpContext.Session.GetString("username") != null)
            {
                string username = HttpContext.Session.GetString("username");
                string password = HttpContext.Session.GetString("password");
                adminmodel = admincontrols.populateAdminModel(username, password);
            }
            else
            {
                adminmodel.doesUserHaveAdminPrivileges   = false;
                adminmodel.didUserRequestAdminPrivileges = false;
            }


            return(View(adminmodel));
        }
 //------------------Get users report-------------------------
 public List <RetrieveUsersReportModel> retreieveUsersReport(string username)
 {
     adminControls.adminFunctions adminfunctions = new adminControls.adminFunctions();
     return(adminfunctions.retrieveUsersReport(username));
 }
 //------------------Assign courses to users-------------------------
 public bool assignCoursesToUsers(assignCourseModel[] assigncoursemodel)
 {
     adminControls.adminFunctions adminfunctions = new adminControls.adminFunctions();
     return(adminfunctions.assignCourses(assigncoursemodel, HttpContext.Session.GetString("firstname"), HttpContext.Session.GetString("lastname")));
 }
 //--------------------Submit a new course---------------------------
 public bool submitNewCourse(createACourseModel[] createcoursemodel)
 {
     adminControls.adminFunctions adminfunctions = new adminControls.adminFunctions();
     return(adminfunctions.submitNewCourse(createcoursemodel));
 }