예제 #1
0
        public async Task <IActionResult> PutContaPagar(Guid id, ContaPagar contaAPagar)
        {
            if (id != contaAPagar.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutRegra(Guid id, Regra regra)
        {
            if (id != regra.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
 public ActionResult Edit([Bind(Include = "ContasId,Fornecedor,Dtvencimento,Dtpagamento,Pago,Descricao,Valor")] Contas contas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(contas));
 }
예제 #4
0
        public virtual void Update(TEntity obj)
        {
            var isDetached = Db.Entry(obj).State == EntityState.Detached;

            if (isDetached)
            {
                Db.Attach <TEntity>(obj);
            }

            DbSet.Update(obj);
        }