Example #1
0
        public async Task <IActionResult> SchoolTypes()
        {
            var         jwtToken        = HttpContext.Session.GetString("Token");
            SchoolTypes SchoolTypesList = new SchoolTypes();
            var         apiResponse     = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", jwtToken);

            SchoolTypesList = JsonConvert.DeserializeObject <SchoolTypes>(apiResponse);

            return(View(SchoolTypesList));
        }
        public async Task <IActionResult> SchoolTypes()
        {
            SchoolTypes SchoolTypesList = new SchoolTypes();
            var         apiResponse     = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", "");

            SchoolTypesList = JsonConvert.DeserializeObject <SchoolTypes>(apiResponse);

            return(View(SchoolTypesList));
        }
        public async Task <IActionResult> CreateTeacher()
        {
            var jwtToken = HttpContext.Session.GetString("Token");
            //TeacherRoles teacherRoles = new TeacherRoles();
            var apiResponse = await httpClientConfig.ApiGetResponse("Teacher/teacherRoles", jwtToken);

            var res = JObject.Parse(apiResponse);
            TeacherCreateRequestModel request = new TeacherCreateRequestModel();

            request.teacherRole = JsonConvert.DeserializeObject <List <TeacherRoles> >(res["data"].ToString());

            return(View(request));
        }
        public async Task <IActionResult> CreateSchool()
        {
            ViewData["Token"] = HttpContext.Session.GetString("Token");
            var jwtToken = HttpContext.Session.GetString("Token");
            //TeacherRoles teacherRoles = new TeacherRoles();
            var apiResponse = await httpClientConfig.ApiGetResponse("SchoolType/getAllSchoolType", jwtToken);

            var res = JObject.Parse(apiResponse);
            SchoolSignUpRequestModel request = new SchoolSignUpRequestModel();

            request.SchooltypeList = JsonConvert.DeserializeObject <List <SchoolTypeList> >(res["data"].ToString());

            return(View(request));
        }
        public async Task <IActionResult> AddCourseTopic()
        {
            ViewData["UserName"] = HttpContext.Session.GetString("UserName");
            ViewData["Token"]    = HttpContext.Session.GetString("Token");
            var  jwtToken = HttpContext.Session.GetString("Token");
            long courseId = Convert.ToInt64(HttpContext.Request.Query["courseid"]);

            var UserId = HttpContext.Session.GetString("UserId");

            var apiResponse = await httpClientConfig.GetRestResponse("Course/allCourseByFacilitatorId?facilitatorId=" + UserId, jwtToken);

            var response = JsonConvert.DeserializeObject <CreateResponseModel>(apiResponse);

            CourseTopics CourseTopicList = new CourseTopics();
            var          apiResponse1    = await httpClientConfig.ApiGetResponse("CourseTopics/allCourseTopicsByCourseId?courseId=" + courseId, jwtToken);

            CourseTopicList = JsonConvert.DeserializeObject <CourseTopics>(apiResponse1);

            // Send the data to the View Bag
            ViewBag.CourseTopicList = CourseTopicList.Data;

            ViewData["courseid"] = courseId;
            return(View());
        }