コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TipoPagamentoSet tipoPagamentoSet = tipoPagamentoRepository.ObterPorId(id);

            tipoPagamentoRepository.Apagar(tipoPagamentoSet);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Ativo")] TipoPagamentoSet tipoPagamentoSet)
 {
     if (ModelState.IsValid)
     {
         tipoPagamentoRepository.Atualizar(tipoPagamentoSet);
         return(RedirectToAction("Index"));
     }
     return(View(tipoPagamentoSet));
 }
コード例 #3
0
        // GET: TipoPagamento/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoPagamentoSet tipoPagamentoSet = tipoPagamentoRepository.ObterPorId(id.Value);

            if (tipoPagamentoSet == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoPagamentoSet));
        }
コード例 #4
0
 public void Inserir(TipoPagamentoSet entity)
 {
     try
     {
         if (entity != null)
         {
             dbcontext.TipoPagamentoSet.Add(entity);
             dbcontext.Entry(entity).State = System.Data.Entity.EntityState.Added;
             dbcontext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }