//[ChildActionOnly]
        public async Task<ActionResult> Index(guides model)
        {
            //these are the course guides

            var courseGuides = await Task.Run(() => _guideRepository.GetCourseGuides());

            model.GuideList = courseGuides.Select(m => new SelectListItem()
            {

                Text = m.CourseCode,
                Value = m.GuidesId.ToString()

            });

            //we are going to try to add our specialization guides below our course guides. 
            var specGuides = await Task.Run(() => _guideRepository.GetSpecTitleList());

            model.SpecList = specGuides.Select(m => new SelectListItem()
            {
                Text = m.GuideTitle,
                Value = m.DeptGuideId.ToString()

            });

            return PartialView("guidesdropdown", model);

        }
        public ActionResult GetCGuide(guides model, int GuideId = 0)
        {
            string myId = model.GuidesId.ToString();
            var guideId = int.Parse(myId);

            if (GuideId != 0)
            {

                var thisMyGuide = _guideRepository.GetGuideTabs(GuideId);

                return View(thisMyGuide);

            }
            else
            {

                if (model.HeaderId != null)
                {
                    ViewBag.headerId = model.HeaderId;
                }

                var getMyGuide = _guideRepository.GetGuideTabs(guideId);
                return View(getMyGuide);

            }

        }
        public ActionResult GetGuide(guides model)
        {
            int id = model.DeptGuideId;

            ViewData["getCounts"] = _guideRepository.GetCount(id);

            return View(_guideRepository.GetSpecPage(id));

        }
        public ActionResult SpecList(guides model)
        {

            var specGuides = _guideRepository.GetSpecTitleList();

            model.SpecList = specGuides.Select(m => new SelectListItem()
            {
                Text = m.GuideTitle,
                Value = m.DeptGuideId.ToString()

            });

            return View("_specguides", model);
        }
       public ActionResult TabList()
        {
            
            guides MyTabList = new guides();
            
            var getTabList = _guideRepository.GetTabs();

            MyTabList.TabList = getTabList.Select(c => new SelectListItem()

                {
                    Text = c.TabName,
                    Value = c.TabId.ToString()

                });

            return PartialView("TabList", MyTabList);
        }
        public ActionResult DeleteHeader(guides _objItems)
        {
            int? id = _objItems.HeaderId;

            var deleteHeader = _guideRepository.DeleteHeader((int)id);

            if ((bool)deleteHeader == false)
            {
                string error = "#RemoveRemainingResourcesFromHeader";

                return Redirect("/guide/specguide/" + _objItems.DeptDiscpId + error);
            }
            string success = "#HeaderSuccessfullyRemoved";

            return Redirect("/guide/specguide/" + _objItems.DeptDiscpId + success);

        }
        public ActionResult UpdateHeader(guides _obItems)
        {
            var updateHeader = _guideRepository.UpdateHeader(_obItems);

            if ((bool)updateHeader == true)
            {
                return Redirect("/guide/specguide/" + _obItems.DeptDiscpId + "#HeaderUpdated");
            }
            else
            {
                return Redirect("/guide/specguide/" + _obItems.DeptDiscpId + "#Failure");
            }

        }
        public ActionResult UpdateResource(guides _objItems)
        {
            var updateResource = _guideRepository.EditResource(_objItems);

            return Redirect("/guide/specguide/" + _objItems.DeptDiscpId + "#UpdateSuccessful");
        }
        public ActionResult PostResourcePage(guides _objItems)
        {
            int? specId = _objItems.DeptDiscpId;

            var postResourcePage = _guideRepository.AddResource(_objItems);

            if ((bool)postResourcePage == true)
            {
                return Redirect("/guide/specguide/" + specId + "#ResourceAdded");
            }
            else
            {
                return Redirect("/guide/specguide/" + specId + "#Resourcefailed");
            }
        }
        public ActionResult PostHeaderPage(guides _objItems)
        {
            var postHeader = _guideRepository.AddHeader(_objItems);
            int id = _objItems.DeptGuideId;


            if ((bool)postHeader == true)
            {
                return Redirect("/guide/specguide/" + id + "#HeaderAdded");
            }

            return Redirect("/guide/specguide/" + id + "#HeaderFailure");
        }
        public ActionResult HeaderDropDown()
        {
            var getHeaderDropDown = _guideRepository.GetHeaderDropDown();

            guides _dropDown = new guides();

            _dropDown.HeaderList = getHeaderDropDown.Select(m => new SelectListItem()
            {
                Text = m.SectionName,
                Value = m.SectionName
            });

            return PartialView(_dropDown);
        }
        public ActionResult AddSpec(guides _objDropDown)
        {
            var addSpec = _guideRepository.AddSpec(_objDropDown);

            if ((bool)addSpec == true)
            {
                return Redirect("/guide/SpecAdminArea" + "#Added");
            }
            return Redirect("/guide/SpecAdminArea" + "#ErrorOccurred");
        }
        public ActionResult GetSpecList(int? id)
        {
            int specId = Convert.ToInt32(id);

            var getSpecList = _guideRepository.GetSpecListDropDown(specId);
            ViewBag.Id = id;

            guides _dropDown = new guides();

            _dropDown.SpecList = getSpecList.Select(m => new SelectListItem()
            {
                Text = m.SectionName,
                Value = m.SectionName

            });
            return PartialView(_dropDown);
        }