Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,UserName,UserSurname,UserPhone,UserOrganization,FileName,FilePath,Status")] Order order)
        {
            if (id != order.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(order);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderExists(order.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MaterialName,MaterialSize,MaterialPrice")] Material material)
        {
            if (id != material.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(material);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MaterialExists(material.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(material));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,TypeName,TypeSize,TypePrice")] AdvType advType)
        {
            if (id != advType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(advType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdvTypeExists(advType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(advType));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Login,Password")] User user)
        {
            if (id != user.ID)
            {
                return(NotFound());
            }

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