Exemplo n.º 1
0
        public MapElementCollectionsViewModel MapMarkerSearchList(string userCode, string tenantCode, string markName, int pageIndex, int pageSize, ref int pageCount, string orderBy, EnumMapType mapType, int markType)
        {
            MapElementCollectionsViewModel returnValue = new MapElementCollectionsViewModel();

            //查询数据库获取标记List
            List<EMarkAreaElement> lsMarkArea = new List<EMarkAreaElement>();
            lsMarkArea = new MarkSearchDAL().GetEntityByMarkArea(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;
        }
Exemplo n.º 2
0
        private MapElementCollectionsViewModel LoadMark(string tenantCode, int pageIndex, int pageSize, EnumMapType mapType)
        {
            IMapElementService service = new MapElementService();
            MapElementCollectionsViewModel returnValue = new MapElementCollectionsViewModel();
            int markTotal = 0;
            IList<EMarkElement> ltMarkEntity = service.Search<EMarkElement>(tenantCode, string.Empty, pageIndex, pageSize, out markTotal);
            if (ltMarkEntity != null)
            {
                try
                {
                    ConvertLatLonHelper.ConvertToWebLatLon<EMarkElement>(ltMarkEntity, mapType);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.Message, ex);
                }

                returnValue.MapElementCount = markTotal;
                foreach (var e in ltMarkEntity)
                {
                    returnValue.MapElementCollections.Add(ConvertEMarkElementForBind(e));
                }
            }
            return returnValue;
        }
Exemplo n.º 3
0
        private MapElementCollectionsViewModel LoadMarkAndArea(string tenantCode, int pageIndex, int pageSize, EnumMapType mapType)
        {
            IMapElementService service = new MapElementService();
            MapElementCollectionsViewModel returnValue = new MapElementCollectionsViewModel();
            int markTotal = 0;
            List<EBaseElement> ltBaseEle = new List<EBaseElement>();
            IList<EMarkElement> markEntity = service.Search<EMarkElement>(tenantCode, string.Empty, 0, 50000, out markTotal);
            if (markEntity != null && markEntity.Count > 0)
            {
                foreach (var item in markEntity)
                {
                    ltBaseEle.Add(item);
                }
            }
            int areaTotal = 0;
            IList<EAreaElement> areaEntity = service.Search<EAreaElement>(tenantCode, string.Empty, 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)
            {
                pageIndex = ConvertCommon.ProcessPageIndex(ltBaseEle.Count, pageIndex, pageSize);
                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;
        }
Exemplo n.º 4
0
        private MapElementCollectionsViewModel LoadArea(string tenantCode, int pageIndex, int pageSize, EnumMapType mapType)
        {
            IMapElementService service = new MapElementService();
            MapElementCollectionsViewModel returnValue = new MapElementCollectionsViewModel();
            int areaTotal = 0;
            IList<EAreaElement> ltAreaEntity = service.Search<EAreaElement>(tenantCode, string.Empty, pageIndex, pageSize, out areaTotal);
            if (!ltAreaEntity.IsNullOrEmpty())
            {
                returnValue.MapElementCount = areaTotal;

                ConvertToWebLatLon(ltAreaEntity, mapType);

                foreach (var e in ltAreaEntity)
                {
                    returnValue.MapElementCollections.Add(ConvertEAreaElementForBind(e));
                }
            }
            return returnValue;
        }