예제 #1
0
        private VMapElementCollections LoadMark(string tenantCode, int pageIndex, int pageSize, EnumMapType mapType)
        {
            VMapElementCollections returnValue = new VMapElementCollections();
            int total = 0;
            IList<EMapMark> ltMarkEntity = DACFacade.Gps.MapMarkDAC.SelectList(tenantCode, pageIndex, pageSize, out total);
            if (ltMarkEntity != null)
            {
                LatLonModel.ConvertToWebLatLon<EMapMark>(ltMarkEntity, mapType);

                returnValue.MapElementCount = total;
                foreach (var e in ltMarkEntity)
                {
                    returnValue.MapElementCollections.Add(ConvertEMapMarkForBind(e));
                }
            }
            return returnValue;
        }
예제 #2
0
        private VMapElementCollections LoadMarkAndArea(string tenantCode, int pageIndex, int pageSize, EnumMapType mapType)
        {
            VMapElementCollections returnValue = new VMapElementCollections();
            int markTotal = 0;
            List<BaseMapElement> ltBaseEle = new List<BaseMapElement>();

            IList<EMapMark> markEntity = DACFacade.Gps.MapMarkDAC.SelectList(tenantCode, 0, 50000, out markTotal);
            if (markEntity != null && markEntity.Count > 0)
            {
                foreach (var item in markEntity)
                {
                    ltBaseEle.Add(item);
                }
            }
            int areaTotal = 0;
            IList<EMapArea> areaEntity = DACFacade.Gps.MapAreaDAC.SelectList(tenantCode, 0, 50000, out areaTotal);
            if (areaEntity != null && areaEntity.Count > 0)
            {
                foreach (var item in areaEntity)
                {
                    ltBaseEle.Add(item);
                }
            }
            ltBaseEle = ltBaseEle.OrderByDescending(o => o.CreateTime).ToList();
            if (ltBaseEle.Count >= pageSize)
            {
                int pageCount = ((ltBaseEle.Count - 1) / pageSize + 1);//总的页数
                if (pageCount > 0 && pageIndex >= pageCount)
                    pageIndex = pageCount - 1;

                ltBaseEle = ltBaseEle.Skip(pageIndex * pageSize).ToList();
                if (ltBaseEle.Count > pageSize)
                {
                    ltBaseEle = ltBaseEle.Take(pageSize).ToList();
                }
            }
            returnValue.MapElementCollections = ConvertMapElementVM(ltBaseEle, mapType);

            returnValue.MapElementCount = markTotal + areaTotal;
            return returnValue;
        }
예제 #3
0
        public VMapElementCollections MapMarkerSearchList(string userCode, string tenantCode, string markName, int pageIndex, int pageSize, ref int pageCount, string orderBy, EnumMapType mapType, int markType)
        {
            VMapElementCollections returnValue = new VMapElementCollections();

            //查询数据库获取标记List
            List<EMapArea> lsMarkArea = new List<EMapArea>();
            lsMarkArea = DACFacade.Gps.MapAreaDAC.SelectList(Convert.ToUInt64(userCode), Convert.ToUInt64(tenantCode), markName, pageIndex, pageSize, orderBy, ref pageCount, markType);
            if (lsMarkArea != null)
            {
                //ConvertMarkSearchVM转换返回
                returnValue.MapElementCollections = ConvertMarkSearchVM(lsMarkArea, mapType);
            }
            returnValue.MapElementCount = pageCount;
            return returnValue;
        }