Beispiel #1
0
        //public JsonResult GetGroups(string term)
        //{
        //    if (string.IsNullOrEmpty(term))
        //    {
        //        return Json(this.themes.Select(x => x.Name), JsonRequestBehavior.AllowGet);
        //    }
        //    else
        //    {
        //        return Json(this.themes.Where(x => x.Name.IndexOf(term, StringComparison.OrdinalIgnoreCase) >= 0).Select(x => x.Name), JsonRequestBehavior.AllowGet);
        //    }
        //}

        public ActionResult DropDownSelect(int organisation, int subOrganisation, int application)
        {
            ConfigureVM configureVM = new ConfigureVM();
            TrendAnalysisThemeRepository trendRepository           = new TrendAnalysisThemeRepository();
            OrganisationRepository       organisationRepository    = new OrganisationRepository();
            SubOrganisationRepository    subOrganisationRepository = new SubOrganisationRepository();
            ApplicationRepository        applicationRepository     = new ApplicationRepository();
            ThemeRepository themeRepository = new ThemeRepository();

            configureVM.Organisations = new List <Organisation>()
            {
                new Organisation()
                {
                    Name = ""
                }
            };
            configureVM.Organisations.AddRange(organisationRepository.Get());
            configureVM.SubOrganisations = new List <SubOrganisation>()
            {
                new SubOrganisation()
                {
                    Name = ""
                }
            };
            configureVM.SubOrganisations.AddRange(subOrganisationRepository.Get());
            configureVM.Applications = new List <Application>()
            {
                new Application()
                {
                    Name = ""
                }
            };
            configureVM.Applications.AddRange(applicationRepository.Get());

            configureVM.Themes = themeRepository.DropDownSelect(organisation, subOrganisation, application);

            return(View("Configure", configureVM));
        }
        //public JsonResult GetGroups(string term)
        //{
        //    if (string.IsNullOrEmpty(term))
        //    {
        //        return Json(this.themes.Select(x => x.Name), JsonRequestBehavior.AllowGet);
        //    }
        //    else
        //    {
        //        return Json(this.themes.Where(x => x.Name.IndexOf(term, StringComparison.OrdinalIgnoreCase) >= 0).Select(x => x.Name), JsonRequestBehavior.AllowGet);
        //    }
        //}

        public ActionResult DropDownSelect(int organisation, int subOrganisation, int application)
        {
            NewPhrasesVM              newPhrasesVM              = new NewPhrasesVM();
            OrganisationRepository    organisationRepository    = new OrganisationRepository();
            SubOrganisationRepository subOrganisationRepository = new SubOrganisationRepository();
            ApplicationRepository     applicationRepository     = new ApplicationRepository();
            ThemeRepository           themeRepository           = new ThemeRepository();
            NewPhraseRepository       newPhraseRepository       = new NewPhraseRepository();

            newPhrasesVM.Organisations = new List <Organisation>()
            {
                new Organisation()
                {
                    Name = ""
                }
            };
            newPhrasesVM.Organisations.AddRange(organisationRepository.Get());
            newPhrasesVM.SubOrganisations = new List <SubOrganisation>()
            {
                new SubOrganisation()
                {
                    Name = ""
                }
            };
            newPhrasesVM.SubOrganisations.AddRange(subOrganisationRepository.Get());
            newPhrasesVM.Applications = new List <Application>()
            {
                new Application()
                {
                    Name = ""
                }
            };
            newPhrasesVM.Applications.AddRange(applicationRepository.Get());
            newPhrasesVM.Themes     = themeRepository.DropDownSelect(organisation, subOrganisation, application);
            newPhrasesVM.NewPhrases = newPhraseRepository.Get();

            return(View("NewPhrases", newPhrasesVM));
        }
Beispiel #3
0
        //private List<Theme> themes = new List<Theme> { new Theme() { ID = 1, Name = "XBox"
        //        , Groups = new List<Group> { new Group() { ID = 1, Name = "Fifa"
        //            , Phrases = new List<Phrase> { new Phrase() { ID = 1, Name = "SQL13892" }
        //            , new Phrase() { ID = 2, Name = "SQL53473" }}}
        //        , new Group { ID = 2, Name = "Tekken"
        //            , Phrases = new List<Phrase> { new Phrase() { ID = 3, Name = "DotNet48392" }
        //            , new Phrase() { ID = 4, Name = "SQL53473" }}}}}
        //    , new Theme() { ID = 2, Name = "Surface"
        //        , Groups = new List<Group> { new Group() { ID = 3, Name = "Pro"
        //            , Phrases = new List<Phrase> { new Phrase() { ID = 5, Name = "SQL13892" }
        //            , new Phrase() { ID = 6, Name = "DotNet48392" }}}
        //        , new Group { ID = 4, Name = "Book"
        //            , Phrases = new List<Phrase> { new Phrase() { ID = 7, Name = "SQL13892" }
        //            , new Phrase() { ID = 8, Name = "SQL53473" }}}}}
        //    , new Theme(){ID = 3, Name = "Windows", Groups = new List<Group>() } };

        // GET: Configure
        public ActionResult Configure()
        {
            ConfigureVM               configureVM               = new ConfigureVM();
            OrganisationRepository    organisationRepository    = new OrganisationRepository();
            SubOrganisationRepository subOrganisationRepository = new SubOrganisationRepository();
            ApplicationRepository     applicationRepository     = new ApplicationRepository();
            ThemeRepository           themeRepository           = new ThemeRepository();

            configureVM.Organisations = new List <Organisation>()
            {
                new Organisation()
                {
                    Name = ""
                }
            };
            configureVM.Organisations.AddRange(organisationRepository.Get());
            configureVM.SubOrganisations = new List <SubOrganisation>()
            {
                new SubOrganisation()
                {
                    Name = ""
                }
            };
            configureVM.SubOrganisations.AddRange(subOrganisationRepository.Get());
            configureVM.Applications = new List <Application>()
            {
                new Application()
                {
                    Name = ""
                }
            };
            configureVM.Applications.AddRange(applicationRepository.Get());

            configureVM.Themes = themeRepository.DropDownSelect(0, 0, 0);

            return(View(configureVM));
        }