public void UpdateLocation(Location location2BUpated) { Entity.Location oldLocation = _context.Locations.Find(location2BUpated.Id); _context.Entry(oldLocation).CurrentValues.SetValues(_mapper.ParseLocation(location2BUpated)); _context.SaveChanges(); _context.ChangeTracker.Clear(); }
public Model.Location ParseLocation(Entity.Location location) { return(new Model.Location { LocationName = location.LocationName, LocationAddress = location.LocationAddress, LocationID = location.Id, }); }
public Model.Location GetLocation(int LocationID) { Entity.Location found = _context.Locations.FirstOrDefault(location => location.LocationId == LocationID); if (found == null) { return(null); } return(new Model.Location(found.LocationName, found.LocationAddress)); }
public Model.Location GetLocation(Model.Location location) { Entity.Location found = _context.Locations.FirstOrDefault(loca => loca.StoreName == location.StoreName && loca.Address == location.Address && loca.City == location.City && loca.State == location.State); if (found == null) { return(null); } Log.Information("DL sent location to BL"); return(new Model.Location(found.LocationId, found.StoreName, found.Address, found.City, found.State)); }
public Model.Location ParseLocation(Entity.Location location) { return(new Model.Location { LocationName = location.LocationName, Address = location.LocationAddress, //Product = ParseProduct(location.Product), Id = location.Id }); }
public Model.Location ParseLocation(Entity.Location location) { return(new Model.Location { Address = location.Address, City = location.City, State = location.State, Zipcode = location.Zipcode, Id = location.Id }); }
public Model.Location ParseLocation(Entity.Location location) { return(new Model.Location { LocName = location.LocName, LocPhone = location.LocPhone, LocAddress = location.LocAddress, //Inventory = ParseInventory(location.Inventory), Id = location.Id }); }
public List <Model.Item> GetInventory(Model.Location location) { Entity.Location found = _context.Locations.FirstOrDefault(local => local.LocationName == location.LocationName && local.LocationAddress == location.Address); List <Model.Item> items = _context.Items.Where( item => item.LocationId == found.LocationId && item.OrderId == null) .Select( item => new Model.Item(new Model.Product(item.ProductName, (double)item.Price), (int)item.Quantity) ).ToList(); return(items); }
public Model.Location GetLocation(Model.Location location) { Entity.Location found = _context.Locations.FirstOrDefault(local => local.LocationName == location.LocationName && local.LocationAddress == location.Address); if (found == null) { return(null); } else { return(new Model.Location(found.LocationName, found.LocationAddress, found.LocationId)); } }
public Model.Location ParseLocations(Entity.Location location) { throw new System.NotImplementedException(); }
public Model.Location GetLocation(string branchName) { Entity.Location found = _context.Locations.FirstOrDefault(obj => obj.Name == branchName); return((found == null) ? null : new Model.Location(found.Id, found.Name, found.Address)); }
public Model.Location ParseLocation(Entity.Location location) { Model.Location newLocation = new Model.Location(location.Address, location.State, location.LocationName); newLocation.LocationID = location.LocationId; return(newLocation); }