Example #1
0
        public ViewResult SearchResource(string searchTerm)
        {
            List <ResourcePresentationInSearch> list = ResourcePresentationInSearchUtility.GetResourcePresentationInSearchList(searchTerm);

            ViewBag.SearchTerm = searchTerm;
            return(View(list));
        }
Example #2
0
        public ActionResult NewLocation(Location location)
        {
            string errorMessage, searchTerm;
            bool   todaysDayIsInFile;

            try
            {
                string locationStr = string.Format("Page{0}Menu{1}Sub{2}Sub{3}Tab{4}", location.Page, location.Menu, location.Sub1, location.Sub2, location.Tab);

                //Start switch non-default locations
                switch (locationStr)
                {
                //## will be replaced by \ in  _LayoutTopLevel.cshtml (does not work if put \\)
                case "Page1Menu0Sub0Sub0Tab1":
                    ViewBag.ListWithThumbUpLocationInfo = ThumbUpLocationInfoUtility.GetLocations(true, out errorMessage);
                    ViewBag.ErrorMessage = errorMessage;
                    return(View("Locations", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##Locations.cshtml")));

                case "Page1Menu0Sub0Sub0Tab2":
                    ViewBag.ListWithThumbUpLocationInfo = ThumbUpLocationInfoUtility.GetLocations(false, out errorMessage);
                    ViewBag.ErrorMessage = errorMessage;
                    return(View("Locations", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##Locations.cshtml")));

                case "Page1Menu0Sub0Sub0Tab3":
                    return(View("HelpSearchResources", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##HelpSearchResources.cshtml")));

                case "Page1Menu0Sub0Sub0Tab4":
                    ViewBag.ListWithKeyWords = KeyWordUtility.GetKeyWords();
                    return(View("AddEditKeyWords", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##AddEditKeyWords.cshtml")));

                case "Page1Menu0Sub0Sub0Tab5":
                    ViewBag.FileNameFullPathToConfigFile = "C:##git_cjonasl##Leander##Solutions##Nr1##WebApplication1##Text##Page1Menu1Sub1Sub1Tab1.txt";
                    ViewBag.ListWithKeyWords             = KeyWordUtility.GetKeyWords();
                    return(View("AdhocCode", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##AdhocCode.cshtml")));

                case "Page1Menu0Sub0Sub0Tab7":
                    return(View("Links", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##Links.cshtml")));

                case "Page1Menu1Sub1Sub2Tab2":
                    ViewBag.FileNameFullPathToConfigFile = "C:##git_cjonasl##Leander##Solutions##Nr1##WebApplication1##Text##Page1Menu1Sub1Sub2Tab1.txt";
                    return(View("Communication1", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##Communication1.cshtml")));

                case "Page1Menu2Sub1Sub1Tab1":
                    ViewBag.WorkFolder = "C:##git_cjonasl##Leander##Work##Fixzone";
                    ViewBag.ListWithDayDateDiaryBytesInDiary = DayDateDiaryBytesInDiaryUtility.ReturnListWithDayDateDiaryBytesInDiary(@"C:\git_cjonasl\Leander\Work\Fixzone", out todaysDayIsInFile, out errorMessage);
                    ViewBag.TodaysDayIsInFile = todaysDayIsInFile;
                    ViewBag.ErrorMessage      = errorMessage;
                    return(View("DayDateDiaryBytesInDiary", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##DayDateDiaryBytesInDiary.cshtml")));

                case "Page1Menu2Sub1Sub1Tab2":
                    searchTerm         = "ka(Task,Fixzone)";
                    ViewBag.List       = ResourcePresentationInSearchUtility.GetResourcePresentationInSearchList(searchTerm);
                    ViewBag.SearchTerm = searchTerm;
                    return(View("ConstantResourceSearch", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##ConstantResourceSearch.cshtml")));

                case "Page1Menu3Sub1Sub1Tab1":
                    searchTerm         = "ka(Thumb up)";
                    ViewBag.List       = ResourcePresentationInSearchUtility.GetResourcePresentationInSearchList(searchTerm);
                    ViewBag.SearchTerm = searchTerm;
                    return(View("ConstantResourceSearch", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##ConstantResourceSearch.cshtml")));

                case "Page1Menu3Sub1Sub1Tab2":
                    searchTerm         = "ka(C#)";
                    ViewBag.List       = ResourcePresentationInSearchUtility.GetResourcePresentationInSearchList(searchTerm);
                    ViewBag.SearchTerm = searchTerm;
                    return(View("ConstantResourceSearch", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##ConstantResourceSearch.cshtml")));

                case "Page3Menu1Sub1Sub1Tab1":
                    return(View("InfoThumbUp", GetDocumentReadyDataForNonDefaultLocation(location, "Views##Main##InfoThumbUp.cshtml")));

                default:
                    return(Json(GetDefaultDataForNewLocation(location), JsonRequestBehavior.AllowGet));
                }
                //End switch non-default locations
            }
            catch (Exception e)
            {
                return(Json(string.Format("ERROR!! An Exception happened! e.Message:\r\n{0}", e.Message), JsonRequestBehavior.AllowGet));
            }
        }