public AreaStatistics GetAreaStatistics(int id) { Log.Info(">>>>> GetAreaStatistics id=" + id); Stopwatch watch = new Stopwatch(); watch.Start(); List <int?> lst = new List <int?>(); List <int?> lstRecv; var areaList = db.Areas.ToList(); var a1 = areaList.Find(p => p.Id == id); if (a1 == null) { return(new AreaStatistics()); } lst.Add(a1.Id); lstRecv = GetAreaStatisticsInner(a1.Id, areaList); if (lstRecv != null || lstRecv.Count > 0) { lst.AddRange(lstRecv); } AreaService asr = new AreaService(); AreaStatistics ast = asr.GetAreaStatisticsCount(lst); watch.Stop(); TimeSpan time = watch.Elapsed; Log.Info("time:" + time); Log.Info("<<<<<< GetAreaStatistics id=" + id); return(ast); }
public Bound GetBound(TEntity area) { if (area.InitBound != null) { return(area.InitBound); } var bound = new DbModel.Location.AreaAndDev.Bound(); bool r1 = db.Bounds.Add(bound); area.InitBoundId = bound.Id; var newArea = new AreaService().Put(area); area.InitBound = bound.ToTModel(); return(area.InitBound); }
public Bound GetBound(TEntity area) { try { if (area.InitBound != null) { return(area.InitBound); } var bound = new DbModel.Location.AreaAndDev.Bound(); bool r1 = db.Bounds.Add(bound); area.InitBoundId = bound.Id; var newArea = new AreaService().Put(area); area.InitBound = bound.ToTModel(); return(area.InitBound); } catch (System.Exception ex) { Log.Error(tag, "GetBound", ex.ToString()); return(null); } }
public AreaNode GetPhysicalTopologyTreeNode(int view) { var result = new AreaService(db).GetBasicTree(view); return(result); }