コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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"));
            }
        }