Example #1
0
        public async Task <IActionResult> PutRegistroponto(int id, Registroponto registroponto)
        {
            if (id != registroponto.Idregistroponto)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <ActionResult <Registroponto> > PostRegistroponto(Registroponto registroponto)
        {
            _context.Registroponto.Add(registroponto);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRegistroponto", new { id = registroponto.Idregistroponto }, registroponto));
        }
        public bool Delete(int idregistroponto)
        {
            Registroponto registroponto = context.Registroponto.Find(idregistroponto);

            if (registroponto != null)
            {
                context.Registroponto.Remove(registroponto);
                context.SaveChanges();
                return(true);
            }
            return(false);
        }
 public Registroponto Update(int idregistroponto, Registroponto registroponto)
 {
     throw new NotImplementedException();
 }
 public Int32 Add(Registroponto registroponto)
 {
     context.Registroponto.Add(registroponto);
     context.SaveChanges();
     return(registroponto.Idregistroponto);
 }