Exemplo n.º 1
0
 public ActionResult Insert(int Key, string values)
 {
     try
     {
         var obj = new Participante();
         JsonConvert.PopulateObject(values, obj);
         _ctx.Participante.Add(obj);
         _ctx.SaveChanges();
         // TODO: Add insert logic here
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 2
0
 public ActionResult Delete(string Key, string values)
 {
     try
     {
         // TODO: Add delete logic here
         var obj = _ctx.PlanoContas.First(c => c.Id == Key);
         _ctx.PlanoContas.Remove(obj);
         _ctx.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 3
0
 public ActionResult Delete(int Key, string values)
 {
     try
     {
         // TODO: Add delete logic here
         var diario = _ctx.Diario.First(c => c.Id == Key);
         _ctx.Diario.Remove(diario);
         _ctx.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }