コード例 #1
0
        public IHttpActionResult GetParishDetail(string parishId)
        {
            //_logSearch.WriteLog("GetParishDetail", 1, WebHelper.GetRequestIp(), null);
               // Stopwatch stopWatch = new Stopwatch();
               // stopWatch.Start();

            var serviceParishDetailObject = new ServiceParishDetailObject();
            string retVal = "";

            try
            {
                serviceParishDetailObject = _mapDataSources.GetParishDetail(new ParishSearchFilter { ParishIds = new List<Guid> { parishId.ToGuid() } });
            }
            catch (Exception ex1)
            {
               // _logSearch.WriteLog("GetParishDetail", 1, WebHelper.GetRequestIp(), ex1);
                retVal = "Exception: " + ex1.Message;
            }

            if (retVal != "")
            {
                return Content(HttpStatusCode.BadRequest, retVal);
            }
            // stopWatch.Stop();
            // Get the elapsed time as a TimeSpan value.
            //TimeSpan ts = stopWatch.Elapsed;

            // _logSearch.WriteLog("GetParishDetail finished in " + ts.TotalMilliseconds, 1, WebHelper.GetRequestIp(), null);
            return Ok(serviceParishDetailObject);
        }
コード例 #2
0
        public ServiceParishDetailObject GetParishDetail(string parishId)
        {
            _logSearch.WriteLog("GetParishDetail", 1, WebHelper.GetRequestIp(), null);
            Stopwatch stopWatch = new Stopwatch();
            stopWatch.Start();

            var serviceParishDetailObject = new ServiceParishDetailObject();
            string retVal = "";

            try
            {
                serviceParishDetailObject = _mapDataSources.GetParishDetail(new ParishSearchFilter { ParishIds = new List<Guid> { parishId.ToGuid() } });
            }
            catch (Exception ex1)
            {
                _logSearch.WriteLog("GetParishDetail", 1, WebHelper.GetRequestIp(), ex1);
                retVal = "Exception: " + ex1.Message;
            }
            finally
            {
                if (retVal != "") retVal += Environment.NewLine;

                serviceParishDetailObject.ErrorStatus = retVal;
            }

            stopWatch.Stop();
            // Get the elapsed time as a TimeSpan value.
            TimeSpan ts = stopWatch.Elapsed;

            _logSearch.WriteLog("GetParishDetail finished in " + ts.TotalMilliseconds, 1, WebHelper.GetRequestIp(), null);
            return serviceParishDetailObject;
        }