Beispiel #1
0
 public ActionResult Index()
 {
     return(View(new WordIndexModel()
     {
         WordHeaders = WordDAC.GetAllRelevantWords(ContextManager.Current.SelectedAreaID.Value)
     }));
 }
Beispiel #2
0
 public ActionResult IgnoreWord(String id)
 {
     WordDAC.StoreIrrelevantWord(HttpUtility.UrlDecode(id), ContextManager.Current.SelectedAreaID.Value);
     return(View("Index", new WordIndexModel {
         WordHeaders = WordDAC.GetAllRelevantWords(ContextManager.Current.SelectedAreaID.Value)
     }));
 }
        public ActionResult DeleteRelevantWord(Int32 id)
        {
            Nullable <Int32> informationTypeID = InformationTypeDAC.GetInformationTypeIDByWordID(id);

            WordDAC.DeleteRelevantWord(id);

            if (informationTypeID.HasValue)
            {
                return(Details(informationTypeID.Value));
            }
            else
            {
                return(View("Index"));
            }
        }
Beispiel #4
0
 public ActionResult Search(String searchText, Nullable <bool> showIgnoredWords)
 {
     if (showIgnoredWords.HasValue && (showIgnoredWords.Value == true))
     {
         return(View("WordListControl", new WordIndexModel()
         {
             ShowIgnoredWords = true,
             WordHeaders = WordDAC.GetIgnoredWords(ContextManager.Current.SelectedAreaID.Value, searchText)
         }));
     }
     else
     {
         return(View("WordListControl", new WordIndexModel()
         {
             ShowIgnoredWords = false,
             WordHeaders = WordDAC.GetAllRelevantWords(ContextManager.Current.SelectedAreaID.Value, searchText)
         }));
     }
 }
        public ActionResult SaveDetails(InformationTypeDTO informationType, IList <RelevantWordDTO> RelevantWordList)
        {
            if (ModelState.IsValid)
            {
                informationType.PossibleLimit = informationType.CertainLimit;
                InformationTypeDAC.StoreInformationType(informationType, ContextManager.Current.SelectedAreaID.Value);

                foreach (RelevantWordDTO relevantWord in RelevantWordList)
                {
                    if (!String.IsNullOrEmpty(relevantWord.Word))
                    {
                        WordDAC.StoreRelevantWord(relevantWord);
                    }
                }

                return(Details(informationType.ID.Value));
            }
            else
            {
                return(Details(informationType.ID.Value));
            }
        }
        public ActionResult BlockWord(Int32 id)
        {
            Nullable <Int32> informationTypeID = InformationTypeDAC.GetInformationTypeIDByWordID(id);

            RelevantWordDTO relevantWord = WordDAC.GetRelevantWord(id);

            if (relevantWord != null)
            {
                relevantWord.Weight       = 0;
                relevantWord.CreationType = RelevantWordDTO.CreationTypeEnum.MANUAL;
                WordDAC.StoreRelevantWord(relevantWord);
            }

            if (informationTypeID.HasValue)
            {
                return(Details(informationTypeID.Value));
            }
            else
            {
                return(View("Index"));
            }
        }
        public ActionResult IgnoreWord(Int32 id)
        {
            Nullable <Int32> informationTypeID = InformationTypeDAC.GetInformationTypeIDByWordID(id);

            RelevantWordDTO relevantWord = WordDAC.GetRelevantWord(id);

            if (relevantWord != null)
            {
                WordDAC.StoreIrrelevantWord(relevantWord.Word, ContextManager.Current.SelectedAreaID.Value);
            }

            WordDAC.DeleteRelevantWord(id);

            if (informationTypeID.HasValue)
            {
                return(Details(informationTypeID.Value));
            }
            else
            {
                return(View("Index"));
            }
        }
        public ActionResult Details(Int32 id)
        {
            List <RelevantWordDTO> relevantWords   = WordDAC.GetRelevantWords(id);
            RelevantWordDTO        relevantWordDTO = new RelevantWordDTO();

            relevantWordDTO.InformationTypeID = id;
            relevantWordDTO.Weight            = 1;
            relevantWordDTO.Word = "";

            relevantWords.Add(relevantWordDTO);

            List <RelevantWordDTO> automaticallyWeightedWords = relevantWords.FindAll(rw => rw.CreationType == RelevantWordDTO.CreationTypeEnum.AUTOMATIC).FindAll(rw => rw.Weight > 0);
            List <RelevantWordDTO> manuallyWeightedWords      = relevantWords.FindAll(rw => rw.CreationType == RelevantWordDTO.CreationTypeEnum.MANUAL).FindAll(rw => rw.Weight > 0);
            List <RelevantWordDTO> blockedWords = relevantWords.FindAll(rw => rw.Weight == 0);

            return(View("Details", new MessageDetailsModel
            {
                InformationType = InformationTypeDAC.GetInformationType(id, ContextManager.Current.SelectedAreaID.Value),
                AutomaticallyWeightedWords = automaticallyWeightedWords,
                ManuallyWeightedWords = manuallyWeightedWords,
                BlockedWords = blockedWords
            }));
        }