예제 #1
0
 public string Delete(int id)
 {
     try
     {
         using (var context = new BarandillasEntities())
         {
             Tablas_BD tabla = context.Tablas_BD.Find(id);
             tabla.Estatus = false;
             context.Entry(tabla).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
             return tabla.Nombre;
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #2
0
 public string Update(Tablas_BD tablas)
 {
     try
     {
         using (var context = new BarandillasEntities())
         {
             context.Entry(tablas).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
             return tablas.Nombre;
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }