Example #1
0
        public async Task <IActionResult> ClassRoom(int id = 0)
        {
            CreateBreadCrumb(new[] { new { Name = "Home", ActionUrl = "#" },
                                     new { Name = "Classroom", ActionUrl = "/Classroom/Classroom" } });

            BaseViewModel VModel = null;

            var TempVModel = new ClassRoomDetailsVM();

            TempVModel.Id          = id;
            TempVModel.ApprootPath = GetBaseService().GetAppRootPath();
            //set class ref id and remove tempdata if exist
            var tempLoginUser = GetLoginUserInfo();

            if (tempLoginUser != null)
            {
                TempVModel.TempClassRefId = tempLoginUser.UserID;
            }

            string TempTeacherKey = string.Format("{0}_{1}", TempVModel.TempClassRefId, "ClassTeacher");

            if (TempData.ContainsKey(TempTeacherKey))
            {
                TempData.Remove(TempTeacherKey);
            }

            TempTeacherKey = string.Format("{0}_{1}", TempVModel.TempClassRefId, "ClassStudent");
            if (TempData.ContainsKey(TempTeacherKey))
            {
                TempData.Remove(TempTeacherKey);
            }
            //end of class ref id and remove tempdata if exist
            ////get value from service layer
            await _ClassroomService.GetClassroomVM(TempVModel);

            // end of service lyer

            VModel = await GetViewModel(TempVModel);

            return(View(VModel));
        }