Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("NumQuarto,DescQuarto,StatusQuarto,ValorDiaria,CodReserva")] Room room)
        {
            if (id != room.NumQuarto)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(room);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoomExists(room.NumQuarto))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(room));
        }
        public async Task <IActionResult> Edit(int id, [Bind("FuncID,ResID,Id")] EmployeeReserva employeeReserva)
        {
            if (id != employeeReserva.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employeeReserva);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeReservaExists(employeeReserva.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employeeReserva));
        }
Пример #3
0
        public async Task <IActionResult> Edit(long id, [Bind("CpfHos,Nome,Rg,Nascim,Genero,Profissao,Logradouro,Bairro,Complemento,Cidade,Cep,Telefone,Celular,Email,CpfAcomp")] Guest guest)
        {
            if (id != guest.CpfHos)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(guest);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GuestExists(guest.CpfHos))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(guest));
        }
        public async Task <IActionResult> Edit(long id, [Bind("CpfFunc,Nome,Logradouro,Bairro,Complemento,Cidade,Cep,Telefone,DtNasc,DtAdmissao,Email,Cargo")] Employee employee)
        {
            if (id != employee.CpfFunc)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.CpfFunc))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Пример #5
0
        public async Task <IActionResult> Edit(int id, [Bind("CodReserva,NomeHos,DataCheckin,DataCheckout,QtdAcomp,CpfFunc,CpfHos,NumQuarto")] Reserva reserva)
        {
            if (id != reserva.CodReserva)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reserva);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservaExists(reserva.CodReserva))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(reserva));
        }
Пример #6
0
        public async Task <IActionResult> Edit(int id, [Bind("CodPagamento,NumQuarto,TipoQuarto,NomeHos,QtdCriancas,QtdAdu,Valor,DataCheckin,DataCheckout,HrCheckin,HrCheckout,CpfFunc,CpfHos,Taxa,FormaPag")] Payment payment)
        {
            if (id != payment.CodPagamento)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(payment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentExists(payment.CodPagamento))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(payment));
        }
        public async Task <IActionResult> Edit(long id, [Bind("CpfAcom,Nome,Rg,Nascim,Genero,Logradouro,Bairro,Complemento,Cidade,Cep,Telefone,Email,Celular,Responsavel,CpfHos")] Escorts escorts)
        {
            if (id != escorts.CpfAcom)
            {
                return(NotFound());
            }

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