public static bool SetLocation(lo.Location location, pdm.Address address) { var dataAddress = new Address() { Street = address.Street, City = address.City, State = address.State }; _db.Address.Add(dataAddress); var dataLocation = new Location() { AddressId = dataAddress.AddressId, OrderNumber = location.OrderNumber }; _db.Location.Add(dataLocation); var newLocation = _db.Location.Where(a => a.AddressId == dataLocation.AddressId).FirstOrDefault(); InitLocationInventory(newLocation.LocationId); return(_db.SaveChanges() == 3); }
public static List <lo.Location> GetLocations() { var du = new List <lo.Location>(); foreach (var location in _db.Location.ToList()) { var dataAddress = _db.Address.Where(a => a.AddressId == location.AddressId).FirstOrDefault(); var address = new pdm.Address(dataAddress.Street, dataAddress.City, dataAddress.State); du.Add(new lo.Location(address)); } return(du); }
public static bool SetLocation(lo.Location location, pdm.Address address) { return(LocationHelper.SetLocation(location, address)); }