public async Task <Ilosorderpickgroup> AddILOSOrderpickgroup(Ilosorderpickgroup orderGroup)
        {
            var result = await _context.Ilosorderpickgroups.AddAsync(orderGroup);

            await _context.SaveChangesAsync();

            return(result.Entity);
        }
        public async Task <Ilosorderpickgroup> UpdateILOSOrderpickgroup(Ilosorderpickgroup orderGroup)
        {
            var result = await _context.Ilosorderpickgroups.FirstOrDefaultAsync(s => s.Id == orderGroup.Id);

            if (result != null)
            {
                result.Orderpickgroup = orderGroup.Orderpickgroup;
                await _context.SaveChangesAsync();

                return(result);
            }

            return(null);
        }
 public async void UpdateILOSOrderpickgroup(int id, Ilosorderpickgroup ilosCategory)
 {
     await httpClient.PutAsJsonAsync($"/api/IlosOrderpickgroups/{id}", ilosCategory);
 }
        public async Task <Ilosorderpickgroup> CreateILOSOrderpickgroup(Ilosorderpickgroup IlosOrderpickgroup)
        {
            var result = await httpClient.PostAsJsonAsync("/api/IlosOrderpickgroups", IlosOrderpickgroup);

            return(await result.Content.ReadAsAsync <Ilosorderpickgroup>());
        }
        public async Task <ActionResult <Ilosorderpickgroup> > UpdateILOSOrderpickgroup(int id, Ilosorderpickgroup orderpickgroup)
        {
            try
            {
                if (id != orderpickgroup.Id)
                {
                    return(BadRequest());
                }

                var orderpickgroupToUpdate = await _orderpickgroup.GetILOSOrderpickgroup(id);

                if (orderpickgroupToUpdate == null)
                {
                    return(NotFound($"ILOSOrderpickgroup with id = {id} not found"));
                }

                return(await _orderpickgroup.UpdateILOSOrderpickgroup(orderpickgroup));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from the database."));
            }
        }
        public async Task <ActionResult <Ilosorderpickgroup> > CreateILOSOrderpickgroup(Ilosorderpickgroup orderpickgroup)
        {
            try
            {
                if (orderpickgroup == null)
                {
                    return(BadRequest());
                }

                var createdILOSOrderpickgroup = await _orderpickgroup.AddILOSOrderpickgroup(orderpickgroup);

                return(createdILOSOrderpickgroup);
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from the database."));
            }
        }