Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("FuncaoID,Nome")] Funcao funcao)
        {
            if (id != funcao.FuncaoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(funcao);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FuncaoExists(funcao.FuncaoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(funcao));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("HorarioID,DataInicioTurno,Duracao,DataFimTurno,TurnoId,PostoId,ColaboradorId")] Horario horario)
        {
            if (id != horario.HorarioID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(horario);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HorarioExists(horario.HorarioID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ColaboradorId"] = new SelectList(_context.Colaborador, "ColaboradorId", "Cc", horario.ColaboradorId);
            ViewData["PostoId"]       = new SelectList(_context.Posto, "PostoId", "Nome", horario.PostoId);
            ViewData["TurnoId"]       = new SelectList(_context.Turno, "TurnoId", "Nome", horario.TurnoId);
            return(View(horario));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("EsterilizarID,EquipamentoID,MaterialcsID")] Trabalho_Posto esterilizar)
        {
            if (id != esterilizar.MaterialcsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(esterilizar);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EsterilizarExists(esterilizar.MaterialcsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EquipamentoID"] = new SelectList(_context.Equipamento, "TipoID", "TipoID", esterilizar.EquipamentoID);
            ViewData["MaterialcsID"]  = new SelectList(_context.Materialcs, "MaterialcsId", "Nome", esterilizar.MaterialcsID);
            return(View(esterilizar));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("RegrasID,Nome,Descricao")] Regras regras)
        {
            if (id != regras.RegrasID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(regras);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RegrasExists(regras.RegrasID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(regras));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("MaterialcsId,Nome,Quantidade")] Materialcs materialcs)
        {
            if (id != materialcs.MaterialcsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(materialcs);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MaterialcsExists(materialcs.MaterialcsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(materialcs));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(int id, [Bind("ColaboradorId,FuncaoID,Nome,Telefone,Email,Morada,DataNasc,Cc")] Colaborador colaborador)
        {
            if (id != colaborador.FuncaoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(colaborador);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ColaboradorExists(colaborador.FuncaoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FuncaoID"] = new SelectList(_context.Funcao, "FuncaoID", "Nome", colaborador.FuncaoID);
            return(View(colaborador));
        }
Esempio n. 7
0
        public async Task <IActionResult> Edit(int id, [Bind("TurnoId,Nome,HoraInicio,HoraFim")] Turno turno)
        {
            if (id != turno.TurnoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(turno);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TurnoExists(turno.TurnoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(turno));
        }
Esempio n. 8
0
        public async Task <IActionResult> Edit(int id, [Bind("PostoId,Nome")] Posto posto)
        {
            if (id != posto.PostoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(posto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PostoExists(posto.PostoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(posto));
        }
Esempio n. 9
0
        public async Task <IActionResult> Edit(int id, [Bind("EquipamentoID,Capacidade,TipoID")] Equipamento equipamento)
        {
            if (id != equipamento.EquipamentoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(equipamento);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EquipamentoExists(equipamento.EquipamentoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TipoID"] = new SelectList(_context.Tipo, "TipoID", "Nome", equipamento.TipoID);
            return(View(equipamento));
        }
Esempio n. 10
0
        public async Task <IActionResult> Edit(int id, [Bind("Trabalho_PostoID,EquipamentoID,MaterialcsID,Estado,HorarioID,DataServico")] Trabalho_Posto trabalho_Posto)
        {
            if (id != trabalho_Posto.MaterialcsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(trabalho_Posto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Trabalho_PostoExists(trabalho_Posto.MaterialcsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EquipamentoID"] = new SelectList(_context.Equipamento, "TipoID", "TipoID", trabalho_Posto.EquipamentoID);
            ViewData["HorarioID"]     = new SelectList(_context.Horario, "HorarioID", "HorarioID", trabalho_Posto.HorarioID);
            ViewData["MaterialcsID"]  = new SelectList(_context.Materialcs, "MaterialcsId", "Nome", trabalho_Posto.MaterialcsID);
            return(View(trabalho_Posto));
        }