Exemplo n.º 1
0
        public int Save(Location location)
        {
            ILocationDbProvider db = ObjectContainer.GetLocationDbProvider();

            if (location.ID == 0)
            {
                int id = db.Create(location);
                return(id);
            }
            else
            {
                return(db.Update(location));
            }
        }
Exemplo n.º 2
0
        public List <Location> EraseListLocationPoints(List <Location> locations)
        {
            ILocationDbProvider locationDbProvider = ObjectContainer.GetLocationDbProvider();

            for (var i = 0; i < locations.Count; i++)
            {
                if (locations[i].Transit)
                {
                    locationDbProvider.Delete(locations[i].ID);
                    locations.RemoveAt(i);
                    locationDbProvider.Delete(locations[i - 1].ID);
                    locations.RemoveAt(i - 1);
                    i -= 2;
                    //Order is important here
                }
            }

            return(locations);
        }
Exemplo n.º 3
0
        public Location Get(int id)
        {
            ILocationDbProvider db = ObjectContainer.GetLocationDbProvider();

            return(db.Read(id));
        }