Exemplo n.º 1
0
 //-------------------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);
     }
 }
Exemplo n.º 2
0
        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));
            }
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 //------------------Get users report-------------------------
 public List <RetrieveUsersReportModel> retreieveUsersReport(string username)
 {
     adminControls.adminFunctions adminfunctions = new adminControls.adminFunctions();
     return(adminfunctions.retrieveUsersReport(username));
 }
Exemplo n.º 5
0
 //------------------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")));
 }
Exemplo n.º 6
0
 //--------------------Submit a new course---------------------------
 public bool submitNewCourse(createACourseModel[] createcoursemodel)
 {
     adminControls.adminFunctions adminfunctions = new adminControls.adminFunctions();
     return(adminfunctions.submitNewCourse(createcoursemodel));
 }