예제 #1
0
        public ServiceSourceObject GetSources(string sourceTypes, string sourceRef, string sourceDesc, string origLoc,
            string dateLB, string toDateLB, string dateUB, string toDateUB, string fileCount, string isThackrayFound,
            string isCopyHeld, string isViewed, string isChecked, string page_number, string page_size, string sortColumn)
        {
            var serviceSourceObject = new ServiceSourceObject();

            string retVal = "";
            var ssf = new SourceSearchFilter()
                {
                    CensusSources1841 = false,
                    CensusPlaces1841 = false,
                    CopyHeld = isChecked.ToNullableBool() == true ? isCopyHeld.ToNullableBool() : null,
                    ThackrayFound = isChecked.ToNullableBool() == true ? isThackrayFound.ToNullableBool() : null,
                    Viewed = isChecked.ToNullableBool() == true ? isViewed.ToNullableBool() : null,
                    SourceTypes = sourceTypes.ParseToIntList(),
                    Ref = sourceRef,
                    Description = sourceDesc,
                    FromYear= (dateLB.ToInt32() + toDateLB.ToInt32()),
                    ToYear = (toDateUB.ToInt32() + dateUB.ToInt32()),
                    OriginalLocation = origLoc,
                    FileCount = fileCount,
                    UrStart = dateUB.ToInt32(),
                    UrEnd = toDateUB.ToInt32(),
                    LrStart = dateLB.ToInt32(),
                    LrEnd = toDateLB.ToInt32()
                };

            var iModel = new SourceSearch(new Security(new WebUser()));

            try
            {
                serviceSourceObject= iModel.Search(SourceSearchTypes.Standard, ssf, new DataShaping() { RecordStart = page_number.ToInt32(), RecordPageSize = page_size.ToInt32(), Column = sortColumn }, new SourceSearchValidator(ssf));
            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }
            finally
            {
                if (retVal != "") retVal += Environment.NewLine;

                serviceSourceObject.ErrorStatus = retVal;
            }

            return serviceSourceObject;
        }
예제 #2
0
        public List<string> GetSourceNames(string sourceIds)
        {
            var serviceSourceObject = new ServiceSourceObject();

            var iModel = new SourceSearch(new Security(new WebUser()));

            string retVal = "";
            try
            {
                var ssf = new SourceSearchFilter() { Sources = sourceIds.ParseToGuidList() };
                serviceSourceObject = iModel.Search(SourceSearchTypes.SourceIds, ssf, new DataShaping(){RecordPageSize = 0}, new SourceSearchValidator(ssf));
            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }
            finally
            {
                if (retVal != "") retVal += Environment.NewLine;

                serviceSourceObject.ErrorStatus = retVal;
            }

            return serviceSourceObject.serviceSources.Select(p => p.SourceRef).ToList();
        }
예제 #3
0
        public List<CensusSource> Get1841CensusSources(Guid sourceId)
        {
            var serviceSourceObject = new ServiceSourceObject();
            var iModel = new SourceSearch(new Security(new WebUser()));

            string retVal = "";
            try
            {

                var ssf = new SourceSearchFilter() { Sources = new List<Guid>() { sourceId } };
                serviceSourceObject = iModel.Search(SourceSearchTypes.Censussource, ssf,new DataShaping(){RecordPageSize = 0},new SourceSearchValidator(ssf));

            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }
            finally
            {

                serviceSourceObject.ErrorStatus = retVal;
            }

            return serviceSourceObject.CensusSources;
        }
        public IHttpActionResult GetSources(string sourceTypes, string sourceRef, string sourceDesc, string origLoc,
            string dateLb, string toDateLb, string dateUb, string toDateUb, string fileCount, string isThackrayFound,
            string isCopyHeld, string isViewed, string isChecked, string pageNumber, string pageSize, string sortColumn)
        {
            ServiceSourceObject serviceSourceObject = new ServiceSourceObject();

            string retVal = "";
            var ssf = new SourceSearchFilter()
            {
                CensusSources1841 = false,
                CensusPlaces1841 = false,
                CopyHeld = isChecked.ToNullableBool() == true ? isCopyHeld.ToNullableBool() : null,
                ThackrayFound = isChecked.ToNullableBool() == true ? isThackrayFound.ToNullableBool() : null,
                Viewed = isChecked.ToNullableBool() == true ? isViewed.ToNullableBool() : null,
                SourceTypes = sourceTypes.ParseToIntList(),
                Ref = sourceRef ?? "",
                Description = sourceDesc ?? "",
                FromYear = (dateLb.ToInt32() + toDateLb.ToInt32()),
                ToYear = (toDateUb.ToInt32() + dateUb.ToInt32()),
                OriginalLocation = origLoc ?? "",
                FileCount = fileCount ?? "",
                UrStart = dateUb.ToInt32(),
                UrEnd = toDateUb.ToInt32(),
                LrStart = dateLb.ToInt32(),
                LrEnd = toDateLb.ToInt32()
            };

            var sourceSearch = new SourceSearch(new Security(new WebUser()));

            try
            {
                serviceSourceObject = sourceSearch.Search(SourceSearchTypes.Standard, ssf, new DataShaping() { RecordStart = pageNumber.ToInt32(), RecordPageSize = pageSize.ToInt32(), Column = sortColumn }, new SourceSearchValidator(ssf));
            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }

            if (retVal != "")
            {
                return Content(HttpStatusCode.BadRequest, retVal);
            }

            return Ok(serviceSourceObject);
        }
        public IHttpActionResult GetSourceNames(string sourceIds)
        {
            var servicesources = new List<string>();

            var sourceSearch = new SourceSearch(new Security(new WebUser()));

            string retVal = "";

            try
            {
                var ssf = new SourceSearchFilter() { Sources = sourceIds.ParseToGuidList() };
                var serviceSourceObject = sourceSearch.Search(SourceSearchTypes.SourceIds, ssf, new DataShaping() { RecordPageSize = 0 }, new SourceSearchValidator(ssf));

                servicesources = serviceSourceObject.serviceSources.Select(p => p.SourceRef).ToList();
            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }

            if (retVal != "")
            {
                return Content(HttpStatusCode.BadRequest, retVal);
            }

            return Ok(servicesources);
        }
        public IHttpActionResult Get1841CensusSources(Guid sourceId)
        {
            var serviceSourceObject = new ServiceSourceObject();
            var sourceSearch = new SourceSearch(new Security(new WebUser()));

            string retVal = "";
            try
            {

                var ssf = new SourceSearchFilter() { Sources = new List<Guid>() { sourceId } };
                serviceSourceObject = sourceSearch.Search(SourceSearchTypes.Censussource, ssf, new DataShaping() { RecordPageSize = 0 }, new SourceSearchValidator(ssf));

            }
            catch (Exception ex1)
            {
                retVal = "Exception: " + ex1.Message;
            }

            if (retVal != "")
            {
                return Content(HttpStatusCode.BadRequest, retVal);
            }

            return Ok(serviceSourceObject.CensusSources);
        }