public ActionResult Index(Nullable <int> id)
 {
     if (id.HasValue)
     {
         List <InputDTO>    inputMessages   = new List <InputDTO>();
         InformationTypeDTO informationType = InformationTypeDAC.GetInformationType(id.Value, ContextManager.Current.SelectedAreaID.Value);
         if (informationType.Title == "Unknown") // id.Value == 203)
         {
             inputMessages = InputDAC.GetFilteredInputMessages(id.Value, ContextManager.Current.SelectedAreaID.Value, Membership.GetUser().Email);
         }
         else
         {
             inputMessages = InputDAC.GetInputMessages(id.Value, ContextManager.Current.SelectedAreaID.Value, 0);
         }
         return(View("Index", new InputIndexModel()
         {
             InputMessages = inputMessages, InformationType = InformationTypeDAC.GetInformationType(id.Value, ContextManager.Current.SelectedAreaID.Value)
         }));
     }
     else
     {
         return(View("Index", new InputIndexModel()
         {
             InputMessages = InputDAC.GetInputMessages(ContextManager.Current.SelectedAreaID.Value, 50)
         }));
     }
 }
        public ActionResult ReanalyzeAllItems(Nullable <int> informationTypeID)
        {
            List <InputDTO> inputMessages = null;

            if (informationTypeID.HasValue)
            {
                InformationTypeDTO informationType = InformationTypeDAC.GetInformationType(informationTypeID.Value, ContextManager.Current.SelectedAreaID.Value);
                if (informationType.Title == "Unknown")
                {
                    inputMessages = InputDAC.GetFilteredInputMessages(informationTypeID.Value, ContextManager.Current.SelectedAreaID.Value, Membership.GetUser().Email);
                }
                else
                {
                    inputMessages = InputDAC.GetInputMessages(informationTypeID.Value, ContextManager.Current.SelectedAreaID.Value, 0);
                }
            }
            else
            {
                inputMessages = InputDAC.GetInputMessages(ContextManager.Current.SelectedAreaID.Value, 100000);
            }

            if (inputMessages != null)
            {
                foreach (InputDTO inputMessage in inputMessages)
                {
                    Analyzer.RerunAnalysis(inputMessage.ID.Value, ContextManager.Current.SelectedAreaID.Value);
                }
            }

            return(Index(informationTypeID));
        }
        public ActionResult Move(Nullable <Int32> informationTypeID, IList <SelectListItem> CheckedList)
        {
            /* Remove the ones with no value, as these are not checked - MRS */
            CheckedList = CheckedList.Where(a => a.Value != null).ToList <SelectListItem>();

            /* Move these */

            if (informationTypeID.HasValue)
            {
                return(View("InputListControl", new InputIndexModel()
                {
                    InputMessages = InputDAC.GetInputMessages(informationTypeID.Value, ContextManager.Current.SelectedAreaID.Value, 0)
                }));
            }
            else
            {
                return(View("InputListControl", new InputIndexModel()
                {
                    InputMessages = InputDAC.GetInputMessages(ContextManager.Current.SelectedAreaID.Value, 50)
                }));
            }
        }
        public ActionResult Search(String searchText, Nullable <Int32> informationTypeID, String msgAmount)
        {
            Int32 msgAmountInt;

            if (!Int32.TryParse(msgAmount, out msgAmountInt))
            {
                msgAmountInt = 50;
            }
            if (informationTypeID.HasValue)
            {
                return(View("InputListControl", new InputIndexModel()
                {
                    InputMessages = InputDAC.GetInputMessages(ContextManager.Current.SelectedAreaID.Value, informationTypeID.Value, searchText, msgAmountInt)
                }));
            }
            else
            {
                return(View("InputListControl", new InputIndexModel()
                {
                    InputMessages = InputDAC.GetInputMessages(ContextManager.Current.SelectedAreaID.Value, searchText, msgAmountInt)
                }));
            }
        }