public ActionResult <Location> PutLocation(long id, Location location)
        {
            if (id != location.Id)
            {
                return(BadRequest());
            }

            location.LastUpdatedDateTime = DateTime.Now;

            _context.Entry(location).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LocationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(location);
        }
示例#2
0
        public ActionResult <SecondaryCustomerShipToAddress> PutSecondaryCustomerShipToAddress(long id, SecondaryCustomerShipToAddress secondaryCustomerShipToAddress)
        {
            if (id != secondaryCustomerShipToAddress.Id)
            {
                return(BadRequest());
            }

            _context.Entry(secondaryCustomerShipToAddress).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SecondaryCustomerShipToAddressExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(secondaryCustomerShipToAddress);
        }
示例#3
0
        public async Task <IActionResult> PutSalesTeamBin(int id, SalesTeamBin salesTeamBin)
        {
            if (id != salesTeamBin.LineId)
            {
                return(BadRequest());
            }
            salesTeamBin.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(salesTeamBin).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SalesTeamBinExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutEmployeeResponsibility(int id, EmployeeResponsibility employeeResponsibility)
        {
            if (id != employeeResponsibility.LineId)
            {
                return(BadRequest());
            }

            employeeResponsibility.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(employeeResponsibility).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EmployeeResponsibilityExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public IActionResult PutCodeDetail(long id, CodeDetail codeDetail)
        {
            if (id != codeDetail.Id)
            {
                return(BadRequest());
            }
            codeDetail.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(codeDetail).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CodeDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#6
0
        public IActionResult PutApplyForHeader(long id, ApplyForHeader applyForHeader)
        {
            if (id != applyForHeader.Id)
            {
                return(BadRequest());
            }
            applyForHeader.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(applyForHeader).State = EntityState.Modified;

            try
            {
                _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ApplyForHeaderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#7
0
        public ActionResult <CodeMaster> PutCodeMaster(long id, CodeMaster codeMaster)
        {
            if (id != codeMaster.Id)
            {
                return(BadRequest());
            }
            codeMaster.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(codeMaster).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CodeMasterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(codeMaster);
        }
示例#8
0
        public IActionResult PutStructure(long id, Structure structure)
        {
            if (id != structure.Id)
            {
                return(BadRequest());
            }

            _context.Entry(structure).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StructureExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#9
0
        public async Task <IActionResult> PutReceiver(int id, Receiver receiver)
        {
            if (id != receiver.Id)
            {
                return(BadRequest());
            }

            _context.Entry(receiver).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReceiverExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutProductGroupDetail(int id, ProductGroupDetail productGroupDetail)
        {
            if (id != productGroupDetail.Id)
            {
                return(BadRequest());
            }

            _context.Entry(productGroupDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProductGroupDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#11
0
        public async Task <ActionResult <RoomGroup> > PutRoomGroup(int id, RoomGroup roomGroup)
        {
            if (id != roomGroup.Id)
            {
                return(BadRequest());
            }
            roomGroup.LastUpdatedDateTime   = DateTime.Now;
            _context.Entry(roomGroup).State = EntityState.Modified;
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoomGroupExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#12
0
        public IActionResult PutCalendar(long id, Calendar calendar)
        {
            if (id != calendar.Id)
            {
                return(BadRequest());
            }

            _context.Entry(calendar).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CalendarExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public IActionResult PutGoodsGroup(long id, GoodsGroup GoodsGroup)
        {
            if (id != GoodsGroup.id)
            {
                return(BadRequest());
            }

            _context.Entry(GoodsGroup).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GoodsGroupExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#14
0
        public IActionResult PutUOM(long id, UOM uom)
        {
            if (id != uom.Id)
            {
                return(BadRequest());
            }

            _context.Entry(uom).State = EntityState.Modified;

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UOMExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#15
0
        public async Task <IActionResult> PutOrders(int id, Orders orders)
        {
            if (id != orders.OrderCode)
            {
                return(BadRequest());
            }

            _context.Entry(orders).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrdersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#16
0
        public async Task <IActionResult> PutTotalBlood(int?id, TotalBlood totalBlood)
        {
            if (id != totalBlood.DonorId)
            {
                return(BadRequest());
            }

            _context.Entry(totalBlood).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TotalBloodExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public Donor PutDonors(int id, Donor donor)
 {
     _context.Entry(donor).State = EntityState.Modified;
     _context.SaveChangesAsync();
     return(donor);
 }