public async Task <IActionResult> Edit(int id, [Bind("ID,CustID,CustName,CustAge,CustJob")] Customer customer)
        {
            if (id != customer.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(customer));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,ShipID,Destination,CargoTag,ShippingDate,ShippingStatus")] Shipping shipping)
        {
            if (id != shipping.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shipping);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShippingExists(shipping.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(shipping));
        }
示例#3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,WarehouseNo,WarehouseLocation,WarehouseCapacity")] Warehouse warehouse)
        {
            if (id != warehouse.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouse);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseExists(warehouse.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(warehouse));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,CargoWeight,CargoMaterial,WarehouseNo,CargoTag")] Cargocargo cargocargo)
        {
            if (id != cargocargo.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cargocargo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CargocargoExists(cargocargo.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(cargocargo));
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,AgentID,AgentName,AgentCompany,AgentRole")] Agent agent)
        {
            if (id != agent.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(agent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AgentExists(agent.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(agent));
        }