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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }