예제 #1
0
        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();
        }
예제 #2
0
 public Model.Location ParseLocation(Entity.Location location)
 {
     return(new Model.Location
     {
         LocationName = location.LocationName,
         LocationAddress = location.LocationAddress,
         LocationID = location.Id,
     });
 }
예제 #3
0
 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));
 }
예제 #4
0
 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));
 }
예제 #5
0
 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
     });
 }
예제 #7
0
 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
     });
 }
예제 #8
0
        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);
        }
예제 #9
0
        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));
            }
        }
예제 #10
0
 public Model.Location ParseLocations(Entity.Location location)
 {
     throw new System.NotImplementedException();
 }
예제 #11
0
 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));
 }
예제 #12
0
 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);
 }