コード例 #1
0
        public async Task <IActionResult> PutAdministrador(int id, Administrador administrador)
        {
            if (id != administrador.Id)
            {
                return(BadRequest());
            }

            _context.Entry(administrador).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AdministradorExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutCliente(int id, Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(BadRequest());
            }

            _context.Entry(cliente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #3
0
        public async Task <IActionResult> Putinterest(int id, interest interest)
        {
            if (id != interest.ID)
            {
                return(BadRequest());
            }

            _context.Entry(interest).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!interestExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #4
0
        public async Task<IActionResult> Putuser(int id, user user)
        {
            if (id != user.ID)
            {
                return BadRequest();
            }

            _context.Entry(user).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!userExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return NoContent();
        }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "Id,Nome,LoginUsuario,Senha,Email,Pefil,DataContratacao")] Usuario usuario)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usuario).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(usuario));
 }
コード例 #6
0
        public async Task <ActionResult <Mesaj> > GetMesaj(int id)
        {
            var mesaj = await _context.Mesajs.FindAsync(id);

            //Console.WriteLine(mesajs);
            if (mesaj.isRead == 1)
            {
                mesaj.isRead = 0;
                _context.Entry(mesaj).State = EntityState.Modified;
                await _context.SaveChangesAsync();
            }

            return(mesaj);
        }
コード例 #7
0
 public Personne Update(Personne personne)
 {
     context.Entry(personne).State = EntityState.Modified;
     Save();
     return(personne);
 }
コード例 #8
0
 public Voiture Update(Voiture voiture)
 {
     context.Entry(voiture).State = EntityState.Modified;
     Save();
     return(voiture);
 }