//it retrieves all threads which person has access to.
        public object GetThreadIndex([System.Web.Http.FromUri] ThreadIndexSearchDTO indexSearchVM)
        {
            //base.SetMenuIndex(3);
            using (ThreadService threadService = new ThreadService())
            {
                Guid?ProcessID = indexSearchVM.IsAdvSearch ? indexSearchVM.AdvProcessID : indexSearchVM.ProcessID;

                DateTime?advStartDateFrom = indexSearchVM.IsAdvSearch ? indexSearchVM.AdvStartDateFrom : (DateTime?)null;

                DateTime?advStartDateTo = indexSearchVM.IsAdvSearch ? indexSearchVM.AdvStartDateTo : (DateTime?)null;

                DateTime?advEndDateFrom = indexSearchVM.IsAdvSearch ? indexSearchVM.AdvEndDateFrom : (DateTime?)null;

                DateTime?advEndDateTo = indexSearchVM.IsAdvSearch ? indexSearchVM.AdvEndDateTo : (DateTime?)null;

                List <sysBpmsThread> list = threadService.GetArchiveList(MyUser.ID, ProcessID, new int[] {
                    (int)sysBpmsThread.Enum_StatusLU.InProgress,
                    (int)sysBpmsThread.Enum_StatusLU.Done,
                    (int)sysBpmsThread.Enum_StatusLU.Draft,
                    (int)sysBpmsThread.Enum_StatusLU.InActive
                }, null, advStartDateFrom, advStartDateTo, advEndDateFrom, advEndDateTo, indexSearchVM.GetPagingProperties, new string[] { nameof(sysBpmsThread.User), nameof(sysBpmsThread.Process) });

                using (ProcessService processService = new ProcessService())
                {
                    indexSearchVM.Update(
                        processService.GetList(null, null, null, null).Where(c => c.StatusLU != (int)sysBpmsProcess.Enum_StatusLU.Draft),
                        list.Select(c => new ThreadDTO(c)).ToList());
                    return(indexSearchVM);
                }
            }
        }