public void CheckInItem(int id) { // this is for same time in db var now = DateTime.Now; var item = _context.WarehouseAssets.FirstOrDefault(a => a.Id == id); _context.Update(item); var checkout = _context.Checkouts.Include(c => c.WarehouseAsset).Include(c => c.WarehouseEmployeeCard).FirstOrDefault(a => a.WarehouseAsset.Id == id); if (checkout != null) { _context.Remove(checkout); } var history = _context.CheckoutHistories.Include(h => h.WarehouseAsset).Include(h => h.WarehouseEmployeeCard).FirstOrDefault(h => h.WarehouseAsset.Id == id && h.CheckedIn == null); if (history != null) { _context.Update(history); history.CheckedIn = now; } item.Status = _context.Statuses.FirstOrDefault(a => a.Name == "Available"); Save(); }
public void Edit(Employee employee) { _context.Update(employee); Save(); }
public void Edit(WarehouseBranch branch) { _context.Update(branch); Save(); }
public void Edit(Status status) { _context.Update(status); Save(); }
public void Edit(WarehouseAsset asset) { _context.Update(asset); Save(); }